> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payments.bob.company/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox

> Test your integration in the sandbox environment without processing real payments.

The sandbox is an isolated environment for testing your integration without real charges. Everything works exactly like in production — including webhooks — but no transaction is actually processed.

## API keys

Each project has two API keys:

| Prefix      | Environment | Processes payments? |
| ----------- | ----------- | ------------------- |
| `sk_test_*` | Sandbox     | No                  |
| `sk_live_*` | Production  | Yes                 |

<Warning>
  Never use `sk_live_*` in frontend code, public repositories, or unprotected environment variables.
</Warning>

## Simulating payments

In the sandbox, confirm a transaction without needing a real PIX:

```bash cURL theme={"system"}
curl -X POST https://api.payments.bob.company/api/v1/sandbox/transactions/TRANSACTION_ID/pay \
  -H "Authorization: Bearer sk_test_your_key"
```

After the simulation, the webhook configured on the project is fired automatically with the `transaction.paid` event.

<Note>
  Webhooks work normally in the sandbox — ideal for testing the full flow end to end.
</Note>

## Automatic outcome by cents

In the sandbox, the charge outcome is controlled by the **last two digits** of the amount — without needing to call the simulation endpoint:

| Amount cents             | Outcome                                        |
| ------------------------ | ---------------------------------------------- |
| `.01` (e.g. `10001`)     | Expires in \~5 seconds (`transaction.expired`) |
| `.02` (e.g. `10002`)     | Stays pending until it expires naturally       |
| Any other (e.g. `10000`) | Paid in \~5 seconds (`transaction.paid`)       |

Ideal for automated tests: create three charges and validate all three webhook flows at once.

## Identifying sandbox transactions

Transactions created with `sk_test_*` stay isolated from production ones. The `isSandbox: true` field is included in the webhook payload to make identification easier.

## Next steps

<CardGroup cols={2}>
  <Card title="Simulate a payment" icon="play" href="/en/pages/pix/simulate-payment">
    Force the payment of a sandbox charge via the API.
  </Card>

  <Card title="Configure webhooks" icon="webhook" href="/en/pages/webhooks">
    Receive `transaction.paid` and `transaction.expired` at your endpoint.
  </Card>

  <Card title="Authentication" icon="key" href="/en/pages/authentication">
    Understand the `sk_test_` and `sk_live_` keys.
  </Card>

  <Card title="Go to production" icon="rocket" href="/en/pages/production">
    Run through the checklist before processing real payments.
  </Card>
</CardGroup>
