First: two things the link requires
The
slug is your tenant’s and goes into the public URL, so it is an argument:
the SDK does not infer it from a secret key.
What happens when somebody opens it
The link has no payer. Whoever opens it fills in their own details and pays; the customer and the invoice are materialised on submit. That is what lets you send the same link to several people — or to a group — without registering anyone beforehand. The money is received by your provider account. Which provider processes it is decided by Infi Routing at payment time, not when the link is created.Where the payer goes afterwards
By default they stay on our receipt. If you want the payer back on your site, pass the URLs when creating the link:successUrl with
?status=success&invoice=<id> appended — your own parameters are kept.
cancelUrl shows up as “Back to {your store}” while the checkout is open.
Both must be absolute http(s) URLs; a relative path or any other scheme
answers 422.
The same pair exists on infi.checkout({ successUrl, cancelUrl }) for invoices
created on your server, and in the embed (@beinfi/checkout) the equivalent is
the returnUrl prop.
Listing and revoking
So how do I know they paid?
Not from whatlinks.create returns: payment is asynchronous. In production, a
signed webhook (payment.confirmed); in sandbox, polling the invoice — both in
webhooks.
When to use the link, and when not to
Use the link
A one-off sale, charging over WhatsApp, a first sale before you have an app.
Use metering
Continuous usage billing (tokens, requests), where the amount only exists
after the customer consumed it — see SDK.