Skip to main content

Accept Payments

Accepting payments with Lipila is a simple and straightforward process. Our payment gateway provides a range of APIs and SDKs that make it easy to integrate with your existing website or app, and we support a variety of payment methods to make it convenient for your customers to pay.

Mobile Money Payments

Payment Parameters

To initialize the transaction, you need to pass information such as currency, amount, accountNumber, narration, etc. The key, currency, amount, accountNumber and phoneNumber parameters are the only required parameters. The table below lists the parameters that you can pass when initializing a transaction.

ParameterTypeRequired?Description
secret_keystringyesThe secret key of your Lipila account
currencystringyesThe currency code of the payment amount
amountdoubleyesThe payment amount to be charged
accountNumberstringyesThe account number of the customer
fullNamestringnoThe full name of the customer
phoneNumberstringyesThe phone number of the customer
emailstringnoThe email address of the customer (optional)
externalIdstringnoThe external ID of the payment (optional)
narrationstringnoThe payment description (optional)

Here’s how to use the Lipila API to accept a mobile money payment

curl --location --request POST 'https://lipila-uat.hobbiton.app/transactions/mobile-money' \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"currency": "ZMW",
"amount": 1.00,
"accountNumber": "260971042607",
"fullName": "Vincent Musangu",
"phoneNumber": "260971042607",
"email": "vincent@gmail.com",
"externalId": "32142",
"narration": "Payment For Bread"
}'

Make sure to replace YOUR_SECRET_KEY with your Lipila secret key.

Response For Airtel and MTN Payment Transactions

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
amountdoubleThe amount of the transaction

Successful Response Status Code

CodeDescription
201Created

Here’s an example of a Transaction sent for processing response:

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

CallBack Response for Airtel and MTN Transactions

{
"status": "Successful",
"paymentType": "MtnMoney",
"currency": "string",
"amount": 0,
"accountNumber": "string",
"customer": {
"fullName": "string",
"phoneNumber": "string",
"email": "string"
},
"ipAddress": "string",
"message": "string",
"transactionId": "string",
"externalId": "string"
}

Zamtel Response

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

FieldValue
statusSuccessful
paymentTypeZamtelKwacha
currencystring
amount0
accountNumberstring
customer
fullNamestring
phoneNumberstring
emailstring
ipAddressstring
messagestring
transactionIdstring
externalIdstring

Successful Response Status Code

CodeDescription
201Created

Here’s an example of a Transaction response for zamtel payment:

{
"status": "Successful",
"paymentType": "ZamtelKwacha",
"currency": "string",
"amount": 0,
"accountNumber": "string",
"customer": {
"fullName": "string",
"phoneNumber": "string",
"email": "string"
},
"ipAddress": "string",
"message": "string",
"transactionId": "string",
"externalId": "string"
}

Card Payments

Payment Parameters

ParameterTypeRequiredDescription
currencystringYesThe currency of the transaction
amountnumberYesThe amount of the transaction
phoneNumberstringYesThe phone number associated with the account
emailstringNoThe email address associated with the account
customerFirstNamestringNoThe first name of the customer
customerLastNamestringNoThe last name of the customer
customerCitystringNoThe city of the customer
customerCountrystringNoThe country of the customer
customerAddressstringNoThe address of the customer
customerZipnumberNoThe ZIP code of the customer
externalIdstringNoThe external ID of the transaction
narrationstringNoAdditional information or notes about the transaction

Here’s how to use the Lipila API to accept a card payment

curl --location --request POST 'hhttps://lipila-uat.hobbiton.app/transactions/card' \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"currency": "ZMW",
"amount": 0,
"phoneNumber": "string",
"email": "string",
"customerFirstName": "string",
"customerLastName": "string",
"customerCity": "string",
"customerCountry": "string",
"customerAddress": "string",
"customerZip": 0,
"externalId": "string",
"narration": "string"
}'

Make sure to replace YOUR_SECRET_KEY with your Lipila secret key.

Response For Card Payment Transactions

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

ParameterType
statusstring
paymentTypestring
currencystring
amountnumber
accountNumberstring
customerobject
fullNamestring
phoneNumberstring
emailstring
ipAddressstring
messagestring
transactionIdstring
externalIdstring
redirectUrlstring

Successful Response Status Code

CodeDescription
201Created

Here’s an example of a Transaction processed response for card payment:

{
"status": "Pending",
"paymentType": "AirtelMoney",
"currency": "string",
"amount": 0,
"accountNumber": "string",
"customer": {
"fullName": "string",
"phoneNumber": "string",
"email": "string"
},
"ipAddress": "string",
"message": "string",
"transactionId": "string",
"externalId": "string",
"redirectUrl": "string"
}