HELP CENTER

Help Center

Everything that applies to every route: how to authenticate, idempotency, errors, and how to move from another provider.

Authentication and permissions

Use the 1-hour token from /oauth/token as Authorization: Bearer. Ask for a new one shortly before expiry or on a 401. The raw sk_ key as Bearer also works. The key defines what the token can do: the scope field of the request is ignored.

ScopeYour key permissionRoutes
account.readbalance:readGET /accounts/balances
transactions.readtransactions:readGET /accounts/transactions
pix.read / cob.readpix:readGET /accounts/keys, GET /pix/payments/*, GET /cob/{txid}
pix.writepix:sendPOST /pix/payments/dict
cob.writepix:writePUT /cob/{txid}, POST /cob
internal-transfer.writetransfers:writePOST /internal-transfers
internal-transfer.readtransactions:readGET /internal-transfers/{endToEndId}, GET /internal-transfers/idempotencyKey/{key}
Client certificate (mTLS): optional by default. If your bank turned the requirement on for your account, calls must present it (403 certificate_required otherwise).

Other functions on your account

Besides the routes on this page, your bank enabled these functions in the v1 API. The same token (Authorization: Bearer) works on them; the full reference for each is in the v1 documentation.

FunctionRoutesKey permission
Transfer between accounts (also in v2: /internal-transfers)POST /v1/transferstransfers:write
Payment linksPOST /v1/payment-links, GET /v1/payment-linkspix:write
Split of incoming paymentsGET/PUT /v1/split, GET /v1/split/lookup, GET /v1/split/historysplit:read, split:write
Split to a Pix keyPUT /v1/split/pixsplit:write
Payroll/v1/payroll/*payroll:read, payroll:write

Full reference: /docs (v1 API).

Idempotency

Every payment requires the x-idempotency-key header (1 to 50 letters and digits). Repeating the same key returns the SAME payment, never paying twice. If the connection drops and you do not know whether the request arrived, repeat it with the same key or call GET /pix/payments/idempotencyKey/{key}.

Errors

{
  "type": "onz-0008",
  "title": "Invalid request",
  "status": 400,
  "detail": "Saldo insuficiente",
  "instance": "/api/v2/pix/payments/dict",
  "statusCode": 400,
  "error": "insufficient_funds",
  "message": "Saldo insuficiente"
}
typetitleWhen
onz-0001Invalid credentialsInvalid clientId or clientSecret (401)
onz-0002Invalid paramsMissing or invalid field; the message says which (400)
onz-0003Invalid tokenMissing, invalid or expired token, or revoked key (401)
onz-0004Internal server errorOur failure; keep the ref (500)
onz-0005Server shutting downSystem busy: retry shortly (503)
onz-0006Invalid token roleThe key lacks the route's permission, the bank turned the function off or the mTLS certificate is missing (403)
onz-0007Invalid pix entryInvalid Pix key (400)
onz-0008Invalid requestA business rule refused it (balance, limit, recipient…), call limit or a route the bank does not have. Nothing was debited (400, 429, 501)
onz-0009Pix not foundPayment, charge or transfer not found in this account (404)
onz-0010Invalid QR codeInvalid QR code, or an amount different from the one sent (400)
onz-0011Invalid idempotency keyThe x-idempotency-key is missing or invalid (400)
onz-0012Webhook not foundWebhook not found (404)
The error body carries type (the onz-XXXX code from the table), title, status, detail and instance, as well as statusCode, error (the detailed code, such as insufficient_funds) and message. Decide by the HTTP status and the type; the error field gives the exact reason. On a 5xx error a ref also comes back: keep it when contacting support.

Migrating from another provider

  • Change the base URL to https://bank.granseuk.com/api/v2.
  • Replace clientId and clientSecret with those of your key (see Authentication).
  • POST /pix/payments/dict answers 202 with { endToEndId, eventDate, id, payment, type }. endToEndId may be null until the Pix moves on; look it up by idempotency key.
  • GET /pix/payments/{endToEndId} returns { data: {...} }. It also accepts the transactionId.
  • The id field is a stable number, but it cannot be used for lookups: use endToEndId or transactionId.
  • The error codes (type onz-XXXX) and the scope names the token returns (pix.write, cob.write, account.read…) are the same; when creating the key in the panel, permissions have their own names (pix:send, pix:write…): see the permissions table.

Not available yet

  • Creating Pix keys by API (keys are created in the panel) and refunding a received Pix.
  • Bank slips (/billets) and TED in this format.
  • Charges with due date (/cobv), recurring (/cobr) and Pix Automático.
  • Sandbox keys (sk_sbx_) cannot exchange a token; use v1 to test without real money.
Routes of this standard that do not exist yet answer 501 not_supported, with an explanation (for example, POST /accounts/keys).

Integrating with AI

This whole documentation, as plain text, is at /docs/v2/llms.txt (add ?lang=en for English). Paste it into your assistant and ask for the code.