Vends an electricity token (prepaid) or marks a payment against a postpaid running balance.
Prepaid (
tshwane_prepaid,mogale_prepaid,zeerust_prepaid,ngwathe_prepaid): returns a token string the customer enters into their meter.Postpaid (
mogale_postpaid,tshwane_postpaid): returns a receipt URL proving bill offset.
Use the idempotency field to safely retry failed requests without risk of duplicate vends.
Postpaid bill payments: if you already know you're paying a postpaid municipal account, prefer the dedicated
Bills/PurchaseandBills/ConfirmCustomerendpoints — they identify the account byaccountNumberrather thanmeterNumberand drop fields that only apply to prepaid vending.
Municipality identifier. Municipalities ending in _prepaid support token vending; Municipalities ending in _postpaid supports postpaid bill payments.
- Mock serverhttps://docs.amabills.co.za/_mock/openapi/v2/Electricity/Purchase
- Testinghttps://api-test.amabills.co.za/api/v2/Electricity/Purchase
- Productionhttps://api.amabills.co.za/api/v2/Electricity/Purchase
curl -i -X POST \
https://docs.amabills.co.za/_mock/openapi/v2/Electricity/Purchase \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY_HERE' \
-d '{
"meterNumber": "04235758721",
"municipality": "zeerust_prepaid",
"amount": 400,
"method": "cash",
"idempotency": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'Purchase response.
true - action successful, result is in data. false - error occurred, details are in error and errorNo.
Human-readable error message. null when success is true.
{ "success": true, "data": { "name": "MR. A J KWINDA", "amount": 50, "meter": "81114926223", "date": "22 Mar 2026 3:24:11 PM", "timestamp": 1774193051166, "token": " City of Tshwane\n ---------------\nReceipt No.: 109707/29\n...", "tokenCount": 1, "units": 2.9, "receipt": null, "municipality": "tshwane_prepaid", "mode": 0, "details": { … }, "meterDetails": { … } } }