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

# Environments

> Production, staging, request conventions, and simulation behavior.

Stabyl exposes separate production and staging base URLs. API keys are environment-specific.

Create staging API keys in the
[Stabyl staging app](https://app-staging.stabyl.com). Use those keys only with
the staging API base URL.

Production API access requires completed KYB and an explicit invitation from
Stabyl. Staging access alone does not authorize production use. The invitation
contains the instructions for provisioning production credentials.

| Environment | Base URL                            | Purpose                                                                   |
| ----------- | ----------------------------------- | ------------------------------------------------------------------------- |
| Production  | `https://api.stabyl.com/v1`         | Live activity for KYB-complete organizations explicitly invited by Stabyl |
| Staging     | `https://api-staging.stabyl.com/v1` | Integration testing before launch                                         |

## Request Conventions

| Header                           | Required                    | Notes                                              |
| -------------------------------- | --------------------------- | -------------------------------------------------- |
| `X-Api-Key`                      | Most endpoints              | Required except documented public endpoints        |
| `Content-Type: application/json` | JSON writes                 | Required for request bodies                        |
| `Idempotency-Key`                | Order writes                | Required for create, cancel, and replace           |
| `X-Stabyl-Timestamp`             | Withdrawal quote and submit | Unix milliseconds within 30 seconds of server time |
| `X-Stabyl-Nonce`                 | Withdrawal quote and submit | New UUIDv4 or UUIDv7 per HTTP attempt              |
| `X-Stabyl-Signature`             | Withdrawal quote and submit | Unpadded base64url Ed25519 signature               |

Use query strings for `GET` filters and JSON bodies for `POST`, `PATCH`, and `DELETE` operations that accept a body. Send all times in UTC. Treat amount fields as decimal strings.

## Simulation

Simulation endpoints are non-production utilities. They can create test deposits, test withdrawal records, test KYB states, and test product update notifications outside production. They are useful for end-to-end testing when you need deterministic activity without moving real funds.

<Warning>
  Simulation withdrawals are testing records only. Production Partner API withdrawals require an explicitly enabled key and signed quote or submit request.
</Warning>

## Environment Checklist

* Use a staging key with `https://api-staging.stabyl.com/v1`.
* Complete KYB and receive an explicit invitation from Stabyl before production onboarding.
* After invitation, use the provisioned production key only with `https://api.stabyl.com/v1`.
* Do not route simulation calls from production code.
* Keep separate storage for staging and production cursors, order IDs, transaction IDs, and saved recipients.
* Verify base URL and key environment before investigating authentication or access failures.
