Skip to main content
This tutorial creates a Hosted Checkout session with a manual amount. Your backend receives a URL and returns it to the frontend.

Gather the requirements

You need:
  • A SimplePay account
  • A merchant with an active sandbox environment
  • A key with hosted_checkout:write
  • A backend that protects the key
Never include a SimplePay key in browser JavaScript, a mobile app, or a repository.

Configure your terminal

Set the sandbox host. Read the key without storing it in shell history:

Create the session

Send the amount in the currency’s minor unit. 50000 represents MXN 500.00:
The response includes id, public_reference, and url. Store id for authenticated reads and redirect to url.

Confirm the result

The browser does not confirm a payment. Update your order after payment.succeeded or an equivalent authenticated read.

Configure webhooks

Verify signatures and process events without duplicating effects.
Last modified on August 22, 2026