Skip to main content

Quickstart Guide

Get up and running with the Afriex Business API in three simple steps.

Prerequisites

Before you begin, you’ll need:
  • An Afriex Business account (Sign up here)
  • Your API key from the dashboard
  • A tool for making HTTP requests (cURL, Postman, or your preferred HTTP client)

Step 1: Get your API key

  1. Log in to the Afriex Dashboard
  2. Navigate to Settings > API Keys
  3. Generate a new API key for your integration
  4. Copy and securely store your API key
Keep your API key secure and never expose it in client-side code or public repositories.

Step 2: Make your first API call

Create your first customer:
curl -X POST https://staging.afx-server.com/api/v1/customer \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"fullName": "John Doe",
"email": "john.doe@example.com",
"phone": "+2348192837465",
"countryCode": "NG"
}'
Use the staging environment for testing. Switch to https://prod.afx-server.com for production.
A successful response will return the created customer:
{
  "data": {
    "customerId": "69516dd0464b2213bd74cfad",
    "fullName": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+2348192837465",
    "countryCode": "NG"
  }
}

Step 3: Process your first transaction

Once you have a customer and payment method set up, you can create a transaction:
curl -X POST https://staging.afx-server.com/api/v1/transaction \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"customerId": "CUSTOMER_ID",
"destinationAmount": 5000,
"sourceCurrency": "USD",
"destinationCurrency": "NGN",
"destinationId": "PAYMENT_METHOD_ID"
}'

Next Steps

Now that you’ve made your first API calls, explore these guides:

Support

Need help? Contact us at support@afriex.com.