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

# Environments

> Development and Production share one URL. Your key chooses between them.

Every business on Cloudpay has two twins. The **test** twin is Development and the **live** twin is Production. Both use `https://api.cloudpay.africa/cloudpay`. The key prefix decides which twin answers:

| | Development | Production |
| - | - | - |
| Key | `sk_test_…` | `sk_live_…` |
| `X-CloudPay-Environment` | `test` | `live` |
| M-Pesa prompts | Real, sent to a phone you hold | Real |
| Per prompt | Up to KES 100 | Up to KES 250,000 |
| Per day | KES 1,000 per business by default (Cloudpay can change it) | Your limits |
| Collection rail | The one you chose ([Rails](https://docs.cloudpay.africa/guides/rails.md)), on Cloudpay's accounts | The one you chose, or your own keys |
| Payouts and settlements | Not available (`403 live_mode_required`) | Available |
| Sign-in codes (SMS) | Not sent; after you request a code, `123456` is accepted | Sent by SMS |

> [!NOTE]
>
> Development isn't a simulator. A test prompt really charges the phone that approves it. That money is kept, and it moves to your live twin when Cloudpay approves the business.

## Check which environment answered

```js theme={null}
const res = await fetch(url, { headers: { Authorization: `Bearer ${key}` } });
if (res.headers.get("X-CloudPay-Environment") !== "live") {
  throw new Error("expected a live response");
}
```

## Going live

**1. Sign up and get approved**

Create an account at the dashboard's **Create an account** link: your phone number, a code by SMS, a PIN and your business name. Cloudpay approves new businesses, usually within one working day, and lets you know by SMS. Until then only the business itself and its KYB answer; every other call returns `403 merchant_pending`.

**2. Submit KYB**

You can start while you wait for approval. In the dashboard, pick who is getting paid (that decides the documents), fill in the details as they appear on your papers and upload each document, then submit. `GET /v1/merchants/{id}/kyb` lists what is still `missing`. You can also do this through the API with `PUT /v1/merchants/{id}/kyb`, `PUT …/kyb/documents/{kind}` and `POST …/kyb/submit`.

**3. Cloudpay reviews**

Each document is accepted or rejected with a note. If anything needs changing, KYB returns to you with notes.

**4. Cloudpay approves the live merchant**

Until then, live requests and issuing an `sk_live_` key return `403 production_not_approved`. Approval comes by SMS; after it you can issue `sk_live_` keys, and your Development balance moves across.

## Ready-made test data

With an `sk_test_` key, the Sandbox endpoints create test data you can use straight away:

* `GET /sandbox/v1/tenant`: your test tenant and the magic values.
* `POST /sandbox/v1/customers`: a test customer, ready to use.
* `POST /sandbox/v1/merchants`: a QR merchant.

A live key gets `403 live_mode_required` from these endpoints.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.