Loading IA-Café
Getting your data ready

📋 Prerequisites

Before you begin, make sure you have:

  • An IA-Café account (Sign up here if you don't have one)
  • A funded wallet (for making purchases)
  • Basic knowledge of HTTP/REST APIs

📝 Step-by-Step Setup

1

Get Your API Key

Go to your Profile page and navigate to the "Developer" section. Click "Generate API Key" to create a new key.

💡
API Key Format
Your API key will look like: ak_live_abc123xyz789...
2

Fund Your Wallet

Your API uses the same wallet as your dashboard. Fund your wallet through the dashboard before making purchase requests. All transactions are deducted from your wallet balance.

3

Test Your Connection

Make a simple test request to verify your API key is working:

cURL
curl -X GET "https://iacafe.com.ng/devapi/v1/whoami" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "success": true,
  "data": {
    "user_id": 123,
    "username": "your_username",
    "email": "your@email.com",
    "wallet_balance": "5000.00"
  }
}
4

Make Your First API Call

Let's buy some airtime! Here's a complete example:

cURL - Buy Airtime
curl -X POST "https://iacafe.com.ng/devapi/v1/airtime" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_id": "unique_id_12345",
    "phone": "08012345678",
    "service_id": "mtn",
    "amount": 100
  }'
Success Response
{
  "code": "success",
  "message": "ORDER COMPLETED",
  "data": {
    "product_name": "Airtime",
    "service_name": "MTN",
    "status": "completed-api",
    "order_id": 355960,
    "phone": "08012345678",
    "amount": 100,
    "discount": "2.20",
    "amount_charged": "97.80",
    "request_id": "unique_id_12345"
  }
}
5

Set Up Webhooks (Optional but Recommended)

For the best experience, set up webhooks to receive real-time notifications when transactions complete. This is especially important for electricity tokens.

Learn About Webhooks

🔑 Understanding request_id

The request_id is a unique identifier YOU create for each transaction. It serves several important purposes:

🔒 Prevents Duplicates

If you accidentally send the same request twice, the API will reject the duplicate and return the original transaction.

🔍 Easy Tracking

Use your own IDs to track transactions in your system. Query order status anytime using your request_id.

🔗 Webhook Matching

When you receive a webhook, the request_id helps you match it to the original transaction in your database.

⚠️
Best Practice
Use a format like: yourapp_airtime_1704067200_abc123
Include: prefix + product + timestamp + random string

⏱️ Rate Limits

To ensure fair usage and system stability, the API has rate limits:

Limit Value Description
Requests per minute 60 Maximum API calls per minute per API key

Rate limit information is included in response headers:

Response Headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1704067260

👛 Wallet Balance

Check your wallet balance, view recent transactions, and get spending statistics. This endpoint is useful for monitoring your account before making purchases.

Get Balance

GET /wallet
curl -X GET "https://iacafe.com.ng/devapi/v1/wallet" \
  -H "Authorization: Bearer YOUR_API_KEY"

Query Parameters

Parameter Type Description
include_transactions boolean Set to true to include last 5 transactions
include_stats boolean Set to true to include spending statistics

Response

JSON
{
  "success": true,
  "message": "Wallet balance retrieved",
  "data": {
    "balance": 5000.00,
    "balance_formatted": "5000.00",
    "currency": "NGN",
    "currency_symbol": "₦",
    "user": {
      "name": "John Doe",
      "email": "john@example.com",
      "member_since": "2024-01-15T10:30:00Z"
    },
    "recent_transactions": [
      {
        "id": 12345,
        "type": "airtime",
        "status": "completed-api",
        "amount": "100.00",
        "amount_charged": "97.80",
        "balance_before": "5097.80",
        "balance_after": "5000.00",
        "created_at": "2024-01-20T14:30:00Z"
      }
    ],
    "stats": {
      "total_spent": "15000.00",
      "total_orders": 45,
      "spent_today": "500.00",
      "pending_orders": 2
    }
  }
}

Transaction History

Get detailed transaction history with pagination and filters:

GET /wallet/transactions
curl -X GET "https://iacafe.com.ng/devapi/v1/wallet/transactions?limit=20&page=1" \
  -H "Authorization: Bearer YOUR_API_KEY"

Wallet Summary

Get a comprehensive summary with categorized spending:

GET /wallet/summary
curl -X GET "https://iacafe.com.ng/devapi/v1/wallet/summary" \
  -H "Authorization: Bearer YOUR_API_KEY"

View Full Wallet API Docs

🎯 Next Steps