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

# PeerPesa API: stablecoin on and off ramps for Africa

> Integrate PeerPesa to convert between stablecoins and African fiat via mobile money and bank transfers. Get started with authentication, quotes, and ramps.

PeerPesa is a stablecoin on and off-ramp for Africa. Use the API to let users exchange crypto assets on Stellar and Celo for local fiat across Kenya, Nigeria, Tanzania, South Africa, and Zambia, and vice versa. Settlements reach mobile money wallets and bank accounts.

<CardGroup cols={2}>
  <Card title="KYC Verification" icon="id-card" href="/kyc-verification">
    Verify your identity or business to unlock sandbox and production API keys.
  </Card>

  <Card title="Authentication" icon="lock" href="/authentication">
    Obtain API keys and request a Bearer token.
  </Card>

  <Card title="Supported Currencies" icon="coins" href="/supported-currencies">
    Fiat currencies, networks, and available assets.
  </Card>

  <Card title="Network Stats" icon="signal" href="/api-reference/network-stats">
    Check network health, fees, and confirmation times.
  </Card>

  <Card title="Rates" icon="chart-line" href="/api-reference/rates">
    Fetch indicative conversion rates for any pair.
  </Card>

  <Card title="Quotes" icon="file-invoice-dollar" href="/api-reference/quotes">
    Lock a rate and fee for 30 minutes.
  </Card>

  <Card title="Onramp" icon="arrow-right-to-bracket" href="/api-reference/onramp">
    Convert fiat to crypto and send to a wallet.
  </Card>

  <Card title="Offramp" icon="arrow-right-from-bracket" href="/api-reference/offramp">
    Convert crypto to fiat and pay a beneficiary.
  </Card>

  <Card title="Orders" icon="list" href="/api-reference/orders">
    List orders and retrieve order details with transaction legs.
  </Card>

  <Card title="Beneficiaries" icon="users" href="/api-reference/beneficiaries">
    Manage fiat payout recipients for offramps.
  </Card>
</CardGroup>

## How a ramp works

<Steps>
  <Step title="Check currencies and rates">
    Use [GET /currencies](/api-reference/coins) to see supported pairs and methods. Use [GET /rates](/api-reference/rates) for an indicative price.
  </Step>

  <Step title="Lock a quote">
    Call [POST /quotes](/api-reference/quotes) with the amount, direction, and method to lock the rate and fee for 30 minutes.
  </Step>

  <Step title="Confirm the quote">
    Call [POST /quotes/\{id}/confirm](/api-reference/quotes) with the receiving wallet for an [onramp](/api-reference/onramp), or a saved beneficiary for an [offramp](/api-reference/offramp).
  </Step>

  <Step title="Track the order">
    Use [GET /orders/\{order\_id}](/api-reference/order-details) to follow status from payment/deposit through completion.
  </Step>
</Steps>

## Base URLs

Use the sandbox environment for integration and testing. Use production for live transactions.

| Environment | Base URL |
| - | - |
| Sandbox | `https://sandbox-api.peerpesa.co/v1` |
| Production | `https://api.peerpesa.co/v1` |

All requests and responses use JSON with `snake_case` field names. Timestamps are ISO 8601 UTC strings. Money amounts are returned as decimal strings (for example, `"100.00"`) to preserve precision.

## Errors

PeerPesa returns structured errors in this shape. See [Error Codes](/errors) for the full list.

```json theme={null}
{
  "error": {
    "code": "quote_expired",
    "message": "..."
  }
}
```

Common error codes:

| Code | Status | Meaning and what to do |
| - | - | - |
| `invalid_request` | 400 | The request body or query is malformed. Check field types and required parameters. |
| `unauthorized` | 401 | Token is missing or expired. Re-authenticate with [POST /auth/token](/authentication). |
| `not_found` | 404 | The requested resource ID does not exist. Verify the ID and environment. |
| `quote_expired` | 422 | The quote passed to an onramp or offramp has expired. Create a new quote. |
| `unsupported_pair` | 422 | The network, asset, fiat, or method combination is not supported. Check [GET /currencies](/api-reference/coins). |
| `rate_limited` | 429 | Slow down and retry with exponential backoff. |
| `internal_error` | 500 | Retry the request. Contact support if it persists. |


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