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.
Parameter | Type | Required? | Description |
---|---|---|---|
secret_key | string | yes | The secret key of your Lipila account |
amount | double | yes | The value of the airtime being purchased |
accountNumber | string | yes | Zesco meter number |
externalId | string | no | The external ID of the payment (optional) |
narration | string | no | Brief transaction description |
phoneNumber | int | yes | Client 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:
Field | Type | Description |
---|---|---|
status | string | The status of the transaction |
message | string | The message of the transaction |
transactionId | string | The transaction ID of the transaction |
externalId | string | The external ID of the transaction |
amount | double | Value of the Purchased Zesco Units |
units | double | Number of Zesco units purchased |
token | string | Purchased Zesco token |
Response Status Codes
Code | Description |
---|---|
201 | Purchase Successful |
400 | Invalid / Bad Request- Check to verify that the required data is being sent in the right formats |
401 | UnAuthorized- Check to verify that you are sending the correct API key. |
500 | Internal 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"
}