API Documentation

Programmatically list packages, check your wallet, and place orders from your own website or app.

Authentication

Generate an API key from Dashboard → API Integration. Send it on every request as a bearer token:

Authorization: Bearer YOUR_API_KEY

Keys are shown only once. Store them securely — never embed in frontend code.

Base URL

https://your-domain.com
GET/api/public/v1/packages

List all available packages with their prices.

curl https://your-domain.com/api/public/v1/packages \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "packages": [
    {
      "id": "uuid",
      "provider": "MTN",
      "name": "1GB",
      "size_gb": 1,
      "user_price": 6.5,
      "available": true
    }
  ]
}
GET/api/public/v1/balance

Check your current wallet balance.

curl https://your-domain.com/api/public/v1/balance \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{ "balance": 125.50, "currency": "GHS", "reference": "LWH-ABC123" }
POST/api/public/v1/orders

Place a data bundle order. Debits your wallet at your price.

curl -X POST https://your-domain.com/api/public/v1/orders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "package_id": "PACKAGE_UUID",
    "recipient": "0241234567"
  }'

Response

{
  "ok": true,
  "order_id": "uuid",
  "new_balance": 119.00,
  "status": "pending"
}

recipient must be a 10-digit Ghana phone number (e.g. 0241234567).

Errors

All errors return JSON with a single error field.

401 Unauthorized   { "error": "Invalid API key" }
400 Bad Request    { "error": "Insufficient wallet balance" }
500 Server Error   { "error": "..." }