
# Environments

Myaza Trust has isolated Sandbox and Production environments. The key prefix
always identifies the environment. Risk Intelligence also uses a separate
Sandbox host, while identity verification keeps one host and selects the
environment from the key.

| Product | Sandbox | Production | Key type |
|---|---|---|---|
| Identity verification | `https://trust.myaza.app/api/kyc` | `https://trust.myaza.app/api/kyc` | `pk_test_` / `pk_live_` in client SDKs; `sk_test_` / `sk_live_` for backend-only results |
| Risk Intelligence | `https://sandbox.trust.myaza.app/api/v1` | `https://trust.myaza.app/api/v1` | `sk_test_` / `sk_live_` on your backend |

Data does not cross environments: keys, verifications, webhook endpoints, and configuration are all scoped to one environment.

## Sandbox

Use Sandbox to build and test your integration. It exercises the same public API
surface and webhook delivery as Production. Explicit Risk Intelligence
`sandboxScenario` fixtures are deterministic and non-billable. Ordinary Sandbox
requests without a scenario use configured Sandbox pricing and can be billed.
Use the Risk Intelligence SDK with `environment: 'sandbox'`; it selects the
Sandbox host for you. Remove `sandboxScenario` in Production.

## Production

Production runs real verifications against live government databases and **uses your credit balance**.

### Production access requires an approved business

Before your `pk_live_` keys can run verifications, your organisation's business profile (KYB) must be **approved** by Myaza. Until then, production verify and upload requests are rejected:

```json
{
  "error": "business_not_approved",
  "message": "Your business must be approved by Myaza before using production verification services."
}
```

Complete and submit your business profile under **Onboarding** in the dashboard, then wait for approval. Sandbox is unaffected and remains available throughout.

### Billing

Each completed production verification deducts from your organisation's credit balance at the price configured for that country and ID type. If the account has insufficient credit, the verification is recorded and marked `failed` with an insufficient-credits reason (it still fires a `verification.failed` webhook) rather than being silently dropped. Top up and set low-balance thresholds under **Billing**.

## Switching environments in the dashboard

The dashboard header has an environment switcher (Sandbox / Production). It controls which environment's data you see (including which keys you create) without changing the dashboard URL.

## Checklist for going live

1. Your business profile is **approved** for production.
2. You created the required live keys: publishable for a verification client,
   secret for backend results or Risk Intelligence.
3. You registered **production** webhook endpoints and verified signatures.
4. Your credit balance is funded and a low-balance threshold is set.
5. You swapped test keys for live keys and, for Risk Intelligence, selected the
   Production environment/host.
