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

Sandbox
https://sandbox.baanko.app

Same 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

  1. Generate an operation token: POST /api/v1/operation-auth/token (see Authentication).
  2. Create a PIX charge: POST /api/v1/transactions/create. The response has the usual format, but the PIX code is not payable.
  3. 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.
  4. Check the balance: GET /api/Balance/balance/{companyId}?currency=BRL.
  5. Request a withdrawal: POST /api/Withdraw/request. It is paid immediately and the withdrawal webhook is sent.

Simulate a Payment

POST/api/sandbox/charges/{id}/pay
id
Obrigatoriostring

The charge id returned by /v1/transactions/create (data.id).

X-Client-Id / X-API-Key
Obrigatorioheader

Your sandbox credentials. Only charges of your own company can be paid.

cURL
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>"
Response 200
{
"transactionId": "sbx_a04a7323508d469f9d975f2727290ec9",
"status": "successful"
}

Paying the same charge again does not credit twice: the response comes with alreadyPaid: true.

Withdrawals

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.

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.