Buy data programmatically from your own app, bot, or reseller platform. Grab your keys from Settings → API Keys in your dashboard.
Every request is authenticated with a header carrying your sandbox or live secret key:
Authorization: Token <your_secret_key>
POST /api/data
Required: network, mobile_number, plan. Optional: request-id, Ported_number.
Example request
curl -X POST "https://usefooma.site/api/data" \
-H "Authorization: Token sk_test_4558418757c99db6f8afe58e6ad2856dc2dfeb53" \
-H "Content-Type: application/json" \
-d '{
"network": 1,
"mobile_number": "08012345678",
"plan": 101,
"request-id": "order_123"
}'
Example response
{
"status": "success",
"message": "Data Purchase Successful.",
"response": "MTN 1GB SME (30 Days) sent to 08012345678",
"request-id": "order_123",
"reference": "USF_1_64f...",
"service": "data",
"amount": "300.00",
"old_balance": "5000.00",
"new_balance": "4700.00"
}
GET /api/data_plan
Same key auth as above (sandbox or live). Returns the active plan catalog — use each plan's plan_id as the plan field when buying data.
curl "https://usefooma.site/api/data_plan" \ -H "Authorization: Token sk_test_4558418757c99db6f8afe58e6ad2856dc2dfeb53"
| Status | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 402 | Insufficient wallet balance |
| 404 | That plan isn't available |
| 422 | Missing or invalid fields |
| 429 | Too many requests — slow down |