On this page
POST /api/airtime.php ยท GET /api/airtime.php
Place an airtime order
Send msisdn, network, amount in rand from R2 to R999, and your reference. Network aliases include vodacom or p-vodacom, mtn or p-mtn, cellc and telkom. HTTP 201 means the recharge was queued. Save request_id and your reference.
- HTTP 400 can mean invalid input or insufficient funds. Check required_balance and available_balance when present.
- A repeat for the same recipient and amount within five minutes can return 409. Check the original outcome before attempting another purchase.
POST /api/airtime.php
curl -4 -sS -i -X POST "${SIMCLOUD_API_BASE:-https://simcloud.co.za}/api/airtime.php" \
-H "Authorization: Bearer $SIMCLOUD_API_TOKEN" \
-H 'Content-Type: application/json' \
--data '{
"msisdn": "YOUR_LOCAL_CELL",
"network": "vodacom",
"amount": 10,
"reference": "DOCS-AIRTIME-01"
}'
HTTP 201 response excerpt
{
"status": "success",
"service": "airtime",
"queue_status": "queued"
}
Query an airtime order
Set SIMCLOUD_AIRTIME_ID to the original request_id. You can alternatively query the original allocated orderno. A queued order awaits placement. Pending means the result is still outstanding. Delivered and failed are final.
GET /api/airtime.php
curl -4 -sS -i "${SIMCLOUD_API_BASE:-https://simcloud.co.za}/api/airtime.php" \
-H "Authorization: Bearer $SIMCLOUD_API_TOKEN" \
--get \
--data-urlencode "request_id=$SIMCLOUD_AIRTIME_ID"
HTTP 200 response excerpt
{
"status": "queued"
}