Lipisha Instant Transaction Notification (ITN)


Simulate Payment


Simulate or fake a mobile payment when testing. This is only available for the sandbox environment.

Once completed, it sends an Instant Transaction Notification or webhook event to your callback URL for you to process the transaction.


Endpoints

https://developer.lipisha.com/index.php/v2/api/simulate_payment TEST

Request POST application/x-www-form-urlencoded

Parameter Description Example
api_key Your Lipisha API key. 3aa67677e8bf1d4c8fe886a38c03a860
api_signature Your Lipisha API signature. SYetmwsNnb5bwaZRyeQKhZNNkCoEx+5x=
mobile_number Mobile number of the customer. 254712345678
payment_type Payment type to simulate the transaction. Options are:
Kenya
  • Paybill (M-Pesa)
  • Paybill (Equitel)
  • Paybill (Airtel Money)
  • Buy Goods (M-Pesa)
Rwanda
  • Paybill (MTN Money)
  • Paybill (Tigo Cash)
Uganda
  • Paybill (MTN Money)
  • Paybill (Airtel Money)
Tanzania
  • Paybill (Vodacom M-Pesa)
Paybill (M-Pesa)
business_number Business number, paybill number or till number as would be entered by the customer.

Ensure you use one of the designated business numbers (either Shared or Dedicated) e.g 961700 in this case. Options are:
For Shared
  • 961700
  • 961072
  • LIPISHA
For Dedicated
Log into the sandbox and create/check for dedicated business numbers under Settings then Payments.
961700
account_number Account number as would be entered by the customer. You can also add a merchant reference e.g. INV000002, after the account number separated by a delimeter (any non alpha-numeric character e.g #, -, /, _, | etc) e.g #INV000002 therefore 00100#INV000002 or /INV000002 therefore 00100/INV000002

For Shared
Ensure you have or prefix one of your designated account numbers e.g 00100 in this case when using a Shared business number. Log into the sandbox and check for account numbers under Settings then Payments.

For Dedicated
Simply enter the merchant reference e.g. INV000002, if required. Having the account number prefix is not mandatory for dedicated paybills.
00100#INV000002
amount Amount as would be entered by the customer. 1000

Example Requests
curl "https://developer.lipisha.com/index.php/v2/api/simulate_payment" \
  -X POST \
  --data-urlencode "api_key=3aa67677e86a38c03a860" \
  --data-urlencode "api_signature=SYetmwsNnb5bwaZRyeQKhZNNkCoEx+5x=" \
  --data-urlencode "mobile_number=254712345678" \
  --data-urlencode "payment_type=Paybill (M-Pesa)" \
  --data-urlencode "business_number=961700" \
  --data-urlencode "account_number=00100#INV000002" \
  --data-urlencode "amount=1000"
curl "https://developer.lipisha.com/index.php/v2/api/simulate_payment" \
  -X POST \
  --data-urlencode "api_key=3aa67677e86a38c03a860" \
  --data-urlencode "api_signature=SYetmwsNnb5bwaZRyeQKhZNNkCoEx+5x=" \
  --data-urlencode "mobile_number=256712345678" \
  --data-urlencode "payment_type=Paybill (MTN Money)" \
  --data-urlencode "business_number=21234" \
  --data-urlencode "account_number=INV000002" \
  --data-urlencode "amount=1000"

Response application/json

Parameter Description Example
Status
status Status of the API call SUCCESS
status_code Status code of the API call 0000
status_description Description of the API call Mobile payment simulated. Ensure all provided parameters are correct.
Content

Example Response
{
  "status": {
    "status_code": "0000",
    "status_description": "Mobile payment simulated. Ensure all provided parameters are correct.",
    "status": "SUCCESS"
  },
  "content": []
}

Fork me on GitHub