v2 is the canonical API for new integrations. Base URL https://api.datacoregh.com/v2 (nginx maps that host to Nest /api/v2). Authenticate with x-api-key. Ledger fields stay pesewas as decimal strings (*Minor). Wallet also returns GHS cedis for display. Success is { "success": true, "data": … }. Create routes (POST /orders, bulk, airtime, AFA, vouchers, Instant Bundles) return HTTP 201; status and check POSTs return HTTP 200. Treat any 2xx as success unless you specifically branch on the status code.
Authentication
Same live keys as v1 (dc_live_… in x-api-key). Dealers and agents mint keys under Developers → API keys when staff leave API access on for the account. Scope: orders, airtime, vouchers, afa, instant_bundles. A missing product is HTTP 403, not a silent skip. Rate limit is 120 requests per minute per key. Do not send a price — the server resolves payable amount from the account hierarchy.
x-api-key: dc_live_…Content-Type: application/json| Permission | Routes |
|---|---|
| orders | GET /catalog, POST /orders, POST /orders/bulk (201 sync <=2000; 202 async 2001-5000), GET /orders/jobs/:id, POST /orders/status, GET /orders/:id, GET /restrictions, POST /restrictions/test-recipient, POST /beneficiary-check, POST /restrictions/validate |
| airtime | GET /catalog (airtime rows), POST /airtime, GET /airtime/:id |
| vouchers | GET /vouchers, POST /vouchers/purchase, GET /vouchers/purchases/:id, POST /vouchers/purchases/:id/retry-delivery |
| afa | POST /afa, GET /afa/:id |
| instant_bundles | GET /instant-bundles, POST /instant-bundles, GET /instant-bundles/:id |
Service discovery
GET https://api.datacoregh.com/v2 (no API key) returns { version: "v2", docs }. Prefer GET /services with your key: it returns only what this key may call and what the account can actually order right now (platform + house availability). Prefer that over hardcoding a product list.
https://api.datacoregh.com/v2/services{ "success": true, "data": { "accountId": "user-uuid", "keyPermissions": { "orders": true, "airtime": true, "vouchers": true, "afa": true, "instant_bundles": true }, "services": [ { "id": "orders", "label": "Data bundles", "keyGranted": true, "available": true, "productCount": 3, "place": "POST /v2/orders", "catalog": "GET /v2/catalog" } ] }}Errors
Nested envelope: { "success": false, "error": { "code": "UNAUTHORIZED", "message": "…" } }.
| HTTP | code | When |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid key |
| 403 | FORBIDDEN | Key does not include that product, or API access is off for the account |
| 400 | BAD_REQUEST | Invalid MSISDN, unknown data size, airtime posted to /orders, insufficient wallet balance, or other validation failures |
| 404 | NOT_FOUND | Unknown id, or order belongs to another account |
| 409 | CONFLICT | Idempotency reference reused with a different body, or Instant Bundle duplicate / in-progress conflict |
| 429 | RATE_LIMITED | More than 120 calls in a minute |
| 499 | CLIENT_CLOSED | Client aborted before completion (common on long bulk place) — raise timeout and chunk |
| 503 | SERVICE_UNAVAILABLE | Instant Bundles (or another service) is not configured |
Some failures include optional error.details (e.g. bulk rejected lines). There is no separate INSUFFICIENT_BALANCE code — low wallet is BAD_REQUEST with message Insufficient balance.
{ "success": false, "error": { "code": "UNAUTHORIZED", "message": "Invalid API key" }}Wallet
100 pesewas = GHS 1.00. v2 returns both so you can display cedis without converting, and still post ledger-safe pesewa strings.
| Field | Unit | Example |
|---|---|---|
| balance, available, held | GHS cedis (number) | 500 → GHS 500.00 |
| balanceMinor, availableMinor, heldMinor | Pesewas (string) | "50000" |
https://api.datacoregh.com/v2/wallet{ "success": true, "data": { "balance": 500, "available": 500, "held": 0, "balanceMinor": "50000", "availableMinor": "50000", "heldMinor": "0", "currency": "GHS" }}Catalog
Optional ?network=mtn (also at / airteltigo, telecel). Returns assigned offers and packages with payable prices. Use packages[].sizeLabel (e.g. "1GB") as the data value when placing — you do not need package UUIDs. Airtime rows have kind: "airtime". Instant Bundles use GET /instant-bundles.
https://api.datacoregh.com/v2/catalog{ "success": true, "data": { "offers": [ { "id": "offer-uuid", "slug": "mtn-data", "name": "MTN Data", "network": "MTN", "kind": "data", "offerSlug": "mtn_data", "packages": [ { "id": "pkg-uuid", "sizeLabel": "1GB", "volumeMb": 1000, "priceMinor": "450" } ] } ] }}Data orders — single
Place one recipient. Required: msisdn (or phone), data as a GB size string, and offerSlug or offerId from GET /catalog. Network is detected from the Ghana number when omitted and must match the selected offer. Response data is the order object (not an array).
https://api.datacoregh.com/v2/orders{ "msisdn": "0541234567", "data": "1GB", "offerSlug": "mtn_data", "reference": "ONE-2026-0001"}https://api.datacoregh.com/v2/orders/status{ "identifiers": ["ORD_ABC123", "ORDER-2026-0001", "UNKNOWN_REF"]}https://api.datacoregh.com/v2/orders/:identifier{ "success": true, "data": { "publicId": "ORD_ABC123", "status": "processed", "network": "MTN", "sizeLabel": "1GB", "volumeMb": 1000, "beneficiaryMsisdn": "233241234567", "priceMinor": "450", "createdAt": "2026-09-14T20:00:00.000Z", "updatedAt": "2026-09-14T20:05:00.000Z", "reference": "ONE-2026-0001", "clientReference": "ONE-2026-0001" }}Data orders — bulk & async jobs
Place multiple recipients in one call. Preferred field: items (array of { msisdn, data }). Require top-level offerSlug or offerId; a line may override with its own selector. Up to 2000 lines execute synchronously (HTTP 201). Submissions of 2001–5000 lines enqueue a durable background job (HTTP 202 with jobId and pollUrl; max 5 concurrent open jobs per account, otherwise HTTP 429). Optional reference provides idempotency, and optional verified webhookDestinationId / webhookUrl overrides your account default webhook for the group.
https://api.datacoregh.com/v2/orders/bulk{ "reference": "ORDER-2026-0001", "offerSlug": "mtn_data", "webhookDestinationId": "dest-uuid", "items": [ { "msisdn": "0541234567", "data": "1GB" }, { "msisdn": "0209876543", "data": "2GB" } ]}https://api.datacoregh.com/v2/orders/jobs/:id{ "success": true, "data": { "jobId": "JOB_ABC123", "status": "processing", "network": "MTN", "offerId": "offer-uuid", "groupPublicId": "ORDER-100001-A1B2C3D4", "clientReference": "ORDER-2026-0001", "submitted": 2500, "created": 1200, "failed": 2, "pending": 1298, "pagination": { "limit": 50, "offset": 0, "total": 2500 }, "items": [ { "line": 1, "phone": "233541234567", "packageId": "pkg-uuid", "status": "created", "orderId": "ORD_ABC123", "orderStatus": "pending", "error": null } ] }}Data order statuses
v2 exposes the same status strings stored on the order. Meaningful changes for Public API–sourced orders also emit order.status.updated webhooks (except the initial pending create).
| status | Meaning |
|---|---|
| pending | Created and wallet-debited; not yet accepted by the processor. |
| processing | Processor accepted the order for dispatch (e.g. GShare queued). Delivery is in flight. |
| retrying | Processor confirmed a pending automatic retry after a failed attempt. Not a terminal failure. |
| processed | Delivered successfully (v1 webhooks historically used delivered for this). |
| failed | Terminal failure after evidence (or exhausted retries). Does not auto-mean a wallet refund. |
| cancelled | Cancelled before completion. |
| refunded | DataCoreGH refunded the wallet debit (staff / complaints path — not a vendor wallet credit). |
Order grouping
Successful multi-line bulk checkouts are stored as an order group. Bulk API responses expose that id as data.group.publicId. The dealer Data purchases desk, staff dispatch, and delivered webhooks all key off the same group. Single POST /orders creates one order (and may still belong to a one-line group internally).
| Rule | What happens |
|---|---|
| Who is grouped | All successful lines from one POST /orders/bulk (or desk checkout). |
| Client reference | Optional reference on POST /orders and POST /orders/bulk is stored on the group and unique per account. The same body returns the original orders. A different body returns HTTP 409. |
| Skipped / rejected | Stay out of the group and out of the debit. |
| Group status | Same as every line if they match; mixed if they differ. |
| API vs desk | API-source lines emit webhooks only. Desk/cart/store lines use email/WhatsApp — never the Public API webhook. |
| Line webhook (API) | failed / cancelled / retrying notify per order. processed and processing wait on a multi-line group before the line webhook. |
| Group webhook (API) | One POST when every line is processed (or a staff bulk chunk), with event_id, orders[]/items[], and bulkEvent. |
| Airtime / AFA / vouchers | Not data groups. They have their own public ids. |
Airtime
Dedicated route. amountMajor is cedis as a string (or send amount). network is mtn, at / airteltigo, or telecel. Response money is pesewas.
https://api.datacoregh.com/v2/airtime{ "network": "mtn", "phone": "0241234567", "amountMajor": "10"}https://api.datacoregh.com/v2/airtime/:identifier{ "success": true, "data": { "publicId": "AIR_ABC123", "status": "processed", "network": "MTN", "phone": "233241234567", "amountMinor": "1000", "chargeMinor": "1000", "createdAt": "2026-09-14T20:00:00.000Z", "updatedAt": "2026-09-14T20:05:00.000Z" }}Instant Bundles
Separate from data catalog packages. List sellable products for this account (house/agent priced), then place with packageId (integer from the Instant Bundles catalog). Flexi packages also need amountMajor in cedis. Wallet debit, commission, and fulfilment use the same Instant Bundles engine as the desk.
https://api.datacoregh.com/v2/instant-bundles{ "success": true, "data": { "available": true, "flexiPayRatio": "1", "packages": [ { "id": 12, "name": "MTN 1GB Instant", "network": "MTN", "isFlexi": false, "mode": "fixed", "priceMinor": "450", "payableRatio": null, "minAmountMajor": null, "maxAmountMajor": null, "dataAmount": "1GB", "validity": "30 days" } ] }}https://api.datacoregh.com/v2/instant-bundles{ "packageId": 12, "phone": "0241234567"}https://api.datacoregh.com/v2/instant-bundles/:identifier{ "success": true, "data": { "id": "uuid", "publicId": "IB_ABC123", "packageId": 12, "providerPackageId": 12, "network": "MTN", "packageName": "MTN 1GB Instant", "isFlexi": false, "phone": "233241234567", "amountMinor": "450", "chargeMinor": "450", "costMinor": "400", "profitMinor": "50", "payableRatio": null, "vendorRef": "vendor-ref", "lastError": null, "status": "processed", "createdAt": "2026-09-14T20:00:00.000Z" }}Beneficiary & offer restrictions
Inspect effective offer restrictions via GET /restrictions or pre-check Ghana numbers via POST /restrictions/test-recipient and POST /beneficiary-check before placing data. Lookups are never billed and never create an order. Required: offerSlug or offerId from GET /catalog. POST /restrictions/validate is an identical alias of POST /beneficiary-check.
https://api.datacoregh.com/v2/restrictions{ "success": true, "data": { "restrictedModeEnabled": true, "activeOfferCount": 1, "offers": [ { "offerId": "offer-uuid", "offerSlug": "mtn_data", "offerName": "MTN Data", "restrictedModeEnabled": true, "routingLogic": "whitelist_first" } ] }}https://api.datacoregh.com/v2/restrictions/test-recipient{ "phone": "0241234567", "offerSlug": "mtn_data"}https://api.datacoregh.com/v2/beneficiary-check{ "phones": ["0241234567", "0551234567"], "offerSlug": "mtn_data"}https://api.datacoregh.com/v2/restrictions/validate{ "phones": ["0241234567"], "offerSlug": "mtn_data"}AFA registration
Ghana Card GHA-XXXXXXXXX-X, date of birth YYYY-MM-DD. Field is phone (no phoneNumber alias). Price is pesewas.
https://api.datacoregh.com/v2/afa{ "name": "Kwame Asante", "phone": "0249116309", "idNumber": "GHA-202501234-5", "occupation": "Farmer", "location": "Kumasi", "region": "Ashanti", "dateOfBirth": "1990-05-15"}https://api.datacoregh.com/v2/afa/:identifier{ "success": true, "data": { "publicId": "AFA_ABC123", "status": "registered", "phone": "233249116309", "priceMinor": "1500" }}Vouchers
List types, then purchase with typeId (the catalog id) and qty. Unlike v1, the success payload includes pins. Store them immediately.
https://api.datacoregh.com/v2/vouchers{ "success": true, "data": [ { "id": "type-uuid", "name": "WASSCE Results Checker", "slug": "wassce_results_checker", "description": "WAEC checker voucher", "priceMinor": "2000", "available": 42 } ]}https://api.datacoregh.com/v2/vouchers/purchase{ "typeId": "type-uuid", "qty": 1, "phone": "0551234567", "email": "customer@example.com", "sendViaWhatsApp": true, "webhookDestinationId": "dest-uuid"}https://api.datacoregh.com/v2/vouchers/purchases/:identifier/retry-delivery{ "phone": "0551234567", "sendViaWhatsApp": true}https://api.datacoregh.com/v2/vouchers/purchases/:identifier{ "success": true, "data": { "publicId": "VCH_ABC123", "qty": 1, "priceMinor": "2000", "status": "completed", "pins": ["1234 5678 9012"] }}Webhooks
Configure under Developers → Webhooks (URL, optional HMAC signing, optional low-balance alerts). Only Public API–sourced data orders emit order webhooks. Desk, cart, and storefront orders never appear on this channel.
Configuration. Set these under Developers → Webhooks:
| Setting | Purpose |
|---|---|
| Webhook URL | Default HTTPS endpoint that receives POSTs when no per-order destination is specified |
| Verified destinations | Pre-verified HTTPS URLs (challenge-response) usable via webhookDestinationId or webhookUrl per order/voucher; overrides default without duplicate delivery; revoking halts queued retries |
| Signing | When enabled, HMAC-SHA256 of the raw JSON body with your whsec_ secret |
| Test | Send a webhook.test event to verify connectivity |
| Low balance | Optional balance.low alerts across selected channels (Webhook, Email, WhatsApp) with cooldown and automatic rearm when balance recovers above threshold |
Event types
| event | When |
|---|---|
| order.status.updated | API data order status change (single or bulk payload) |
| voucher.purchased | Voucher purchase delivered to a verified per-request webhook destination |
| webhook.test | Manual test from Developers → Webhooks |
| balance.low | Wallet dropped below your configured threshold (rearms when recovered above threshold) |
For bulk deliveries, bulkEvent is either orders.processed (every line processed) or orders.status_updated (mixed / staff batch).
Headers
Content-Type: application/jsonUser-Agent: DataCoreGH-Webhook/2.0X-Webhook-Event: order.status.updatedX-Webhook-Timestamp: 2026-09-14T20:05:00.000ZX-Webhook-Signature: sha256=<hex> # when signing enabledX-DataCore-Signature: sha256=<hex> # same value; keep eitherVerify by computing HMAC-SHA256 over the raw request body with your whsec_ secret and comparing to the hex after sha256= (timing-safe compare).
Payloads
{ "event": "order.status.updated", "event_id": "evt_ab12cd34…", "type": "single", "orderId": "ORD_ABC123", "reference": "ORD_ABC123", "clientReference": "ONE-2026-0001", "status": "processed", "recipient": "233241234567", "volume": 1, "timestamp": "2026-09-14T20:05:00.000Z"}{ "event": "order.status.updated", "event_id": "evt_ab12cd34…", "bulkEvent": "orders.processed", "type": "bulk", "groupReference": "ORDER-100001-A1B2C3D4", "reference": "ORDER-100001-A1B2C3D4", "clientReference": "ORDER-2026-0001", "recordCount": 2, "status": "processed", "orders": [ { "orderId": "ORD_1", "order_code": "ORD_1", "reference": "ORD_1", "clientReference": "ORDER-2026-0001", "status": "processed", "recipient": "233241234567", "msisdn": "233241234567", "volume": 1 }, { "orderId": "ORD_2", "order_code": "ORD_2", "reference": "ORD_2", "clientReference": "ORDER-2026-0001", "status": "processed", "recipient": "233241234568", "msisdn": "233241234568", "volume": 2 } ], "items": [ /* same as orders — kept for older parsers */ ], "timestamp": "2026-09-14T20:05:00.000Z"}When every line of a purchase group from POST /orders/bulk is processed, groupReference equals data.group.publicId and bulkEvent is orders.processed. Staff bulk status updates use bulkEvent: orders.status_updated with groupReference equal to the batch event_id.
{ "event": "webhook.test", "event_id": "test_1726330000000", "message": "This is a test webhook from DataCoreGH.", "timestamp": "2026-09-14T20:05:00.000Z", "userId": "user-uuid"}{ "event": "balance.low", "event_id": "bal_1726330000000", "balance": 45.5, "threshold": 50, "currency": "GHS", "message": "Your wallet balance (GHS 45.50) has dropped below your configured threshold of GHS 50.00.", "timestamp": "2026-09-14T20:05:00.000Z"}Retries & idempotency
| Rule | Behaviour |
|---|---|
| Immediate retries | Up to 2 quick attempts with short backoff on network / 5xx |
| Scheduled retries | Up to 5 attempts total: 1m → 5m → 15m → 1h → 4h |
| 4xx responses | Not retried (treat as permanent reject / misconfiguration) |
| Idempotency | Same event_id + payload on every retry — store and ignore duplicates |
| Manual retry | Available from Developers → Webhooks delivery log |
Poll GET /orders/:id or POST /orders/status if you need a line status outside webhook timing.
Code
const apiKey = "dc_live_…";const baseUrl = "https://api.datacoregh.com/v2"; async function api(path, body) { const res = await fetch(`${baseUrl}${path}`, { method: body ? "POST" : "GET", headers: { "Content-Type": "application/json", "x-api-key": apiKey, }, body: body ? JSON.stringify(body) : undefined, }); return res.json();} const services = await api("/services");console.log(services.data.services.filter((s) => s.available)); // Single orderconst one = await api("/orders", { msisdn: "0241234567", data: "1GB", offerSlug: "mtn_data",});console.log(one.data.publicId, one.data.status); // Bulk ordersconst bulk = await api("/orders/bulk", { reference: "ORDER-2026-0001", offerSlug: "mtn_data", items: [ { msisdn: "0241234567", data: "1GB" }, { msisdn: "0551234567", data: "2GB" }, ],});console.log(bulk.data.reference, bulk.data.group?.publicId); const status = await api("/orders/status", { identifiers: [bulk.data.reference],});console.log(status.data); await api("/beneficiary-check", { phones: ["0241234567", "0551234567"], offerSlug: "mtn_data",});await api("/airtime", { network: "mtn", phone: "0241234567", amountMajor: "10" }); const ib = await api("/instant-bundles");if (ib.data.packages[0]) { await api("/instant-bundles", { packageId: ib.data.packages[0].id, phone: "0241234567", });} await api("/afa", { name: "Kwame Asante", phone: "0249116309", idNumber: "GHA-202501234-5", location: "Kumasi", region: "Ashanti", dateOfBirth: "1990-05-15",});await api("/vouchers/purchase", { typeId: "type-uuid", qty: 1 });import requests API_KEY = "dc_live_…"BASE = "https://api.datacoregh.com/v2"HEADERS = {"x-api-key": API_KEY} def api(path, json=None): method = requests.post if json is not None else requests.get return method(f"{BASE}{path}", json=json, headers=HEADERS).json() api("/orders", {"msisdn": "0241234567", "data": "1GB", "offerSlug": "mtn_data"})api("/orders/bulk", { "reference": "ORDER-2026-0001", "offerSlug": "mtn_data", "items": [ {"msisdn": "0241234567", "data": "1GB"}, {"msisdn": "0551234567", "data": "2GB"}, ],})api("/orders/status", {"identifiers": ["ORDER-2026-0001"]})api("/beneficiary-check", {"phones": ["0241234567", "0551234567"], "offerSlug": "mtn_data"})api("/airtime", {"network": "mtn", "phone": "0241234567", "amountMajor": "10"})curl -s "https://api.datacoregh.com/v2/services" -H "x-api-key: dc_live_…"curl -s "https://api.datacoregh.com/v2/wallet" -H "x-api-key: dc_live_…" curl -s "https://api.datacoregh.com/v2/orders" \ -H "x-api-key: dc_live_…" \ -H "Content-Type: application/json" \ -d '{"msisdn":"0241234567","data":"1GB","offerSlug":"mtn_data"}' curl -s "https://api.datacoregh.com/v2/orders/bulk" \ -H "x-api-key: dc_live_…" \ -H "Content-Type: application/json" \ -d '{"reference":"ORDER-2026-0001","offerSlug":"mtn_data","items":[{"msisdn":"0241234567","data":"1GB"},{"msisdn":"0551234567","data":"2GB"}]}' curl -s "https://api.datacoregh.com/v2/orders/status" \ -H "x-api-key: dc_live_…" \ -H "Content-Type: application/json" \ -d '{"identifiers":["ORDER-2026-0001"]}' curl -s "https://api.datacoregh.com/v2/instant-bundles" -H "x-api-key: dc_live_…"Downloads on this page (Print / Save PDF, Download HTML, Download OpenAPI) are generated from the same live docs — keep them in sync when the contract changes.