datavendor.ng merchant API
API Documentation
REST API for data, airtime, cable TV, electricity, exam pins, recharge cards and bulk SMS. Authenticate with your token and call the live base URL below.
JSON over HTTPSToken authenticationLive pricing
Base URL
https://datavendor.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://datavendor.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://datavendor.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"
}