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

# Environments

> Sandbox and production modes for safe testing on Stellar testnet.

Payoes separates **sandbox** and **production** environments so you can test on Stellar testnet before accepting real funds on mainnet.

## Overview

| Setting           | Sandbox                       | Production                    |
| ----------------- | ----------------------------- | ----------------------------- |
| Stellar network   | Testnet                       | Mainnet                       |
| API key prefix    | `pk_test_`                    | `pk_live_`                    |
| Settlement wallet | Testnet address               | Mainnet address               |
| USDC issuer       | `STELLAR_TESTNET_USDC_ISSUER` | `STELLAR_MAINNET_USDC_ISSUER` |

Your organization environment is shown in the dashboard header. Sandbox mode displays a visible banner.

## How environment is determined

* **API keys** carry an environment. A `pk_test_` key always creates sandbox payments; `pk_live_` creates production payments.
* **Dashboard actions** use the organization's current environment setting.
* **Settlement wallets** are configured per environment. You need a separate wallet for sandbox and production.

## Testing on testnet

1. Create a sandbox API key
2. Fund a testnet wallet from [Stellar Laboratory Faucet](https://laboratory.stellar.org/#account-creator?network=test)
3. Create a payment and complete checkout on testnet
4. Verify `tx_hash` on [Stellar Expert (testnet)](https://stellar.expert/explorer/testnet)

<Note>
  Self-payments (paying from the same wallet configured as the settlement wallet) are allowed for testing.
</Note>

## Moving to production

Production mode accepts **real mainnet payments**. Before going live you must complete **identity verification** through Persona.

### Identity verification and production gate

1. Open **Settings → Production** in the dashboard
2. Choose **Personal** or **Business** and describe what you do (business description required for business accounts)
3. Complete the **Persona** flow (government ID + selfie/liveness)
4. Persona automatically approves or declines — no Payoes admin review
5. Configure a **production settlement wallet** with a mainnet address
6. Switch the organization to production mode

| Requirement                  | Purpose                                         |
| ---------------------------- | ----------------------------------------------- |
| Persona verification         | Automated identity check (personal or business) |
| Production settlement wallet | Destination for live customer payments          |

<Warning>
  Production payments move real assets. Complete sandbox testing and identity verification first.
</Warning>

### Additional checklist

1. Ensure the production wallet has a **USDC trustline** if accepting USDC
2. Create a `pk_live_` API key
3. Update `STELLAR_MAINNET_USDC_ISSUER` on your Payoes deployment
4. Update your integration to use production keys and mainnet checkout URLs

## Expiration

Payments expire after `expires_in_minutes` (default 60, max 10080). Expired payments receive status `expired` and trigger a `payment.expired` webhook if configured.
