FlexData Developer API

Automate Your Data Sales
with FlexData API

Place orders programmatically, receive real-time delivery updates, and manage transactions securely with wallet-based billing. Built for resellers and automation.

Instant Order Processing
Orders enter the delivery queue the moment they are placed.
Real-Time Status Updates
Poll the status endpoint or receive push notifications via webhook.
Secure Wallet Billing
Debited from your wallet balance. No card required per request.
Webhook Notifications
Instant POST to your endpoint on every order status change.
Restricted Access API access is available to approved wholesale accounts only. Contact admin to request an upgrade.

Get Started

Up and Running in 3 Steps

Everything you need to place your first automated data bundle order.

1
Generate Your API Key
Request a key from the Your Access section below. Admin will approve it and you will receive an email confirmation with a one-time key reveal.
2
Fund Your Wallet
Top up your FlexData wallet. Every API order is billed against your wallet balance automatically. No separate payment step per request.
3
Send Your First Request
Call POST /order with your key, recipient phone, network, and bundle size. The system handles delivery, retries, and status updates automatically.

Authentication

API Keys

Pass your API key as a header on every request. Keys are issued to approved wholesale accounts only.

Header Authentication

X-API-Key: fdx_your_api_key_here

Body Authentication (Alternative)

{ "api_key": "fdx_your_api_key_here", ... }

Base URL

https://flexdata.shop/wp-json/flexdata/v1
Keys are SHA-256 hashed at rest. The plain-text key is shown exactly once — at generation and after regeneration. Save it immediately. Rate limit: 60 requests per minute per key.

Reference

API Endpoints

All endpoints require a valid active key. Wholesale pricing applies to all orders automatically.

POST /order

Place a data bundle order. Wallet is checked and debited immediately. Order enters the auto-retry delivery queue.

Request Body

FieldTypeDescription
phonerequiredstringRecipient number, e.g. 0244123456
product_idrequiredstringmtn · telecel · at_bigtime · at_ishare
package_sizerequiredintegerBundle in MB — e.g. 1000 for 1 GB. See GET /products.
POST https://flexdata.shop/wp-json/flexdata/v1/order
X-API-Key: fdx_your_key_here
Content-Type: application/json

{
  "phone": "0244123456",
  "product_id": "mtn",
  "package_size": 1000
}
{
  "success": true,
  "order_id": 1042,
  "status": "processing",
  "reference": "rkref_abc123",
  "phone": "0244123456",
  "bundle": "1 GB",
  "network": "MTN",
  "amount_ghs": 4.45,
  "message": "Bundle delivered successfully."
}
GET/balance

Return the current wallet balance for the authenticated user.

GET https://flexdata.shop/wp-json/flexdata/v1/balance
X-API-Key: fdx_your_key_here
{ "success": true, "balance_ghs": 250.00, "currency": "GHS" }
GET/status?order_id=XXXX

Get real-time delivery status for an order. Poll this endpoint while status is retrying.

GET https://flexdata.shop/wp-json/flexdata/v1/status?order_id=1042
X-API-Key: fdx_your_key_here

Status Values

StatusMeaning
pendingOrder created — first delivery attempt starting
retryingDelivery in progress — system is auto-retrying
processingBundle delivered successfully
on-holdHeld for manual admin processing
failedManually closed — contact support
GET/products

List all available bundles with wholesale pricing in GHS.

GET https://flexdata.shop/wp-json/flexdata/v1/products
X-API-Key: fdx_your_key_here
{
  "success": true,
  "products": [
    {
      "product_id": "mtn",
      "network": "MTN",
      "bundles": [
        { "package_size_mb": 1000, "label": "1 GB", "price_ghs": 4.45 },
        { "package_size_mb": 2000, "label": "2 GB", "price_ghs": 8.90 }
      ]
    }
  ],
  "note": "All prices reflect wholesale tier. Prices are in GHS."
}

Webhooks

Real-Time Notifications

FlexData sends a POST request to your configured URL on every order status change. Failed deliveries are retried up to 3 times (30s, then 120s).

Respond with HTTP 2xx to acknowledge. Configure your webhook URL in the Your Access section.

Webhook Payload

{
  "event": "order.status_changed",
  "order_id": 1042,
  "status": "processing",
  "old_status": "retrying",
  "phone": "0244123456",
  "bundle": "1 GB",
  "network": "mtn",
  "amount": 4.45,
  "reference": "rkref_abc123",
  "timestamp": "2025-01-15T12:30:00+00:00"
}

Errors

Error Reference

All errors return a consistent JSON structure with a human-readable message.

{ "success": false, "error": "Human-readable error message" }
HTTPCodeMeaning
401missing_key / invalid_keyAPI key is missing or invalid
402insufficient_balanceWallet balance is too low for this order
403key_pending / key_revoked / role_deniedKey not yet approved, revoked, or account is not wholesale
404bundle_unavailable / order_not_foundBundle or order does not exist
422invalid_phone / invalid_productInput validation failed
429rate_limit / duplicate_orderToo many requests or duplicate order within 60s
500wallet_unavailable / wc_unavailableInternal server error

Your Account

API Access

Manage your API key and webhook endpoint.

 API Key Management

Your credentials for the FlexData Developer API

Sign In Required Sign in to your account to manage your API key.
Join our WhatsApp Community