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

# Sandbox

> Integrate end-to-end with synthetic data before sending a real statement.

The sandbox lets you build and test your Swippee integration against **fully
synthetic, deterministic** data — no real bank statement required. It's the
fastest way to wire up parsing, reports, and webhooks before going live.

## How it works

Sandbox is **test mode**. Use a **test key** (`sk_test_…`) — every `/v1/sandbox`
endpoint refuses live keys, so production traffic can never create synthetic
data. Sandbox calls **never consume your quota**.

<Note>
  Nothing in the sandbox touches real data. Every account holder, number,
  merchant and amount is fabricated, and a given scenario always returns the
  same result.
</Note>

## Create a synthetic report

```bash theme={null}
curl https://api.swippee.com/v1/sandbox/reports \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{ "scenario": "salaried" }'
```

Returns a complete `StatementReport` (HTTP `201`) — identical in shape to a real
parse — and **persists** it, so every report sub-endpoint works against the
returned `report_id` immediately:

```bash theme={null}
curl https://api.swippee.com/v1/reports/{report_id}/income   -H "Authorization: Bearer sk_test_…"
curl https://api.swippee.com/v1/reports/{report_id}/score    -H "Authorization: Bearer sk_test_…"
```

### Report scenarios

| `scenario`   | Profile                                              |
| ------------ | ---------------------------------------------------- |
| `salaried`   | Regular salary, stable growing balance, light EMI.   |
| `thin_file`  | Very little history, no salary signal.               |
| `high_risk`  | Declining balance, an overdraft, heavy EMI load.     |
| `remittance` | Foreign inward remittance is the main income source. |

List them (and the error scenarios) any time:

```bash theme={null}
curl https://api.swippee.com/v1/sandbox/scenarios -H "Authorization: Bearer sk_test_…"
```

### Inject your own transactions

Append edge cases to any scenario:

```json theme={null}
{
  "scenario": "thin_file",
  "override_transactions": [
    { "date": "2026-03-25", "description": "SANDBOX EXTRA CREDIT", "amount": 5000, "direction": "credit" }
  ]
}
```

## Force an error

To test your error handling, ask for an `error_*` scenario — you get the exact
[error envelope](/concepts/errors) a real failure would return:

```bash theme={null}
curl https://api.swippee.com/v1/sandbox/reports \
  -H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
  -d '{ "scenario": "error_unsupported_bank" }'
# → 422  { "error_code": "UNSUPPORTED_BANK", "error_type": "DOCUMENT_ERROR", … }
```

Available: `error_unsupported_bank`, `error_unsupported_document`,
`error_password_required`, `error_image_not_tamper_verified`,
`error_tamper_detected`.

## Fire a webhook

Trigger a delivery to your registered [webhook](/concepts/webhooks) endpoints on
demand — no waiting for a real parse:

```bash theme={null}
curl https://api.swippee.com/v1/sandbox/reports/{report_id}/fire_webhook \
  -H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
  -d '{ "event": "report.ready" }'
```

Use `{ "event": "report.failed", "error_code": "TAMPER_DETECTED" }` to exercise
your failure path.
