← BRPix API documentation

Pix charges

Create, look up and cancel Pix In charges, and receive payment confirmations by webhook.

Charge lifecycle

PENDING → CONFIRMED
PENDING → EXPIRED
PENDING → CANCELLED

A new charge starts as PENDING. When the customer pays, the acquirer sends a webhook and the status becomes CONFIRMED. Unpaid charges become EXPIRED after expires_in seconds. A pending charge can be canceled before expiry if the acquirer supports cancellation.

Create a charge with curl

Default acquirer for your API credential

Under API Keys → New credential, select the default acquirer if two or more are active. If only one acquirer is active, BRPix saves it automatically. It stays the default if you activate another one later. The API key list in the dashboard shows the current default.

The first request below returns default_acquirer_id and a data list with the id and name of each active acquirer. Use the desired id in the PUT request or on a specific operation. The UUID in the example is illustrative.

acquirer_id is optional. Omit it or use "" for the credential's default acquirer; if the account has a single active acquirer, it is used automatically. To pick another one for this operation, send one active acquirer's UUID. Sending an array or placing multiple IDs in one string returns HTTP 422. With more than one active acquirer and no default, omitting it returns DEFAULT_ACQUIRER_REQUIRED.

# List acquirers and find the default
curl --cert cert.pem --key key.pem -s https://api.brpix.app/v1/credentials/liquidants \
  -H "Authorization: Bearer <access_token>"

# Change the default for this credential
curl --cert cert.pem --key key.pem -s -X PUT https://api.brpix.app/v1/credentials/default-acquirer \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{"acquirer_id":"a7fa21dd-0f37-4ef3-b19e-cb07fb9b27dc"}'

The PUT request changes which acquirer is used in future operations with an empty field. To use a different acquirer once, send its UUID directly in the charge or transfer request.

# Create a charge using the default acquirer
curl -s -X POST https://api.brpix.app/v1/pix/charges \
  --cert cert.pem --key key.pem \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <access_token>" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount": "49.90",
    "acquirer_id": "",
    "description": "Order #9872",
    "expires_in": 3600,
    "external_id": "ORD-9872"
  }'

# 201 response
{
  "id": "d1ce2019-2481-47eb-a591-f847352f7d34",
  "status": "PENDING",
  "amount": "49.90000",
  "currency": "BRL",
  "qr_code": "00020126580014br.gov.bcb.pix...",
  "expires_at": "2026-10-10T15:00:00-03:00",
  "created_at": "2026-10-10T14:00:00-03:00",
  "external_id": "ORD-9872"
}

Create a split charge with curl

# Keep 90% in the originating account and send 10% to the partner
curl -s -X POST https://api.brpix.app/v1/pix/charges \
  --cert cert.pem --key key.pem \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <access_token>" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount": "100.00",
    "acquirer_id": "",
    "description": "Sale with commission",
    "split": [
      { "recipient_org_id": "a6e64892-7c49-4f26-b0ed-a7db23ea4ac1", "percentage": "10.00000" }
    ]
  }'
The percentages in split must add up to at most 100%. The originating account keeps the remainder. Only organizations with approved KYC can receive split payments. Send the recipient organization's UUID in recipient_org_id.

Create a split charge with Node.js

Install undici and set the ACCESS_TOKEN environment variable before running this example.

import { randomUUID } from 'node:crypto'
import { readFileSync } from 'node:fs'
import { Agent, fetch } from 'undici'

const accessToken = process.env.ACCESS_TOKEN
if (!accessToken) throw new Error('Set ACCESS_TOKEN')

const dispatcher = new Agent({
  connect: {
    cert: readFileSync('cert.pem'),
    key: readFileSync('key.pem'),
  },
})

try {
  const res = await fetch('https://api.brpix.app/v1/pix/charges', {
    method: 'POST',
    dispatcher,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${accessToken}`,
      'Idempotency-Key': randomUUID(),
    },
    body: JSON.stringify({
      amount: '100.00',
      acquirer_id: '',
      description: 'Sale #1234',
      split: [
        { recipient_org_id: 'a6e64892-7c49-4f26-b0ed-a7db23ea4ac1', percentage: '15.00000' },
      ],
    }),
  })
  const charge = await res.json()
  if (!res.ok) throw new Error(charge.error.message)
  console.log(charge.qr_code) // show the QR code to the customer
} finally {
  await dispatcher.close()
}

Payment confirmation webhook

When the payment is confirmed, BRPix sends a webhook to the URL you set under API Keys → Webhooks in the dashboard. Configure the endpoint that will receive the notifications.

Webhook payload

{
  "event": "payment.received",
  "id": "d1ce2019-2481-47eb-a591-f847352f7d34",
  "amount": "49.90000",
  "end_to_end_id": "E12345678202610101400abcdef012",
  "confirmed_at": "2026-10-10T14:07:23-03:00",
  "external_id": "ORDER-123",
  "payer": {
    "name": "Example Customer",
    "document": "00000000000",
    "bank_name": null
  }
}

external_id is the order number you sent when creating the charge (null when not sent). payer contains the payer's name, document (CPF/CNPJ) and bank when provided by the liquidant; otherwise it is null (the example uses fictitious data). GET /v1/pix/charges/{id} also returns external_id, end_to_end_id, confirmed_at and payer (name, document and bank of the payer, when provided by the liquidant). To look a charge up by your order number, use GET /v1/pix/charges?external_id=ORDER-123.

Your webhook endpoint should be idempotent. BRPix may deliver the same event again if your endpoint fails to respond. Use event and id together to identify retries of this event.

Pix payer details webhook

Under API Keys → Webhooks, edit Pix received (payment.received) and enable Incluir dados do pagador (Fyhub). For new Fyhub confirmations, BRPix sends payment.payer_details in a second request to the same URL once payer details are available. Use the id to match the two events. The example uses fictional data.

{
  "event": "payment.payer_details",
  "id": "d1ce2019-2481-47eb-a591-f847352f7d34",
  "document": "00000000000",
  "name": "Example Payer",
  "bank_name": null
}

document contains the payer's full Brazilian CPF or CNPJ, verified against Fyhub and sent as a string without separators. If Fyhub returns only a masked document, document is null. Any other unavailable field is also null. Use event and id together to identify retries.

Use a public domain with HTTPS and configure a signing secret under Pix received. Verify the HMAC-SHA256 of the raw request body via the X-Webhook-Signature header in sha256=<hex> format.

Look up a charge

curl -s https://api.brpix.app/v1/pix/charges/d1ce2019-2481-47eb-a591-f847352f7d34 \
  --cert cert.pem --key key.pem \
  -H "Authorization: Bearer <access_token>"

Cancel a charge

curl -s -X DELETE https://api.brpix.app/v1/pix/charges/d1ce2019-2481-47eb-a591-f847352f7d34 \
  --cert cert.pem --key key.pem \
  -H "Authorization: Bearer <access_token>"

# 200 response
{ "cancelled": true, "id": "d1ce2019-2481-47eb-a591-f847352f7d34" }