Data Bundles
Buy Single Data Bundle
Create one wallet-funded data bundle order for a beneficiary number.
Endpoint
POST /api/v1/data-bundles/buy-single
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
packageId | packages id | Yes | Selected package |
productId | products id | Yes | Parent product |
operatorId | operators id | Yes | Parent operator |
beneficiaryMsisdn | string | Yes | Recipient phone number |
paymentReference | string | No | Optional offline-first reference |
anonymousId | string | No | Present in shared schema but not typically used in API-key flows |
Behavior
- validates operator, product, and package consistency
- normalizes the beneficiary number
- checks for blocking in-flight orders on the same number
- applies role-aware pricing
- checks wallet balance for agents and super agents
- creates and submits an order through the shared internal purchase flow
Response
On success, returns result object:
{
"success": true,
"data": {
"success": true,
"orderId": "kr7...",
"shortReference": "128304",
"message": "Data bundle purchase submitted successfully",
"amountCharged": 12.5
}
}Response fields
| Field | Type | Notes |
|---|---|---|
success | boolean | Always true on success |
orderId | string | Order database ID |
shortReference | string | Short alphanumeric order reference for user-friendly sharing |
message | string | Success message |
amountCharged | number | GHS amount deducted from wallet |
Errors
Possible errors:
403- Invalid API key or insufficient permissions400- Invalid request parameters or validation failed402- Insufficient wallet balance409- Duplicate order detected or conflicting in-flight order
Sample request
curl -X POST "https://api.netconnectgh.online/api/v1/data-bundles/buy-single" \
-H "X-API-KEY: netconnect_live_your_secret_here" \
-H "Content-Type: application/json" \
-d '{
"operatorId": "k57exampleoperator",
"productId": "p22exampleproduct",
"packageId": "q34examplepackage",
"beneficiaryMsisdn": "233201234567"
}'
