Purchase data bundles programmatically. Integrate directly into your apps using your wallet balance and agent pricing.
https://kingflexygh.com/api/v1Authorization: kf_live_your_api_key_hereAll API requests must include your API key in the Authorization header — no Bearer prefix required.
Authorization: kf_live_your_api_key_here
Important: Your API key is shown only once when generated. Store it securely — losing it requires generating a new key, which permanently revokes the old one.
All responses follow a consistent JSON structure:
Success
{
"success": true,
"data": { ... },
"meta": {
"timestamp": "2026-...",
"version": "v1"
}
}Error
{
"success": false,
"error": {
"code": 400,
"message": "..."
}
}Five endpoints — all require a valid API key in the Authorization header.
/api/v1/packagesList all available data packages with pricing for your account role. Call this first to discover valid network and size combinations.
Query Parameters
networkstringoptionalFilter by network: MTN, Telecel, AT-iShare, AT-BigTime (case-sensitive)size_gbnumberoptionalFilter by exact GB size e.g. 5Response
{
"success": true,
"data": {
"packages": [
{
"id": "uuid-...",
"network": "MTN",
"size": "5GB",
"volume_gb": 5,
"price": 4.50,
"currency": "GHS"
}
],
"total": 12
}
}Code Sample
# All packages curl -X GET https://kingflexygh.com/api/v1/packages \ -H "Authorization: kf_live_your_api_key_here" # Filter by network curl -X GET "https://kingflexygh.com/api/v1/packages?network=MTN" \ -H "Authorization: kf_live_your_api_key_here" # Filter by network + size curl -X GET "https://kingflexygh.com/api/v1/packages?network=MTN&size_gb=5" \ -H "Authorization: kf_live_your_api_key_here"
/api/v1/data/purchasePurchase a single data bundle for a recipient phone number. Deducts from your wallet instantly.
Request Body
{
"network": "MTN",
"volume_gb": 5,
"recipient": "0551617309",
"reference": "order_001"
}Response
{
"success": true,
"data": {
"order_id": "uuid-...",
"reference": "order_001",
"status": "pending",
"network": "MTN",
"size": "5GB",
"recipient": "0551617309",
"price": 4.50,
"new_balance": 120.50
}
}Code Sample
curl -X POST https://kingflexygh.com/api/v1/data/purchase \
-H "Authorization: kf_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"network": "MTN",
"volume_gb": 5,
"recipient": "0551617309",
"reference": "order_001"
}'/api/v1/data/bulkPurchase up to 100 data bundles in a single atomic batch. Total cost is deducted at once — either all succeed or none.
Request Body
{
"orders": [
{
"network": "MTN",
"volume_gb": 5,
"recipient": "0551617309",
"reference": "b_001"
},
{
"network": "Telecel",
"volume_gb": 2,
"recipient": "0201234567",
"reference": "b_002"
}
]
}Response
{
"success": true,
"data": {
"orders_placed": 2,
"total_cost": 7.00,
"new_balance": 113.50,
"orders": [
{ "order_id": "...", "reference": "b_001", "status": "pending" }
]
}
}Code Sample
curl -X POST https://kingflexygh.com/api/v1/data/bulk \
-H "Authorization: kf_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{"network":"MTN","volume_gb":5,"recipient":"0551617309","reference":"b_001"},
{"network":"Telecel","volume_gb":2,"recipient":"0201234567","reference":"b_002"}
]
}'/api/v1/wallet/balanceRetrieve your current wallet balance in GHS. Use before large orders to verify you have sufficient funds.
Response
{
"success": true,
"data": {
"balance": 124.50,
"currency": "GHS"
}
}Code Sample
curl -X GET https://kingflexygh.com/api/v1/wallet/balance \ -H "Authorization: kf_live_your_api_key_here"
/api/v1/orders/{reference}Check the fulfillment status of an order using the reference code you provided when placing it.
Response
{
"success": true,
"data": {
"order_id": "uuid-...",
"reference": "order_001",
"status": "completed",
"network": "MTN",
"size": "5GB",
"recipient": "0551617309",
"price": 4.50,
"source": "api",
"created_at": "2026-..."
}
}Code Sample
curl -X GET https://kingflexygh.com/api/v1/orders/your_reference_here \ -H "Authorization: kf_live_your_api_key_here"
Send bulk and transactional SMS from your own systems — OTPs, order updates, campaigns — with per-recipient delivery tracking.
/api/v1/sms/sendSend an SMS to one or many recipients. Small sends (≤500 recipients) dispatch immediately and return per-send results; larger sends are queued and processed within a minute.
Request Body
{
"message": "Your order #123 is ready. Thank you!",
"recipients": ["0551234567", "0209876543"],
"sender": "AcmeGH",
"reference": "order-123"
}Response
{
"success": true,
"data": {
"campaignId": "uuid-...",
"status": "completed",
"recipients": 2,
"segments": 1,
"creditsCharged": 2,
"sender": "AcmeGH",
"sent": 2,
"failed": 0,
"balance": 498
}
}Code Sample
curl -X POST https://kingflexygh.com/api/v1/sms/send \
-H "Authorization: kf_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"message": "Your order #123 is ready for pickup. Thank you!",
"recipients": ["0551234567", "0209876543"],
"sender": "AcmeGH"
}'/api/v1/sms/sendersList the sender IDs this API key may send under — your approved own sender IDs plus the shared pool senders. Use these exact values for the sender field.
Response
{
"success": true,
"data": {
"mode": "business",
"defaultSender": "AcmeGH",
"senders": [
{ "sender": "AcmeGH", "type": "own", "isDefault": true },
{ "sender": "KFT SMS", "type": "pool", "isDefault": false }
]
}
}Code Sample
curl -X GET https://kingflexygh.com/api/v1/sms/senders \ -H "Authorization: kf_live_your_api_key_here"
/api/v1/sms/messages/{campaignId}Delivery status for a send. Returns the campaign summary, a delivery rollup, and per-recipient statuses (100 per page).
Query Parameters
pagenumberoptionalZero-based page of per-recipient rows (100/page)statusstringoptionalFilter rows: queued, sent, delivered, undelivered, failed, expired, rejectedResponse
{
"success": true,
"data": {
"campaign": {
"id": "uuid-...",
"sender_used": "AcmeGH",
"recipients_count": 2,
"segments": 1,
"credits_charged": 2,
"status": "completed",
"created_at": "2026-..."
},
"delivery": { "delivered": 2 },
"messages": [
{
"recipient": "233551234567",
"status": "delivered",
"status_updated_at": "2026-..."
}
],
"page": 0
}
}Code Sample
curl -X GET "https://kingflexygh.com/api/v1/sms/messages/your_campaign_id?status=delivered" \ -H "Authorization: kf_live_your_api_key_here"
/api/v1/sms/balanceYour SMS credit balance and account mode.
Response
{
"success": true,
"data": {
"credits": 498,
"totalPurchased": 600,
"totalUsed": 102,
"mode": "business",
"accountStatus": "active"
}
}Code Sample
curl -X GET https://kingflexygh.com/api/v1/sms/balance \ -H "Authorization: kf_live_your_api_key_here"
Pay ECG, Ghana Water, DSTV, GOtv, or StarTimes bills at face value on behalf of your customers — and earn a share of KiNG FLEXY GH's Hubtel commission on every payment.
Separate key required. These four endpoints only accept a Commission Services key (prefix kf_cs_live_...) — a standard key is rejected with 403. The reverse is also true: a Commission Services key is rejected with 403 on every other /api/v1/* endpoint (packages, data purchases, wallet, SMS, etc.).
Generate one from Dashboard → Developer API — it requires an active shop (approved and switched on), since your commission is paid into your shop wallet. Like the standard key, it starts pending and needs admin approval before it works.
How the money moves: the bill's face value is debited from your main wallet when you call POST /pay. Once the order reaches completed, your commission_share_percent cut of the platform's commission is credited automatically to your shop wallet — withdraw it like any other shop earning.
/api/v1/utilities/billersFull biller catalog for utility bill payments — including currently disabled billers, so you can build your UI without hardcoding which ones are live.
Response
{
"success": true,
"data": {
"billers": [
{
"key": "ecg",
"label": "ECG Prepaid & Postpaid",
"enabled": true,
"account_label": "Meter number",
"requires_phone": true,
"lookup_by": "phone",
"links_phone_to_account": true,
"has_amount_due": true
},
{
"key": "dstv",
"label": "DSTV",
"enabled": true,
"account_label": "Smartcard number",
"requires_phone": false,
"lookup_by": "account",
"links_phone_to_account": false,
"has_amount_due": true
}
],
"min_amount": 1,
"max_amount": 1000,
"currency": "GHS"
}
}Code Sample
curl -X GET https://kingflexygh.com/api/v1/utilities/billers \ -H "Authorization: kf_cs_live_your_commission_key_here"
/api/v1/utilities/lookupVerify an account before paying. Always show your customer the returned name (or, for ECG, the linked meters) and get their confirmation before calling /pay.
Query Parameters
billerstringOne of: ecg, ghana_water, dstv, gotv, startimesaccountstringMeter/smartcard/account number, max 30 chars. Required for every biller, including ecg — for ecg pass the phone number here too if you have no separate meter number, since the query actually runs on phone.phonestringoptionalCustomer phone, max 30 chars. Required for ghana_water. For ecg, this is what the lookup actually queries by — supply it, not just account.Response
{
"success": true,
"data": {
"account_name": "KWAME MENSAH",
"account_number": "7041234567",
"amount_due": 245.80,
"bouquet": null,
"meters": []
}
}Code Sample
# DSTV — query by smartcard number curl -X GET "https://kingflexygh.com/api/v1/utilities/lookup?biller=dstv&account=7041234567" \ -H "Authorization: kf_cs_live_your_commission_key_here" # ECG — query by phone (account is still required; pass the same number) curl -X GET "https://kingflexygh.com/api/v1/utilities/lookup?biller=ecg&phone=0551617309&account=0551617309" \ -H "Authorization: kf_cs_live_your_commission_key_here"
reference on /pay is a pure idempotency key, not a distinct-payment key. Reusing the same reference — even with a different biller, account, or amount — returns the details of the ORIGINAL order and never charges you again; it does not re-validate against the new values you sent. Use a unique reference for every distinct bill. Reuse the same reference ONLY to safely retry the exact same payment (e.g. after a network timeout).
/api/v1/utilities/payPay a bill at face value from your wallet. Auto-dispatches to the biller in the background — poll GET /orders/{reference} for the final status.
Request Body
{
"biller": "dstv",
"account": "7041234567",
"amount": 65.00,
"reference": "bill_dstv_7041234567_01"
}Response
{
"success": true,
"data": {
"reference": "UTIL-DSTV-3f9a2b1c4d5e6f70",
"order_id": "uuid-...",
"status": "pending",
"biller": "dstv",
"account": "7041234567",
"amount": 65.00,
"commission_share_percent": 40,
"new_balance": 435.00
}
}Code Sample
# DSTV — account-only biller
curl -X POST https://kingflexygh.com/api/v1/utilities/pay \
-H "Authorization: kf_cs_live_your_commission_key_here" \
-H "Content-Type: application/json" \
-d '{
"biller": "dstv",
"account": "7041234567",
"amount": 65.00,
"reference": "bill_dstv_7041234567_01"
}'
# ECG — account is the METER (from lookup meters[]), phone is required too
curl -X POST https://kingflexygh.com/api/v1/utilities/pay \
-H "Authorization: kf_cs_live_your_commission_key_here" \
-H "Content-Type: application/json" \
-d '{
"biller": "ecg",
"account": "3701234567",
"phone": "0551617309",
"amount": 50.00,
"reference": "bill_ecg_3701234567_01"
}'/api/v1/utilities/orders/{reference}Poll the fulfillment status of a utility bill order using the reference from the /pay response. Only returns orders that belong to your own account.
Response
{
"success": true,
"data": {
"reference": "UTIL-DSTV-3f9a2b1c4d5e6f70",
"status": "completed",
"payment_status": "paid",
"biller": "dstv",
"account_number": "7041234567",
"account_name": "KWAME MENSAH",
"amount": 65.00,
"commission_earned": 3.64,
"created_at": "2026-...",
"updated_at": "2026-..."
}
}Code Sample
curl -X GET https://kingflexygh.com/api/v1/utilities/orders/UTIL-DSTV-3f9a2b1c4d5e6f70 \ -H "Authorization: kf_cs_live_your_commission_key_here"
Rate Limits (per key)
| Endpoint | Limit |
|---|---|
GET /billers | 30 / min |
GET /lookup | 10 / min |
POST /pay | 6 / min |
GET /orders/{reference} | 30 / min |
Error Codes (this section)
| Code | When it occurs |
|---|---|
| 400 | Invalid biller/account/phone/amount/reference, or insufficient wallet balance |
| 401 | Missing or invalid API key |
| 403 | Wrong key type (commission key required here; standard key required everywhere else), key pending/revoked, or account suspended |
| 404 | Account/meter/smartcard not found (lookup), or order not found (status) |
| 409 | Duplicate order — same biller + account + amount resent within 30s without a reference |
| 429 | Rate limit exceeded — see limits above |
| 502 | Billing provider temporarily unreachable — retry shortly (lookup only) |
| 503 | Utility bills, or this specific biller, currently disabled by an admin |
| Network Value | Provider | Notes |
|---|---|---|
"MTN" | MTN Ghana | Most widely available bundles |
"Telecel" | Telecel Ghana (formerly Vodafone) | |
"AT-iShare" | AirtelTigo iShare | AirtelTigo bundle type 1 |
"AT-BigTime" | AirtelTigo BigTime | AirtelTigo bundle type 2 |
GET /packages to see exactly which networks and sizes are currently available.| Code | When it occurs |
|---|---|
| 400 | Bad request — invalid phone, volume_gb, network value, or malformed body |
| 401 | Missing or invalid API key |
| 403 | Key pending approval, revoked, suspended account, or role not allowed |
| 404 | Package or order not found for the given network/size/reference |
| 409 | Duplicate reference — an order with this reference already exists |
| 429 | Rate limit exceeded — back off and retry after a short delay |
| 500 | Internal server error — contact support if persistent |
| 503 | API feature temporarily disabled by administrator |
Complete runnable data purchase example. Select your language.
curl -X POST https://kingflexygh.com/api/v1/data/purchase \
-H "Authorization: kf_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"network": "MTN",
"volume_gb": 5,
"recipient": "0551617309",
"reference": "order_001"
}'