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

# Environments

> Understand the difference between sandbox and production environments.

YuvexPay provides two environments behind the same API URL. The environment is
chosen by the API key you send — no separate hostname, no code fork.

## Sandbox vs. production

| Feature        | Sandbox                                                                                        | Production                 |
| -------------- | ---------------------------------------------------------------------------------------------- | -------------------------- |
| API URL        | `https://api.yuvexpay.com`                                                                     | `https://api.yuvexpay.com` |
| API key prefix | `ypk_test_`                                                                                    | `ypk_live_`                |
| Real money     | No                                                                                             | Yes                        |
| Webhooks       | Simulated, signed with the same `v1` algorithm as production                                   | Real events                |
| Rate limits    | Same as production                                                                             | Per-account limits         |
| Data isolation | Sandbox payments and withdrawals are tagged separately and never appear in production reports. |                            |

## Using sandbox

Create a sandbox API key in the dashboard under **Settings > API Keys** and
choose the **Sandbox** environment. The key will be prefixed with `ypk_test_`.

Sandbox simulates the full payment lifecycle:

* Payments are created with real-looking responses, including QR codes for PIX.
* Status transitions (`PROCESSING`, `PAID`, `EXPIRED`) are simulated.
* Webhooks fire with the same shape and headers as production, signed with your sandbox webhook secret.
* No real money is moved.

See the [Sandbox guide](/guides/sandbox) for the deterministic test recipes (specific amounts that trigger specific outcomes).

<Tip>
  Use sandbox to test your entire integration flow, including webhook handling
  and error scenarios, before switching to production.
</Tip>

## Going live

When you're ready to accept real payments:

1. Create a **production** API key in the dashboard (requires completed KYB).
2. Replace your sandbox `ypk_test_...` key with the `ypk_live_...` key in your
   environment variables.
3. Verify your production webhook endpoints are configured and that your verifier accepts production signatures.
4. Start processing real transactions.

<Warning>
  Production transactions involve real money. Ensure your error handling,
  idempotency logic and webhook verification are thoroughly tested in sandbox
  before going live.
</Warning>
