gettopup merchant API
API Documentation
Public docs show the sandbox base URL for testing. Live production endpoints unlock after your API access is approved.
JSON over HTTPSSandbox examplesApprove for live
Sandbox docs mode
Sandbox base URL
https://sandbox.gettopup.com.ngPOST
/api/data/Buy Data
POST — purchase mobile data
api:readPurchase data after fetching network and plan IDs from Get Data Plans.
Required headers
| Header | Value | Required |
|---|---|---|
| Authorization | Token YOUR_API_TOKEN | Yes |
| Content-Type | application/json | Yes (POST/PUT) |
| Accept | application/json | Recommended |
Endpoint
POST
https://sandbox.gettopup.com.ng/api/data/Parameters / payload fields
| Field | Type | Required | Description |
|---|---|---|---|
| network | integer | Yes | Network ID from GET /api/get/network/ |
| plan | integer | Yes | Plan ID from data_plans list |
| mobile_number | string | Yes | 11-digit Nigerian number |
| Ported_number | boolean | Yes | true if number is ported |
| customer_ref | string | No | Your unique reference |
Code samples
cURL
curl -X POST "https://sandbox.gettopup.com.ng/api/data/" \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"network":1,"mobile_number":"09037346247","plan":212,"Ported_number":true}'Request body (JSON)
JSON
{
"network": 1,
"mobile_number": "09037346247",
"plan": 212,
"Ported_number": true
}Response sample (200)
JSON
{
"id": 1024,
"ident": "DATA31234567890abcdef",
"network": 1,
"plan": 212,
"mobile_number": "09037346247",
"Status": "successful",
"plan_amount": "500.00",
"balance_before": "10000.00",
"balance_after": "9500.00"
}Sandbox examples only — live host and production keys appear after API access is approved.