Documentation Index
Fetch the complete documentation index at: https://docs.afriex.com/llms.txt
Use this file to discover all available pages before exploring further.
Integration Guide
This guide covers best practices for integrating the Afriex Business API into your application.OpenAPI spec
Get the full OpenAPI spec at this endpoint for code generation, SDKs, and API tooling.
MCP server
Add the Afriex Business API to your MCP client and search the docs from Cursor, Claude Code, and other MCP-enabled tools.
Environments
The Afriex API provides two environments:| Environment | Base URL | Purpose |
|---|---|---|
| Staging | https://sandbox.api.afriex.com | Testing and development |
| Production | https://api.afriex.com | Live transactions |
Authentication
All API requests require authentication using your API key in thex-api-key header:
Idempotency
For critical operations like creating transactions, use idempotency keys to prevent duplicate processing:Error Handling
The API uses standard HTTP status codes:| Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content - Successful deletion, no body returned |
| 400 | Bad Request - Check your request payload |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Resource doesn’t exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Contact support |
Error response format
All error responses follow a consistent structure:| Field | Description |
|---|---|
code | Machine-readable error code for programmatic handling |
error | Short human-readable error category |
details.errorMessage | Specific reason for the error |
details.friendlyMessage | User-friendly message suitable for displaying to end users |
Pagination
List endpoints support pagination withpage and limit parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 0 | Page number, zero-indexed (first page = 0) |
limit | integer | 10 | Number of results per page (max 100) |
total field to calculate the number of pages: Math.ceil(total / limit).
Webhook Integration
Set up webhooks to receive real-time event notifications:- Configure your webhook URL in the Dashboard
- Verify the
x-webhook-signatureheader (RSA-SHA256, base64) using the raw request body - Use the webhook public key from Dashboard -> Developers -> Webhooks (staging and production keys are different)
- Return
200quickly after successful verification and processing
400 or 401. Afriex retries failed deliveries up to 12 times with exponential backoff (starting at 30 seconds).
Webhook Documentation
Learn more about webhook setup, security, and event types.
Rate Limiting
Be mindful of rate limits when making API calls:- Implement exponential backoff for retries
- Cache exchange rates and other static data
- Use webhooks instead of polling for status updates
