Airtime Purchase
Airtime Purchase
The Airtime Purchase process is designed to be simple and user-friendly, allowing User to purchase airtime for themselves or clients for any obile network provider. 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 efficiency and reliabilty.
Airtime Purchase Request Parameters
To initialize the transaction, you need to pass information such as amount and phone number etc. The table below lists the parameters that you can pass when initializing a transaction.
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 | The destination account for the airtime |
externalId | string | no | The external ID of the payment (optional) |
narration | string | no | Brief transaction description |
billType | string | yes | network provider(e.g AirtelAirtime) |
The Table below shows the different bill types based on the network provider
Mobile Network | billType value |
---|---|
MTN | MtnAirtime |
Airtel | AirtelAirtime |
Zamtel | ZamtelAirtime |
Below is a sample snapshot of the Airtime purchase request and the request Url.
curl -X 'POST' \
'https://lipila-uat.hobbiton.app/transactions/bills/airtime' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'Content-Type: application/json' \
-d '{
"billType": "MtnAirtime",
"externalId": "string",
"narration": "string",
"amount": 1,
"accountNumber": "0961630967"
}'
Make sure to replace YOUR_SECRET_KEY with your Lipila secret key.
Airtime Purchase 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 | The amount of the transaction |
token | string | Response token from the API |
Below is an example of a response when a Transaction has been successfully sent for processing:
{
"status": "Pending",
"message": "Transaction sent for processing",
"transactionId": "123456789",
"externalId": "32142",
"amount": 1.0,
"token" : "xxxxxxx"
}