Skip to main content

Tesouro Nacional

Quick Start
  1. Sign up at tesouro.gov.br and obtain API credentials
  2. Create a terminal in the Admin Console with the parameters below
  3. Start processing — the adapter is pre-built and ready to use

Go to Tesouro Nacional →

Overview

Brazilian payment processor with GraphQL API and OAuth2 authentication

Provider IDtesouro
CategoryBank Transfers
Websitetesouro.gov.br

Supported operations: authenticate start_tx capture_tx refund_tx status


Authentication

OAuth2 Bearer token (refreshed automatically)


Payment Flow

Authentication Flow

  1. authenticate - Get OAuth2 token
    • POST to /oauth/token
    • Grant type: client_credentials
    • Returns access_token with expiry
    • Token cached and auto-refreshed

Payment Flow

One-phase:

  1. start_tx - Create transaction
    • GraphQL mutation createTransaction
    • Variables: acceptor_id, amount, card
    • Returns transaction ID

Two-phase:

  1. start_tx - Authorization
    • GraphQL mutation with capture=false
    • Status AUTHORIZEDauthorized
  2. capture_tx - Capture
    • GraphQL mutation captureTransaction
    • Transaction ID from authorization

Refund:

  • refund_tx - Refund transaction
    • GraphQL mutation refundTransaction

Resources