Skip to main content

Zesco Payment

The Zesco Payment feature allows users to purchase Zesco electricity tokens conviently and seamlessly. The process is designed to be simple and user-friendly, while also being fast and reliable. Clients submit a request to the API and receive a confirmation sms upon successful purchase. Users are able to generate reports and statistics which ensures to track transactional activity.

NB: Clients can purchase unit for amounts not less than ZMW10.00

Zesco Request Parameters

To initialize the transaction, you need to pass the following data; Zesco meter number, amount and narration. The table below lists the full parameters for initializing a payment request.

ParameterTypeRequired?Description
secret_keystringyesThe secret key of your Lipila account
amountdoubleyesThe value of the airtime being purchased
accountNumberstringyesZesco meter number
externalIdstringnoThe external ID of the payment (optional)
narrationstringnoBrief transaction description
phoneNumberintyesClient phone number to receive confirmation

Below is a sample snapshot of the Zesco payment request and the request Url.

curl -X 'POST' \
'https://lipila-uat.hobbiton.app/transactions/bills/zesco' \
-H 'accept: application/json' \
-H 'Authorization: Bearer LIVE_SECRET_KEY' \
-H 'Content-Type: application/json' \
-d '{
"externalId": "string",
"narration": "string",
"amount": 0.1,
"phoneNumber": "0969079237",
"accountNumber": "string"
}'

Make sure to replace YOUR_SECRET_KEY with your Lipila secret key.

Zesco Payment Response

The Lipila API returns a JSON response with the following fields:

FieldTypeDescription
statusstringThe status of the transaction
messagestringThe message of the transaction
transactionIdstringThe transaction ID of the transaction
externalIdstringThe external ID of the transaction
amountdoubleValue of the Purchased Zesco Units
unitsdoubleNumber of Zesco units purchased
tokenstringPurchased Zesco token

Response Status Codes

CodeDescription
201Purchase Successful
400Invalid / Bad Request- Check to verify that the required data is being sent in the right formats
401UnAuthorized- Check to verify that you are sending the correct API key.
500Internal Server Error- Contact Support

Below is an example of a Transaction sent for processing response:

{
"status": "Pending",
"message": "Transaction sent for processing",
"transactionId": "123456789",
"externalId": "32142",
"amount": 1.0,
"token" : "xxxxxxx"
}