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

# Sandbox

> Point the SDK at a sandbox key and simulate the full collection lifecycle — deposit, confirmation, and disbursement — without moving funds.

Point the SDK at your sandbox key (`sk_test_*`). Simulate the full lifecycle
without funds by posting to the order's simulate endpoint — **each call fires
the real, signed webhooks**, exactly as production would.

```sh theme={null}
POST /sandbox/collection-orders/{order_id}/simulate
{ "event": "deposit_detected" }        # optional "received_amount" to force a mismatch
{ "event": "deposit_confirmed" }
{ "event": "disburse" }
{ "event": "wrong_chain" }             # optional "received_network"
{ "event": "expire" } | { "event": "fail" }
```

| Event               | Fires when                                    | Optional field                                           |
| ------------------- | --------------------------------------------- | -------------------------------------------------------- |
| `deposit_detected`  | A deposit has landed for the order.           | `received_amount` — force an amount mismatch.            |
| `deposit_confirmed` | The deposit is confirmed on-chain.            | —                                                        |
| `disburse`          | The order settles and disbursement completes. | —                                                        |
| `wrong_chain`       | The deposit arrived on the wrong network.     | `received_network` — the network it actually arrived on. |
| `expire`            | The order's locked quote expires unpaid.      | —                                                        |
| `fail`              | The order fails.                              | —                                                        |

<Note>
  Every simulate call fires the real signed webhook for that transition — the
  same `Pulse-Signature`-verified delivery your backend receives in
  production. Handle it exactly as you would a live event; see
  [Webhooks](/backend/webhooks).
</Note>

## The happy path

Create session → `deposit_detected` → `deposit_confirmed` → `disburse` →
receive `disbursement.completed` → credit.

```sh theme={null}
curl -X POST https://sandbox.api.pulse.shiga.io/sandbox/collection-orders/<order_id>/simulate \
  -H "Content-Type: application/json" -d '{"event":"deposit_detected"}'
# then deposit_confirmed, then disburse → your webhook handler receives disbursement.completed
```

Credit the customer only from that `disbursement.completed` webhook — see
[Webhooks](/backend/webhooks) for verification and de-duplication, and
[Create a session](/backend/create-session) for minting the session this
lifecycle runs against.
