Appearance
Check a meter
Verifies a meter with ZESA and returns the account holder's details. Call it before a purchase so your customer can confirm the name. Nothing is charged.
POST /api/v1/electricity/check-account
Body
| Field | Type | Required | Description |
|---|---|---|---|
meter_number | string | Yes | The meter number, digits only. |
amount | number | Yes | The amount your customer wants to pay. At least 5. |
currency | string | Yes | The wallet you will pay from, for example USD. |
Example
bash
curl -X POST https://app.xash.co.zw/api/v1/electricity/check-account \
-H "Authorization: Bearer YOUR_SERVER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"meter_number":"01234567890","amount":10,"currency":"USD"}'Response 200
json
{
"success": true,
"message": "Account verified successfully.",
"data": {
"success": true,
"customer_name": "T EXAMPLE",
"customer_address": "1 EXAMPLE ROAD HARARE",
"meter_number": "01234567890",
"meter_currency": "USD",
"total_payment": "10.00",
"fee": "0.50",
"fee_label": "Xash/provider fee",
"provider_amount": "9.50"
}
}| Field | Description |
|---|---|
customer_name, customer_address | The account holder registered for the meter. Show these to your customer. |
meter_currency | The currency the meter is billed in. |
total_payment | What your customer pays: the amount you sent. |
fee, fee_label | The fee taken out of the payment, and its label for receipts. |
provider_amount | What is left to buy electricity. |
The four fee fields appear only when a fee applies to this purchase. Other fields returned by the utility may be present; ignore the ones you do not use.
Errors
| Status | When | Body |
|---|---|---|
422 | The meter could not be verified. | {"success": false, "message": "...", "data": {...}}. message gives the reason when the utility supplied one. |
422 | A field is missing or invalid. | Validation error |
This call asks the utility and can take several seconds.