Skip to main content
Hosted checkout is a payment page for one payment, with an amount your server sets: a basket total, a booking, a top-up. Your server creates a session, you send the payer to its page, and they pay there by card. Card details go straight from the payer’s browser to the card processor and never touch your servers. Use payment links instead when the amount is fixed and the same for everyone. Scope: checkout:write.

How it works

1

Create a session on your server

The payment goes to your default account in that currency, so open one first.
2

Send the payer to the page

Redirect the payer, or link them, to:
The page shows your business’s verified name and the amount, takes the card (with 3-D Secure where the bank asks), and shows the result. A declined card leaves the session open, so they can try another card.
3

Confirm the payment

Fetch the session from your server and fulfil the order when state is completed.

Session states

Treat completed as the only paid state. A processing session isn’t paid yet and doesn’t expire while a payment is in flight.
Checkout doesn’t notify your server yet, and the page doesn’t redirect back to your site. Poll the session from your server (for example every few seconds while the payer is on the page, then less often) until it’s completed, cancelled or expired. Webhooks are coming.

Keeping it secure

  • Create sessions on your server. The access token is a secret. The amount comes from your server, so a payer can’t change it.
  • The session ID is the payer’s key to the page. Anyone with it can see the amount and pay it. Don’t publish it, but it’s fine in a redirect.
  • Check the amount in the completed session matches the order before fulfilling.