Backend Payment Creation
Mint payments must be created on your backend, never in the browser. Your secret key identifies your organization and can create payments, so treat it like any other server-side credential.
Before you start
You need a checkout ID and a secret API key from the Mint Dashboard. Use a test checkout and a test key while integrating.
Create a payment
Send a POST request to https://api.getmint.money/v1/payments with your
secret key in x-api-key.
Mint returns the payment in data. Persist data.id alongside your order. If
you use hosted payments, redirect the buyer to data.payment_url.
The full request and response fields are available in the API Reference.
For customer integrations, use the production Mint API base URL and a test checkout when validating the flow.
Practical guidance
- Validate amount and currency before calling Mint.
- Keep your secret key in server-side environment variables only.
- Attach your own order and customer references at payment creation time.
- Persist the Mint payment ID in your own system for reconciliation.
- Make your own order-creation flow idempotent so a browser retry does not create two orders.
- Do not mark an order paid from the creation response or a browser redirect;
use a verified
payment.paidwebhook instead.