On this page
GET /api/electricity.php · POST /api/electricity.php
Check meter support
Set SIMCLOUD_METER_NUMBER to the meter you want to check. The API removes spaces and hyphens. Check supported: true, false or null. Null means the municipality could not confirm the meter at that time.
GET /api/electricity.php
curl -4 -sS -i "${SIMCLOUD_API_BASE:-https://simcloud.co.za}/api/electricity.php" \
-H "Authorization: Bearer $SIMCLOUD_API_TOKEN" \
--get \
--data-urlencode "meter_number=$SIMCLOUD_METER_NUMBER"
HTTP 200 response excerpt
{
"status": "success",
"supported": true
}
Place an order and calculate the fee
Send the meter_number, a whole-rand amount from R11 through R1,000, your unique client_reference and the recipient. Orders from R11 through R55 include a fixed R1 fee. Above R55 the fee is amount × 3 / 103, rounded down to whole rand and capped at R10. An R11 order buys R10 of electricity. The example disables the completion SMS with send_sms: false.
Municipalities can have their own limits. Use a new client_reference for a separate purchase.
POST /api/electricity.php
curl -4 -sS -i -X POST "${SIMCLOUD_API_BASE:-https://simcloud.co.za}/api/electricity.php" \
-H "Authorization: Bearer $SIMCLOUD_API_TOKEN" \
-H 'Content-Type: application/json' \
--data '{
"meter_number": "YOUR_METER_NUMBER",
"amount": 11,
"client_reference": "DOCS-ELECTRICITY-01",
"recipient": "YOUR_LOCAL_CELL",
"send_sms": false
}'
HTTP 201 response excerpt
{
"status": "success",
"fee": 1,
"electricity_amount": 10,
"amount": 11
}
Recover an order whose outcome is unclear
If POST returns HTTP 202 with reconciliation_pending, or the request times out before you receive the result, keep the original client_reference. Replace the example reference with that value and query the same purchase. Poll again while it is pending. A repeated identical purchase request can replay the recorded result for the same reference.
- HTTP 409 can return reference_conflict, request_in_progress or duplicate_transaction. Check the existing purchase before retrying.
- If a duplicate response includes retry_after_seconds, it gives the five-minute wait and leaves the outcome of the earlier order to be checked.
GET /api/electricity.php
curl -4 -sS -i "${SIMCLOUD_API_BASE:-https://simcloud.co.za}/api/electricity.php" \
-H "Authorization: Bearer $SIMCLOUD_API_TOKEN" \
--get \
--data-urlencode 'client_reference=DOCS-ELECTRICITY-01'
HTTP 200 response excerpt
{
"status": "pending"
}
Read order status or PINs
Set SIMCLOUD_ELECTRICITY_ID to order_id. You can also query using client_reference or the municipality’s order_reference_id. A pending response may mean usable PINs are still outstanding. On success, follow the PIN entry order returned with the voucher. Failed and cancelled are terminal results.
GET /api/electricity.php
curl -4 -sS -i "${SIMCLOUD_API_BASE:-https://simcloud.co.za}/api/electricity.php" \
-H "Authorization: Bearer $SIMCLOUD_API_TOKEN" \
--get \
--data-urlencode "order_id=$SIMCLOUD_ELECTRICITY_ID"
HTTP 200 response excerpt
{
"status": "pending"
}