Tesouro Nacional
Quick Start
- Sign up at tesouro.gov.br and obtain API credentials
- Create a terminal in the Admin Console with the parameters below
- Start processing — the adapter is pre-built and ready to use
Overview
Brazilian payment processor with GraphQL API and OAuth2 authentication
| Provider ID | tesouro |
| Category | Bank Transfers |
| Website | tesouro.gov.br |
Supported operations: authenticate start_tx capture_tx refund_tx status
Authentication
OAuth2 Bearer token (refreshed automatically)
Payment Flow
Authentication Flow
- authenticate - Get OAuth2 token
- POST to
/oauth/token - Grant type: client_credentials
- Returns access_token with expiry
- Token cached and auto-refreshed
- POST to
Payment Flow
One-phase:
- start_tx - Create transaction
- GraphQL mutation
createTransaction - Variables: acceptor_id, amount, card
- Returns transaction ID
- GraphQL mutation
Two-phase:
- start_tx - Authorization
- GraphQL mutation with
capture=false - Status
AUTHORIZED→authorized
- GraphQL mutation with
- capture_tx - Capture
- GraphQL mutation
captureTransaction - Transaction ID from authorization
- GraphQL mutation
Refund:
- refund_tx - Refund transaction
- GraphQL mutation
refundTransaction
- GraphQL mutation