v1 is the compatibility API. Request paths, field names, and envelopes match the previous DataCoreGH public API so existing clients keep working. Base URL: https://datacoregh.com/api/v1. Send x-api-key on every call. Do not send Bearer tokens.
Authentication
Put the live key in x-api-key. The account must be approved. Revoked keys are rejected. Rate limit is 120 requests per minute per key (HTTP 429, type RATE_LIMITED). Prefer one bulk order over many single calls.
x-api-key: dc_live_…Content-Type: application/json| Permission | What it unlocks |
|---|---|
| orders | GET /offers (data), POST /order/:network for data, status, MTN checks |
| airtime | GET /offers (airtime rows), POST /order/:network when the offer is airtime |
| vouchers | GET /vouchers and purchase / status |
| afa | POST /afa/register and AFA status |
GET /offers and POST /order/:network accept a key with orders or airtime. The specific offer still has to match the product on the key.
Errors
v1 does not nest errors. Failures are { "success": false, "error": "…", "type": "UNAUTHORIZED" }.
| HTTP | type | When |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid x-api-key |
| 403 | FORBIDDEN | Key lacks the product, or the account is not allowed |
| 402 | INSUFFICIENT_BALANCE | Wallet cannot cover the debit |
| 409 | DUPLICATE_ORDER | Same beneficiary + package is already open |
| 429 | RATE_LIMITED | More than 120 calls in a minute or open bulk job limit reached |
| 422 | MTN_RESTRICTION | Single recipient test failed an active offer restriction |
| 400 | INVALID_NETWORK / INVALID_PACKAGE / MTN_RESTRICTION | Bad path, volume, or restricted recipient |
| 404 | NOT_FOUND | Unknown order, bulk job, AFA, or voucher purchase |
{ "success": false, "error": "Invalid or missing API key", "type": "UNAUTHORIZED"}Wallet balance
https://datacoregh.com/api/v1/balance{ "success": true, "balance": 150.5, "currency": "GHS", "timestamp": "2026-09-14T20:00:00.000Z"}Offers
Call this first. offerSlug is what you send on orders.volumes are the numeric sizes you can pass as volume (1 selects 1GB, not 10GB). Airtime offers have type: "Airtime" and still use POST /order/:network.
https://datacoregh.com/api/v1/offers{ "success": true, "offers": [ { "name": "MTN Data Bundle", "isp": "MTN", "type": "Data", "description": "Agent MTN data", "offerSlug": "mtn_data_bundle", "volumes": [1, 2, 3, 5, 10] }, { "name": "MTN Airtime", "isp": "MTN", "type": "Airtime", "offerSlug": "mtn_airtime", "volumes": [] } ], "authMethod": "api-key"}Data bundles
Place data with POST /order/:network. Network path is mtn, at / airteltigo, or telecel. type must be single or bulk. Amounts in the response are cedis.
https://datacoregh.com/api/v1/order/:networkRequired: type: "single", volume, phone. Optional: offerSlug, metadata, and optional verified webhookDestinationId or webhookUrl (overrides the account default webhook only after verification under Developers → Webhooks).
{ "type": "single", "volume": "1GB", "phone": "0241234567", "offerSlug": "mtn_data_bundle"}https://datacoregh.com/api/v1/order/:networkSend type: "bulk" and items. Up to 2000 items execute synchronously (HTTP 201) and return groupId / groupReference. Between 2001 and 5000 items enqueue a durable background job (HTTP 202 with jobId and pollUrl; max 5 open jobs per account). Invalid or restricted numbers land in skipped and are not billed.
{ "type": "bulk", "offerSlug": "mtn_data_bundle", "items": [ { "volume": 2, "recipient": "0241234567" }, { "volume": 5, "phone": "0551234567" } ]}https://datacoregh.com/api/v1/order/jobs/:id{ "success": true, "jobId": "JOB_ABC123", "status": "processing", "network": "MTN", "groupId": "GRP_1", "clientReference": "BULK-2026-01", "submitted": 2500, "created": 1200, "failed": 2, "pending": 1298, "pagination": { "limit": 50, "offset": 0, "total": 2500 }, "items": [ { "line": 1, "phone": "233241234567", "status": "created", "orderId": "ORD_ABC123", "orderStatus": "pending", "error": null } ]}Airtime
Airtime stays on the legacy path: the same POST /order/:network, with an airtime offerSlug from GET /offers. The key needs the airtime permission. Send amount in cedis (or volume as the amount). Response sets isAirtime: true and items use amount, not volume.
https://datacoregh.com/api/v1/order/mtn{ "type": "single", "amount": 10, "phone": "0241234567", "offerSlug": "mtn_airtime"}https://datacoregh.com/api/v1/order/mtn{ "type": "bulk", "offerSlug": "mtn_airtime", "items": [ { "amount": 5, "recipient": "0241234567" }, { "amount": 10, "phone": "0551234567" } ]}Order status
Look up by public order id or reference. You only see your own orders. Bulk accepts up to 500 identifiers. Unknown ids are listed in missing.
https://datacoregh.com/api/v1/order/status/:identifier{ "success": true, "order": { "orderId": "ORD_ABC123", "reference": "ORD_ABC123", "status": "processed", "recipient": "233241234567", "volume": 1, "timestamp": "2026-09-14T20:05:00.000Z" }}https://datacoregh.com/api/v1/order/status/bulk{ "identifiers": ["ORD_ABC123", "ORD_ABC124", "ORD_MISSING"]}MTN restriction & recipient check
Inspect effective offer restrictions or test recipients without placing an order or debiting your wallet. Pass the same offerSlug you will use on POST /order/mtn. Single-recipient checks return HTTP 200 when eligible (or unrestricted) and HTTP 422 when blocked by an active restriction. Bulk checks deduplicate canonical MSISDNs and accept up to 100 numbers per call.
| Method | Path | Body / Query |
|---|---|---|
| GET | /restrictions | ?offerSlug=… or ?offerId=… (non-sensitive summary) |
| POST | /restrictions/test-recipient | phone or recipient + optional offerSlug |
| POST | /orders/validate-recipient | Alias of /restrictions/test-recipient |
| POST | /orders/validate-recipients | recipients or phones (array, max 100) |
| POST | /restrictions/validate-recipients | Same as validate-recipients |
https://datacoregh.com/api/v1/restrictions{ "success": true, "restrictedModeEnabled": true, "restrictedOfferCount": 1, "activeOfferCount": 2, "prevalidationAvailable": true, "offers": [ { "offerSlug": "mtn_data_bundle", "offerName": "MTN Data Bundle", "restrictedModeEnabled": true, "routingLogic": "whitelist_first" } ]}https://datacoregh.com/api/v1/orders/validate-recipient{ "phone": "0241234567", "network": "MTN", "offerSlug": "mtn_data_bundle"}https://datacoregh.com/api/v1/orders/validate-recipients{ "phones": ["0241234567", "0551234567"], "network": "MTN", "offerSlug": "mtn_data_bundle"}AFA registration
MTN subscriber AFA only. Ghana Card must match GHA-XXXXXXXXX-X. Date of birth is YYYY-MM-DD. Phone may be sent as phoneNumber or phone. Wallet is debited on create. Poll status; do not expect PINs.
https://datacoregh.com/api/v1/afa/register{ "name": "Kwame Asante", "phoneNumber": "0249116309", "idNumber": "GHA-202501234-5", "occupation": "Farmer", "location": "Kumasi", "region": "Ashanti", "dateOfBirth": "1990-05-15"}https://datacoregh.com/api/v1/afa/status/:identifier{ "success": true, "registrationId": "AFA_ABC123", "name": "Kwame Asante", "phoneNumber": "233249116309", "idNumber": "GHA-202501234-5", "occupation": "Farmer", "location": "Kumasi", "region": "Ashanti", "status": "registered", "registrationPrice": 15, "submittedAt": "2026-09-14T20:00:00.000Z", "processedAt": null, "timestamp": "2026-09-14T20:10:00.000Z"}https://datacoregh.com/api/v1/afa/status/bulk{ "identifiers": ["AFA_ABC123", "0249116309"]}Vouchers
List types, then purchase by voucherSlug (or typeId) and quantity / qty. v1 never returns PIN codes — poll delivery status. Use v2 if you need pins in the purchase response.
https://datacoregh.com/api/v1/vouchers{ "success": true, "voucherTypes": [ { "name": "WASSCE Results Checker", "description": "WAEC checker voucher", "voucherSlug": "wassce_results_checker", "unitPrice": 20, "available": 42 } ]}https://datacoregh.com/api/v1/vouchers/purchase{ "voucherSlug": "wassce_results_checker", "quantity": 1, "phone": "0551234567", "email": "customer@example.com", "sendViaWhatsApp": true, "webhookDestinationId": "dest-uuid"}https://datacoregh.com/api/v1/vouchers/purchase/:transactionId/retry-delivery{ "phone": "0551234567", "sendViaWhatsApp": true}https://datacoregh.com/api/v1/vouchers/purchase/:transactionId{ "success": true, "transactionId": "VCH_ABC123", "voucherType": "WASSCE Results Checker", "voucherSlug": "wassce_results_checker", "quantity": 1, "unitPrice": 20, "totalAmount": 20, "paymentStatus": "paid", "deliveryStatus": "completed", "submittedAt": "2026-09-14T20:00:00.000Z", "timestamp": "2026-09-14T20:00:00.000Z"}https://datacoregh.com/api/v1/vouchers/status/bulk{ "identifiers": ["VCH_ABC123"]}Webhooks
Set the default callback URL, verified per-order destinations, signing secret, and low-balance alert channels (Webhook, Email, WhatsApp) on the dealer desk (Developers → Webhooks). A verified webhookDestinationId or webhookUrl passed on an order overrides the default URL without duplicating deliveries. Low-balance alerts rearm automatically once the wallet recovers above the threshold.
| Header | Value |
|---|---|
| X-Webhook-Event | order.status.updated, voucher.purchased, balance.low, or webhook.test |
| X-Webhook-Signature | sha256=… HMAC of the raw JSON body |
| X-DataCore-Signature | Same digest |
| User-Agent | DataCoreGH-Webhook/2.0 |
{ "event": "order.status.updated", "type": "single", "orderId": "ORD_ABC123", "reference": "ORD_ABC123", "status": "processed", "recipient": "233241234567", "volume": 1, "timestamp": "2026-09-14T20:05:00.000Z"}{ "event": "order.status.updated", "bulkEvent": "orders.processed", "type": "bulk", "groupReference": "GRP_1", "reference": "GRP_1", "recordCount": 2, "status": "processed", "items": [ { "orderId": "ORD_1", "order_code": "ORD_1", "reference": "ORD_1", "status": "processed", "recipient": "233241234567", "msisdn": "233241234567", "volume": 1 } ], "timestamp": "2026-09-14T20:05:00.000Z"}{ "event": "balance.low", "balance": 35.5, "threshold": 50, "currency": "GHS", "message": "Your wallet balance (GHS 35.50) has dropped below your configured threshold of GHS 50.00.", "timestamp": "2026-09-14T20:05:00.000Z"}Verify HMAC-SHA256 of the raw body with your whsec_… secret. Respond 2xx quickly. Poll AFA and voucher status endpoints — those products do not reuse the data-order webhook body.
Code
const apiKey = "dc_live_…";const baseUrl = "https://datacoregh.com/api/v1"; async function placeOrder(network, body) { const res = await fetch(`${baseUrl}/order/${network}`, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": apiKey, }, body: JSON.stringify(body), }); return res.json();} await placeOrder("mtn", { type: "single", volume: "1GB", phone: "0241234567", offerSlug: "mtn_data_bundle",}); await placeOrder("mtn", { type: "bulk", offerSlug: "mtn_data_bundle", items: [ { volume: 2, recipient: "0241234567" }, { volume: 5, recipient: "0551234567" }, ],}); await placeOrder("mtn", { type: "single", amount: 10, phone: "0241234567", offerSlug: "mtn_airtime",});import requests API_KEY = "dc_live_…"BASE = "https://datacoregh.com/api/v1"HEADERS = {"x-api-key": API_KEY} def place_order(network, data): return requests.post(f"{BASE}/order/{network}", json=data, headers=HEADERS).json() place_order("mtn", { "type": "single", "volume": "1GB", "phone": "0241234567", "offerSlug": "mtn_data_bundle",}) requests.post( f"{BASE}/afa/register", json={ "name": "Kwame Asante", "phoneNumber": "0249116309", "idNumber": "GHA-202501234-5", "location": "Kumasi", "region": "Ashanti", "dateOfBirth": "1990-05-15", }, headers=HEADERS,).json()curl -s https://datacoregh.com/api/v1/balance \ -H "x-api-key: dc_live_…" curl -s https://datacoregh.com/api/v1/vouchers/purchase \ -H "x-api-key: dc_live_…" \ -H "Content-Type: application/json" \ -d '{"voucherSlug":"wassce_results_checker","quantity":1}'