Forgedocs

Introduction

What is PIX Bacen?

The PIX Bacen API is a version of the Forge API that follows the official specification from the Central Bank of Brazil (BACEN) for the PIX instant payment system. This version was developed to serve integrators who need compatibility with the standard BACEN format.

This API is an alternative to the standard Forge API. Both offer the same functionalities but with different request and response formats.

When should you use the PIX Bacen API?

Use this API when:

  • Your system is already integrated with other PSPs that follow the BACEN specification
  • You need to maintain compatibility with multiple PIX providers
  • Your application was built following the official Central Bank documentation
  • You prefer working with the V2 webhook format (envelope {type, data})

Key differences

Available endpoints

EndpointMethodDescription
/cob/:txidPUTCreate an immediate charge (PIX QR Code)
/pix/:e2eid/devolucao/:idPUTRequest a refund for a received PIX
/dict/pixPOSTInitiate a PIX transfer (Cash-Out)
/accounts/balancesGETQuery account balance

Comparison with the standard API

OperationStandard APIPIX Bacen API
Cash-InPOST /pix/cash-inPUT /cob/:txid
Cash-OutPOST /pix/cash-outPOST /dict/pix
RefundPOST /pix/:id/refundPUT /pix/:e2eid/devolucao/:id
BalanceGET /balanceGET /accounts/balances

Integration flow

sequenceDiagram
    participant Client
    participant Forge
    participant BACEN

    Note over Client,BACEN: 1. Authentication
    Client->>Forge: POST /oauth/token
    Forge-->>Client: access_token

    Note over Client,BACEN: 2. Create Charge
    Client->>Forge: PUT /cob/\{txid\}
    Forge->>BACEN: Register charge
    Forge-->>Client: QR Code + data

    Note over Client,BACEN: 3. Payment (via banking app)
    BACEN->>Forge: Payment webhook
    Forge->>Client: Webhook V2 (type: RECEIVE)

Next steps

On this page