Skip to main content
A payment link is a hosted start page for a payment. You create it once, share the URL by message, email, invoice or QR code, and every customer who opens it can pay through Vestrapay checkout. There is no integration to build on the customer-facing side, which makes links ideal for invoices, donations, event fees, one-off collections and merchants who do not have a website. Each time a customer pays through a link, Vestrapay initialises a fresh payment behind the scenes. Everything that applies to normal payments applies here: the same channels, fees, webhooks and verification. The easiest way is the dashboard: Payments → Payment links. You can also create links with the API. Link management uses a merchant session token, not the secret key, because it is a dashboard operation.
The response gives you the link and its URL:
Share data.paymentLinkUrl. The URL shown is abbreviated here. Use the exact value the response returns for the environment you called.

Metadata is a form, not an echo

On a payment link, metadata defines the prompts the customer completes before checkout starts. It is an object whose keys are your field names and whose values describe each prompt, with a label, a type such as email or text, whether it is required, and an optional placeholder. Vestrapay adds a stable id to each prompt, and the customer’s answers are keyed by that ID. This differs from the metadata object you send on initialise, which is opaque correlation data returned on verify. Do not confuse the two.

Fixed amounts, open amounts and splits

  • Fixed amount. The link always charges that amount.
  • Open amount. The customer enters the amount at checkout. If the link also has a distribution, the amount they enter must be at least the sum of the distribution amounts, otherwise the payment is rejected.
  • With splits. A distribution on the link is applied on every payment, so the split happens without any code on your side. If a service named in the distribution is later disabled, paying through the link is rejected until you fix the link or re-enable the service.
All of these use the merchant session token. Update accepts the same fields as create, plus status, which you can set to active or paused to switch a link off and on without deleting it. Links can also become expired or exhausted. Those states are managed by the system and cannot be set manually. Omit distribution or metadata from an update to leave the existing values as they are. A paused, expired or exhausted link returns HTTP 410 with payment_link.inactive to anyone who opens it.

What the customer does

  1. Opens the link.
  2. Completes any prompts you configured.
  3. Vestrapay initialises checkout for that link.
  4. The customer pays on hosted checkout.
  5. You confirm with webhooks and verify.
If you want a fully custom page in front of a link, two public endpoints power it. Neither needs authentication. The display response contains the title, amount, currency, merchant name, environment and the prompts, each with its generated id. The pay request carries the answers keyed by those IDs, and an amount when the link is open-amount:
The response is a normal payment session, so redirect to data.checkoutUrl:
The amount in the pay body is required for open-amount links and ignored for fixed-amount links. A link payment is an ordinary transaction with its own reference. Your webhook receives the same events, and verify returns the same data, so your fulfilment code does not need a separate path. Use the answers you collected, such as an order ID prompt, to match the payment to your records, since there is no initialise call of your own to attach metadata to.

Failure modes

See Errors for the full list.