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"
| 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"
}'