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

# Sandbox Testing

> Recommended test flow for subscription billing integrations.

# Sandbox Testing

## In a nutshell

Use a demo or sandbox workspace to test your billing flow before accepting production payments.

## Test flow

1. Create or obtain a tenant API key.
2. Create a plan.
3. Create a customer.
4. Initialize checkout for the plan and customer.
5. Complete checkout using test payment details provided for your environment.
6. Receive merchant webhook events.
7. Confirm your app grants access after `invoice.paid` or `payment_success`.
8. Confirm your app handles `invoice.payment_failed` and `subscription.paused`.

## Recommended assertions

| Step              | What to check                                            |
| ----------------- | -------------------------------------------------------- |
| Plan creation     | Plan has the expected amount, interval, and currency.    |
| Customer creation | Customer email and external reference match your system. |
| Checkout          | Checkout link is returned and redirects correctly.       |
| Payment success   | Your webhook endpoint receives a success event.          |
| Subscription      | Customer is marked subscribed in your app.               |
| Failure           | Failed payment does not grant access.                    |

## Webhook events to test

* `payment_method.attached`
* `invoice.paid`
* `invoice.payment_failed`
* `subscription.created`
* `subscription.paused`
* `payment_success`
