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

# Introduction

> ChainPal Developer API Documentation

# ChainPal Developer API

Welcome to the ChainPal Developer API documentation. ChainPal provides a RESTful API that enables businesses to accept cryptocurrency payments and receive automatic settlement in local fiat currency.

## Base URL

All API requests are made to:

```
https://api.chainpal.org/api/v1
```

## How It Works

1. **Initialize a Payment** - Create a payment session with the amount and customer details
2. **Redirect Customer** - Send your customer to the hosted checkout page
3. **Customer Pays** - Customer selects their preferred cryptocurrency and completes payment
4. **Automatic Settlement** - We convert the crypto and settle directly to your bank account
5. **Webhook Notification** - Receive real-time updates about payment status

## Core Capabilities

* **Multi-Token Support**: Accept payments in USDT and USDC
* **Multi-Network Support**: Support for Base, Celo, Polygon, and BSC networks (varies by country)
* **Automatic Conversion**: Crypto payments are automatically converted to local fiat currency
* **Direct Settlement**: Funds settle directly to your registered bank account
* **Real-time Webhooks**: Receive instant notifications when payment status changes

## Supported Countries

ChainPal currently supports merchants in:

| Country      | Currency | Settlement    |
| :----------- | :------- | :------------ |
| Nigeria      | NGN      | Bank Transfer |
| Ghana        | GHS      | Bank Transfer |
| Kenya        | KES      | Bank Transfer |
| South Africa | ZAR      | Bank Transfer |

## API Resources

* [**Authentication**](./authentication) - API key types and authentication methods
* [**Payments**](./payments) - Create and manage payment sessions
* [**Quote**](./quote) - Get real-time conversion quotes
* [**Checkout**](./checkout) - Hosted checkout page endpoints
* [**Webhooks**](./webhooks) - Event notifications and signature verification
* [**Types & Enums**](./types) - Supported tokens, networks, and status values
* [**Errors**](./errors) - Error codes and handling

## Environments

ChainPal provides two environments for development and production:

| Environment | Description                                         | Key Prefix                   |
| :---------- | :-------------------------------------------------- | :--------------------------- |
| **Test**    | For development and testing. Uses testnet networks. | `cp_pk_test_`, `cp_sk_test_` |
| **Live**    | For production. Real transactions and settlements.  | `cp_pk_live_`, `cp_sk_live_` |

## Quick Start

```bash theme={null}
# Initialize a payment
curl -X POST https://api.chainpal.org/api/v1/payments \
  -H "Authorization: Bearer cp_pk_test_your_public_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000,
    "customerEmail": "customer@example.com"
  }'
```

Response:

```json theme={null}
{
  "success": true,
  "message": "payment initialized successfully",
  "data": {
    "paymentId": "507f1f77bcf86cd799439011",
    "paymentURL": "https://pay.chainpal.org/c/abc123xyz"
  }
}
```

## Support

* 🌐 [Official Website](https://chainpal.org)
* 📧 [Developer Support](mailto:dev-support@chainpal.xyz)
* 🐦 [Twitter / X](https://x.com/chainpalhq)
