Developer API
Everything you need to sell data from your own site or bot.
1. Get your keys
Create an account, then open Developer and generate a key pair. You get a public key and a secret; the secret is shown only once.
2. Authenticate
Send both keys on every request, either as a bearer token or as two headers.
Authorization: Bearer PUBLIC_KEY:SECRET_KEY
# or
X-Api-Key: PUBLIC_KEY
X-Api-Secret: SECRET_KEY
3. Fetch the price list
GET https://mediagrowthscript.com/api/v1/bundles?network=mtn
Response
{
"status": true,
"message": "OK",
"data": [
{
"id": 12,
"network": "MTN",
"name": "5 GB",
"volume_mb": 5120,
"price": 24.50,
"currency": "GHS",
"in_stock": true
}
]
}
4. Place an order
POST https://mediagrowthscript.com/api/v1/order
Content-Type: application/json
{
"bundle_id": 12,
"recipient": "0241234567"
}
Response
{
"status": true,
"message": "Order received.",
"data": {
"reference": "ORD-9F3A21BC",
"status": "processing",
"recipient": "0241234567",
"bundle": "5 GB MTN",
"amount": 24.50
}
}
The wallet is charged immediately. If the provider cannot deliver, the amount is refunded automatically
and the order status becomes refunded.
5. Check a status
GET https://mediagrowthscript.com/api/v1/order/ORD-9F3A21BC
Statuses are pending, processing, completed,
failed and refunded.
Errors
| Code | Meaning |
|---|---|
| 401 | Keys missing or wrong |
| 402 | Wallet balance too low |
| 422 | Invalid bundle or phone number |
| 429 | Rate limit reached |
| 503 | API switched off or site in maintenance |