/sessions
Creates a payment session on the best gateway for the method and currency (or the one pinned with gateway) and returns where to send the customer.
Authorization
Bearer token: an app key from Apps (sk_app_live_… or sk_app_test_…), or the tenant key from Settings (sk_live_… or sk_test_…). The key picks the mode: a live key only sees live data, a test key only sandbox data.
Parameters
Any unique string per operation (an order id works). The same key returns the first result instead of creating another.
Request Body
application/json, required
Positive, at most 2 decimal places, e.g. "49.90".
Language of the payment page and the gateway checkout. Also takes pt, en-US and similar. Without it the app's Checkout language applies, else the customer's browser.
Where the customer comes back, with session_id and a signed pay_token.
Pins one gateway configuration; without it the router picks by method and currency.
Your own keys, returned as sent.
Found by external_ref, created when new; the contact fields are kept up to date.
Your own user id.
CPF, CNPJ or tax id.
Two letters, e.g. SP.
Two letters, e.g. BR.
Response Body
201Session created.
The configuration that handles the payment.
Send the customer here to pay.
true when the Idempotency-Key was already used.
200Same Idempotency-Key as an earlier call; the first session comes back with `duplicate: true`.
The configuration that handles the payment.
Send the customer here to pay.
true when the Idempotency-Key was already used.
401Missing or invalid secret key.
What went wrong.
422Missing Idempotency-Key, no gateway for the method and currency, an invalid amount or an invalid record.
One message per field (idempotency_key, gateway, amount, replaces, subscription or record).
502The gateway refused or failed the call.
The gateway's message.
The provider that failed.