Skip to main content

Payments(LIPA)

As a merchant, your beneficiaries can pay for products and services to Paybill number or Till number provided by SasaPay or M-PESA. A POST request to an endpoint below enables that.

Alt test Endpoint: https://sandbox.sasapay.app/api/v2/waas/payments/pay-bills/

Request Parameters

FieldTypeDescriptionExample
merchantCodeStringA unique number assigned to an organization/merchant registered with ViewTech. This is the number associated with the application40****9
transactionReferenceAlpha-NumericThis is a unique identifier of this payment request transaction.o**9
currencyCodeStringThis is the type of currency.KES
amountNumericThis the amount of money spent by the beneficiary when paying to a pay bill.10
senderAccountNumberNumericthe sender bank account number.2****11
receiverMerchantCodeAlpha-NumericA unique identifier of the transaction generated by the Merchant system.2****11
accountReferenceAlpha-NumericA unique identifier of the transaction generated by the Merchant system.254702*****0
chargeAccountStringIndicates which account will be charged for the transaction fees, either the merchant's account or the beneficiary's account.2612/2822
transactionFeeNumericThis the amount charged as the transaction fee.2****11
billerTypestringType of platform the payment is made toPAYBILL
networkCodeNumericA unique five digit code used for identifying the various mobile money providers. A0- SasaPay 63902-M-PESA
CallBackUrlURLThis is the URL where SasaPay will send the results after the payment process is initiated.https://example.com/callback/
ReasonStringThis is an optional message describing the purpose of the transaction."Paying for shopping"
Request sample
Headers
Key: Authorization
Value: Bearer Q1k2RW5SOGlsYUZnRzNGMk1DNlE1T1gzemFtY
Body

{
"merchantCode": "2**2",
"transactionReference": "16****1",
"currencyCode": "KES",
"amount": 100,
"senderAccountNumber": "2**2",
"receiverMerchantCode": "9***0",
"accountReference": "2547****4*280",
"chargeAccount": "50**87",
"transactionFee": 9,
"billerType": "PAYBILL",
"networkCode": "0",
"callbackUrl": "https://posthere.io/4bdd-47d5-a54d/callback/",
"reason": "Payment of bill"
}

Response Parameters

FieldTypeDescriptionExample
statusstringThis is status code that indicates the status of the responsetrue
responseCodeStringThis is status code that indicates the status of the response. 0 means success and any other code means an error occurred or the request failed.Please refer to the response codes table above."statusCode": "0"
messageStringA description of the response status sent by SasaPay API."Transaction has been initiated"
merchantReferenceAlpha-NumericA unique identifier of the transaction generated by the Merchant system.2****11
checkoutRequestIdAlpha-NumericThis is a unique identifier of this payment request transactiond4ad2e17-2671-43ff-b254-d6d818c3557e
ReferenceNumberAlpha-NumericA unique identifier for a transaction and can be used to check the status of the transaction."763df0f8-a815-40f5-b13f-cdb4632793e6"
Response Sample
{
"status": true,
"message": "Transaction processed successfully",
"checkoutRequestId": "d4ad2e17-2671-43ff-b254-d6d818c3557e",
"merchantReference": "16***1",
"responseCode": "0",
"transactionCharges": "0",
"merchantFees": "0",
}

After the bill payment is processed, the RESULTS are sent to the API which forwards these results to your system through the callback URL.

Results Parameters

FieldTypeDescriptionExample
DestinationChannelStringThis is the network code that identifies the mobile money provider such as M-PESA.63902
RecipientNameNumericThis is the name of the person recieving the money."John Doe"
RecipientAccountNumberNumericThis is the mobile number that received the money.2547******08
ResultCodeNumericThis is status code that indicates the status of the transaction. 0 means success and any other code means an error occurred or the transaction failed.Please refer to the response codes table above."ResultCode" : 0
SenderAccountNumberNumericThis is the account number of the beneficiary who sent the money.40***59-122
CheckoutRequestIDAlpha-NumericA unique identifier of the checkout request"6**7"
MerchantRequestIDStringA unique identifier of the payment transaction request generated from the merchant’s system."6*1**4"
MerchantCodeNumericA unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number)."40***59"
ResultDescStringA message from the API that provides more details about the status of processing the payment request."Transaction processed successfully"
SourceChannelStringThe channel through which the payment was made."SasaPay"
TransactionDateTimeStampThis is a timestamp that represents the date and time that the transaction completed in the format YYYYMMDDHHmmss20220504064810
TransactionAmountNumericThis is the amount of money transferred from the beneficiary account."50"
SasaPayTransactionIDAlpha-NumericA unique identifier of the payment transaction request generated from the API."W****67"
MerchantTransactionReferenceAlpha-NumericA unique identifier of the payment transaction request generated from the merchant’s system."a38104d5-0306-****-a6e6-2867ebcc4949"
MerchantAccountBalanceNumericThis the amount of money remaining in the merchant's account after transaction."1000.00"
Result sample
{
"MerchantRequestID": "344338155",
"CheckoutRequestID": "8517ee40-a9d4-****-b248-4da2ada27a91",
"ResultCode": 0,
"ResultDesc": "Transaction processed successfully.",
"MerchantCode": "2**2",
"TransactionAmount": "500.00",
"TransactionCharge":"0.00",
"MerchantFees": "0.00",
"MerchantAccountBalance": "10111.80",
"MerchantTransactionReference": "344338155",
"TransactionDate": "20231114033234",
"RecipientAccountNumber": "9**00",
"DestinationChannel": "0",
"SourceChannel": "SasaPay",
"SasaPayTransactionID": "EJZPX**3OWZ7",
"RecipientName": "",
"SenderAccountNumber": "2**2"
}