Create a checkout session
Creates a short-lived, single-use checkout session. Pass the returned token to your frontend cart — it submits payments without ever seeing the API key.
Authorizations
Company API key. Send in the X-API-Key header.
Headers
Client identifier for the company in the request.
"client_abc123"
Body
Amount in cents
15000
BRL, USD "BRL"
"ORD-123"
Restrict to a specific method. Omit to allow both.
card, pix "card"
Gateway slug to attempt first. Falls back to routing rules if not set or if the gateway is not enabled for this company.
pagarme, picpay, safe2pay, pagbank, stripe, asaas, erede "pagarme"
Lifetime in seconds (60–86400). Default: 1800.
1800
Arbitrary data forwarded to your frontend.
Frontend redirect after successful payment.
"https://mystore.com/order/success"
Frontend redirect after failed or cancelled payment.
"https://mystore.com/order/failed"
Customer identification to load saved cards. Provide token, email, or document — checked in that priority order.
Response
Checkout session created
Single-use session token to pass to your frontend.
"cs_live_a1b2c3d4e5f6..."
Amount in cents — immutable once session is created.
15000
"BRL"
"ORD-123"
card, pix "card"
"pagarme"
"https://mystore.com/order/success"
"https://mystore.com/order/failed"
ISO 8601 UTC timestamp when the session expires.
"2026-06-23T14:30:00+00:00"
Active saved cards for the identified customer. Empty array when no customer was identified or no cards exist.