Skip to content

Mobile Money Collections

Description

The following endpoint is used to initiate a mobile money collection request.

Headers

The following headers should be added to your request.

HeaderTypeDescriptionRequired
acceptapplication/jsonExpected response formatYes
Content-Typeapplication/jsonContent type of the request bodyYes
x-api-keystringYour Lipila API keyYes
callbackUrlstringURL to receive asynchronous callback notificationsOptional

Request Body

The following properties should be present in your request body.

FieldTypeDescriptionRequired
referenceIdstringUnique reference identifier for the transactionYes
amountnumberAmount to collectYes
narrationstringDescription or note about the transactionyes
accountNumberstringMobile money account number to collect fromYes
currencystringCurrency code (e.g., ZMW)Yes
emailstringEmail address associated with the transactionOptional

Example Request

This is an example request to create a mobile money payment.

js

curl -X 'POST' \
  'https://api.lipila.dev/api/v1/collections/mobile-money' \
  -H 'accept: application/json' \
  -H 'x-api-key: your_Secret_key' \
  -H 'callbackUrl: https://lipila.io/callback' \
  -H 'Content-Type: application/json' \
  -d '{
  "referenceId": "12345",  // Use this Id to check the transaction status.
  "amount": 1,
  "narration": "test",
  "accountNumber": "260xxxxxxxxx",
  "currency": "ZMW",
  "email": "johndoe@gmail.com"
  }'

INFO

Note MTN may sometimes delay to send prompts. when that happens dial *115#.

Example Successful Response

Below is a successful response which shows the transaction was created successfully.

HTTP Status CodeDescription
200SUCCESS
js

{
  "currency": "ZMW",
  "amount": 1, 
  "accountNumber": "260xxxxxxxxxx",
  "status": "Pending",
  "paymentType": "ZamtelKwacha",
  "ipAddress": "::1",
  "cardRedirectionUrl": null,
  "createdAt": "2025-10-01T10:24:56.605474+00:00",
  "referenceId": "f95a8f405ed1",
  "identifier": "LPLXC-20251001-2834" 
  "message": "Transaction Successful",
}

Error Codes

The following are the expected error responses from the api.

HTTP Status CodeError CodeDescription
400BAD REQUESTMissing or invalid request parameters
401UNAUTHORIZEDMissing or invalid API authentication
403FORBIDDENAccess denied to this resource
500SERVER_ERRORInternal server error
429TOO MANY REQUESTSRate limit exceeded, slow down requests

Example Failed Response

Here is what to expect when your transaction fails. Below are examples of failed transaction response. The message property is used here to describe the failure reason of a transaction.

MTN

js

{
  "referenceId": "000c291e430f",
  "currency": "ZMW",
  "amount": 1,
  "accountNumber": "260xxxxxxxxxx",
  "status": "Failed",
  "paymentType": "MtnMoney",
  "type": "Collection",
  "ipAddress": "::ffff:10.109.2.19",
  "identifier": "LPLTXNCMM-20250820135741",
  "message": "LOW_BALANCE_OR_PAYEE_LIMIT_REACHED_OR_NOT_ALLOWED"
}

AIRTEL

js
{
  "referenceId": "a65a",
  "currency": "ZMW",
  "amount": 1,
  "accountNumber": "260xxxxxxxxxx",
  "status": "Failed",
  "paymentType": "AirtelMoney",
  "type": "Collection",
  "ipAddress": "::1",
  "identifier": "LPLTXNCAM-20250818145802",
  "message": "User didn't enter the pin."
}

ZAMTEL

js
{
  "referenceId": "a8b8fb376832",
  "currency": "ZMW",
  "amount": 1,
  "accountNumber": "260xxxxxxxxxx",
  "status": "Failed",
  "paymentType": "ZamtelKwacha",
  "type": "Collection",
  "ipAddress": "::ffff:10.109.2.19",
  "identifier": "LPLTXNCZK-20250821144612-C2FA2B72CF15",
  "message": "System internal error."
}

Released under the MIT License.