Skip to content

ZESA electricity ​

Sell prepaid electricity tokens for ZESA (ZETDC) meters.

  1. Check the meter. You get the account holder's name and address to show your customer, and the fee if one applies.
  2. Buy the token with a reference. The response carries the 20-digit token.

Rules that apply to every purchase ​

  • One purchase per meter at a time. A second request for the same meter while one is running fails with METER_BUSY. Check how the running purchase ended before buying again.
  • Duplicate protection. A purchase is refused with DUPLICATE_PURCHASE when the same meter has an unresolved purchase, or was sold the same amount successfully in the last 10 minutes.
  • Minimum amount. 5 in the purchase currency unless Xash has set another minimum.
  • The meter is checked again as part of the purchase. A meter that cannot be verified fails with RECIPIENT_INVALID and nothing is charged.

The fee on USD purchases ​

Xash can apply a fee to USD purchases at or above a threshold. When it does:

  • your customer still pays the amount you send;
  • the fee is taken out of that, and the rest buys electricity;
  • your commission is paid out of the fee.

You never calculate the fee yourself. Check the meter with the amount first. When a fee applies, the quote and the purchase receipt both show it, under different names and in different formats:

Quote (check the meter)Receipt (buy tokens)
What your customer paystotal_payment, for example "10.00"total_paid and tendered, for example "USD10.00"
The feefee, for example "0.50"fee, for example "USD0.50"
The fee's labelfee_labelfee_label
What buys electricityprovider_amount, for example "9.50"provider_amount, for example "USD9.50"

Quote amounts are plain decimal strings. Receipt amounts are strings with the currency code in front. When these fields are absent, no fee applies.

With the fee switched on, amounts may have at most two decimal places.

Buying on account ​

By agreement, Xash can set a partner account up to buy USD electricity on account instead of from a prepaid balance. This is arranged with Xash staff; it cannot be switched on through the API.

For such an account, when the request uses a server token and the currency is USD:

  • the purchase is charged at face value, with no fee and no commission;
  • the purchase is not refused for low balance, so your USD balance can go below zero. The amount below zero is what you owe Xash;
  • a deposit into the wallet settles what you owe;
  • the account cannot be deleted while it owes money;
  • a spending limit, if Xash has set one on your account, still applies: a purchase over it is refused.

Requests made with a session token, and purchases in other currencies or of other products, are prepaid as usual.