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

# Sandbox

> Use the sandbox environment to integrate Switch APIs safely. Transactions are simulated and carry no real-world value.

### Sandbox API key

1. **Request access** — Book a call or reach out through [onswitch.xyz](https://onswitch.xyz/) to get onboarded.
2. **Open the dashboard** — After approval, sign in to the [Switch dashboard](https://app.onswitch.xyz/).
3. **Create a sandbox key** — In the developer section, create or copy your **sandbox** service key (distinct from your live key).

<Warning>
  Keep your sandbox service key secure and never commit it to version control. Use environment variables to store keys in your applications.
</Warning>

### Sandbox base URL

Sandbox and live requests use the same API host. Send sandbox traffic with your **sandbox** service key:

```
https://api.onswitch.xyz
```

See [Authentication](/authentication) for how to send the key.

**Example request:**

```bash theme={"dark"}
curl "https://api.onswitch.xyz/asset" \
  -H "x-service-key: $YOUR_SANDBOX_SERVICE_KEY" \
  -H "Accept: application/json"
```

## Sandbox vs production

The sandbox environment simulates production behavior while keeping risk low:

| Feature                   | Sandbox                        | Production                   |
| :------------------------ | :----------------------------- | :--------------------------- |
| **API base URL**          | `https://api.onswitch.xyz`     | `https://api.onswitch.xyz`   |
| **Business verification** | Auto-approved after onboarding | Real-world compliance review |
| **Blockchain**            | Mainnet (Simulated)            | Mainnet                      |

### Automated onboarding

In sandbox, onboarding is streamlined for testing:

* **Typically auto-approved** — Submissions are often approved within minutes.
* **Compliance checks still apply** — Some checks (for example PEP screening) may still block approval in sandbox.
* **Test data** — Use mocked and appropriate test data for your testing or staging environment.

<Warning>
  While onboarding is typically auto-approved in sandbox, certain compliance checks may still block approval. For example, PEP (Politically Exposed Person) screening can prevent users from unlocking rails even in the test environment.
</Warning>

<Note>
  In production, business onboarding verification undergoes real compliance review.
</Note>

## Transitioning to production

When you move from sandbox to production:

1. **Use your live service key** from the dashboard.
2. **Keep the same base URL** — `https://api.onswitch.xyz`
3. **Update environment variables** so production deployments never use the sandbox key.
4. **Remove sandbox-only calls** — Drop any endpoints or flags used only for simulation or testing.
5. **Perform user compliance checks** — Collect real user compliance information and documents as required.
6. **Test thoroughly** — Start with small live transactions before scaling volume.

<Warning>
  Never use your sandbox key in production or your live key for sandbox testing. Keys are environment-specific and are not interchangeable.
</Warning>

## Need Help?

<CardGroup cols={2}>
  <Card title="Email" icon="mail" href="mailto:contact@onswitch.xyz">
    Send us a message
  </Card>

  <Card title="Call" icon="calendar" href="https://calendly.com/contact-onswitch/30min">
    Book a call with us
  </Card>
</CardGroup>
