Overview
Direct API integration gives you complete control over the payment lifecycle through server-to-server REST API calls. This approach is ideal for backend-driven systems, recurring payments, or scenarios where you manage your own checkout UI.Payment Flow
The Direct API payment flow consists of three steps:1
Create a checkout session
Every payment starts with a checkout session that groups the transaction context:The response includes a
checkout_session ID used in subsequent API calls.2
Tokenize payment data
For card payments, create a one-time token with the raw card data:For alternative payment methods (PIX, bank transfers), tokenization is not required.
3
Create the payment
4
Handle the result
The payment response contains a
status field:Authentication
All API requests require two authentication headers:
The
account_id value from the Dashboard is not an HTTP header. Place it inside the account_id field of request bodies on endpoints like POST /v1/checkout/sessions and POST /v1/payments.
Never expose your
private-secret-key in client-side code or version control. Use environment variables.Base URLs
Next Steps
Create a Payment
Detailed payment creation with method-specific examples.
Capture & Cancel
Two-step authorization flows.
Refunds
Process full and partial refunds.
Webhooks
Receive real-time payment notifications.