# Test mode and the sandbox

The sandbox at `https://api.sandbox.staging.regoria.com` is a separate environment with its own data: its own products, customers, orders and webhook endpoints. Nothing you do there moves money or reaches a card network. `mor_test_` keys work only there.

## What is the same

- Every operation, every field and every error key behave as on live; the reference and these guides describe both.
- Webhooks are delivered, signed and retried the same way, to the endpoints you register on the sandbox.
- Sales tax is quoted and recorded as on live (against the tax provider's sandbox).
- Idempotency, pagination and rate limits apply.

## What differs

- Cards: the processor's sandbox accepts its test card numbers and declines on the amounts and cards its documentation names. Use them to trigger `charge.declined`, a `past_due` subscription or a dispute.
- Payouts: the sandbox books payouts in the ledger but no bank transfer leaves. `payout.sent` is still sent, so your reconciliation code can run.
- Disputes: opened by staff on the sandbox, never by a card network.
- Emails to buyers (receipts, portal codes) are sent to the addresses you use, so use addresses you control.

## A flow worth scripting

1. Create a product and price, open a checkout session, pay it with a test card on the hosted page.
2. Receive `order.paid`; fulfil the order with `POST /v1/orders/{order}/fulfil`.
3. Refund part of it with `POST /v1/refunds`; receive `refund.issued`.
4. Replay a delivery from the dashboard or `POST /v1/webhook-endpoints/{endpoint}/deliveries/{delivery}/replay` and check your handler ignores the duplicate (same `X-Webhook-Delivery`).

## Going live

- Create `mor_live_` keys (the same scopes) and point your server at `https://api.staging.regoria.com`.
- Register your live webhook endpoints: sandbox endpoints and secrets do not carry over.
- Live orders need your merchant account approved; until then live keys answer `403`.
