Sandbox
Integrate and test the whole flow without moving real money: create PIX charges, simulate their payment, receive webhooks and request withdrawals, including refused ones.
Base URL
https://sandbox.baanko.appSame routes, headers and payloads as production: only the base URL changes. For example, production https://baanko.app/api/v1/transactions/create becomes https://sandbox.baanko.app/api/v1/transactions/create.
The sandbox has its own database and its own credentials. Ask Baanko support for your sandbox Client ID and API Key. Production credentials do not work in the sandbox, and sandbox credentials do not work in production.
Testing Flow
- Generate an operation token:
POST /api/v1/operation-auth/token(see Authentication). - Create a PIX charge:
POST /api/v1/transactions/create. The response has the usual format, but the PIX code is not payable. - Simulate the payment:
POST /api/sandbox/charges/{id}/pay. The balance is credited (minus the sandbox fees) and the payment webhook is sent to your URL. - Check the balance:
GET /api/Balance/balance/{companyId}?currency=BRL. - Request a withdrawal:
POST /api/Withdraw/request. It is paid immediately and the withdrawal webhook is sent.
Simulate a Payment
/api/sandbox/charges/{id}/pay| Parametro | Tipo | Descricao |
|---|---|---|
id* | string | The charge id returned by /v1/transactions/create (data.id). |
X-Client-Id / X-API-Key* | header | Your sandbox credentials. Only charges of your own company can be paid. |
idThe charge id returned by /v1/transactions/create (data.id).
X-Client-Id / X-API-KeyYour sandbox credentials. Only charges of your own company can be paid.
curl -X POST "https://sandbox.baanko.app/api/sandbox/charges/sbx_a04a7323508d469f9d975f2727290ec9/pay" \ -H "X-Client-Id: <SANDBOX_CLIENT_ID>" \ -H "X-API-Key: <SANDBOX_API_KEY>"{ "transactionId": "sbx_a04a7323508d469f9d975f2727290ec9", "status": "successful"}Paying the same charge again does not credit twice: the response comes with alreadyPaid: true.
Withdrawals
| Parametro | Tipo | Descricao |
|---|---|---|
Any amount | result | Paid immediately: status Successful and withdrawal webhook with status successful. |
Amount ending in ,99 | result | Refused on purpose (e.g. R$ 10.99 = 1099 cents): status Failure, webhook with status failure and the reason in providerErrorDescription. The amount and the fee go back to the balance. |
Any amountPaid immediately: status Successful and withdrawal webhook with status successful.
Amount ending in ,99Refused on purpose (e.g. R$ 10.99 = 1099 cents): status Failure, webhook with status failure and the reason in providerErrorDescription. The amount and the fee go back to the balance.
Differences from Production
- No real money is moved and no bank or acquirer is called. PIX codes are not payable.
- Sandbox fees are for testing only and may differ from your production fees.
- Sandbox data is separate from production and may be reset.
- Webhooks, idempotency, operation tokens and error responses work exactly as in production.