YansDataHub API
Programmatically purchase and deliver mobile data bundles across Ghana's major networks — MTN, Telecel, and AirtelTigo — directly from your application.
All endpoints are relative to this base URL. Every response is JSON with a success boolean field.
The API uses two credentials available from your API Keys dashboard. Pass them as HTTP request headers — never in the URL.
For read-only endpoints: packages, orders, status.
X-API-Key: YDH_XXXXXXXXXXX
For sensitive operations: placing orders, wallet access.
X-API-Secret: yourSecretKey
Network is automatically detected from the phone number — you never need to specify it. All Ghana number prefixes are supported.
Networks like iShare and BigTime (which run on the AirtelTigo infrastructure) share the same AT prefixes and are handled automatically.
All errors return a JSON body with "success": false and a human-readable message.
| HTTP Code | Meaning | Common Cause |
|---|---|---|
| 200 | OK | Successful request |
| 201 | Created | Order placed successfully |
| 401 | Unauthorized | Missing, invalid, or expired API key / secret |
| 402 | Payment Required | Wallet balance too low — top up and retry |
| 403 | Forbidden | Account suspended |
| 404 | Not Found | Endpoint or order reference not found |
| 422 | Unprocessable | Validation failed — check field values |
| 500 | Server Error | Internal error — contact support |
| Name | Type | Description |
|---|---|---|
| networkoptional | string | Filter by network code: MTN, TELECEL, AT |
| Name | Type | Description |
|---|---|---|
| pageoptional | integer | Page number. Default: 1 |
| limitoptional | integer | Results per page. Default: 20 · Max: 100 |
| statusoptional | string | pending · processing · completed · failed · cancelled |
| Name | Type | Description |
|---|---|---|
| referencerequired | string | The order_number (e.g. ORD-A1B2C3-123) or transaction_reference returned when the order was placed |
1 for 1GB, 2 for 2GB, 0.5 for 500MB.
| Field | Type | Description |
|---|---|---|
| phonerequired | string | Beneficiary's Ghana number. Accepts 0241234567 or +233241234567 |
| sizerequired | number | Data volume as a plain number. No "GB" or "MB" suffix. |
| Field | Type | Description |
|---|---|---|
| ordersrequired | array | Array of order objects. Maximum 50 items per request. |
| orders[].phonerequired | string | Beneficiary's Ghana phone number |
| orders[].sizerequired | number | Data volume as a plain number (no units) |