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.
Endpoint: https://sandbox.sasapay.app/api/v2/waas/payments/pay-bills/
Request Parameters
Field | Type | Description | Example |
---|---|---|---|
merchantCode | String | A unique number assigned to an organization/merchant registered with ViewTech. This is the number associated with the application | 40****9 |
transactionReference | Alpha-Numeric | This is a unique identifier of this payment request transaction. | o**9 |
currencyCode | String | This is the type of currency. | KES |
amount | Numeric | This the amount of money spent by the beneficiary when paying to a pay bill. | 10 |
senderAccountNumber | Numeric | the sender bank account number. | 2****11 |
receiverMerchantCode | Alpha-Numeric | A unique identifier of the transaction generated by the Merchant system. | 2****11 |
accountReference | Alpha-Numeric | A unique identifier of the transaction generated by the Merchant system. | 254702*****0 |
chargeAccount | String | Indicates which account will be charged for the transaction fees, either the merchant's account or the beneficiary's account. | 2612/2822 |
transactionFee | Numeric | This the amount charged as the transaction fee. | 2****11 |
billerType | string | Type of platform the payment is made to | PAYBILL |
networkCode | Numeric | A unique five digit code used for identifying the various mobile money providers. A | 0 - SasaPay 63902 -M-PESA |
CallBackUrl | URL | This is the URL where SasaPay will send the results after the payment process is initiated. | https://example.com/callback/ |
Reason | String | This 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
Field | Type | Description | Example |
---|---|---|---|
status | string | This is status code that indicates the status of the response | true |
responseCode | String | This 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" |
message | String | A description of the response status sent by SasaPay API. | "Transaction has been initiated" |
merchantReference | Alpha-Numeric | A unique identifier of the transaction generated by the Merchant system. | 2****11 |
checkoutRequestId | Alpha-Numeric | This is a unique identifier of this payment request transaction | d4ad2e17-2671-43ff-b254-d6d818c3557e |
ReferenceNumber | Alpha-Numeric | A 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
Field | Type | Description | Example |
---|---|---|---|
DestinationChannel | String | This is the network code that identifies the mobile money provider such as M-PESA. | 63902 |
RecipientName | Numeric | This is the name of the person recieving the money. | "John Doe" |
RecipientAccountNumber | Numeric | This is the mobile number that received the money. | 2547******08 |
ResultCode | Numeric | This 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 |
SenderAccountNumber | Numeric | This is the account number of the beneficiary who sent the money. | 40***59-122 |
CheckoutRequestID | Alpha-Numeric | A unique identifier of the checkout request | "6**7" |
MerchantRequestID | String | A unique identifier of the payment transaction request generated from the merchant’s system. | "6*1**4" |
MerchantCode | Numeric | A unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number). | "40***59" |
ResultDesc | String | A message from the API that provides more details about the status of processing the payment request. | "Transaction processed successfully" |
SourceChannel | String | The channel through which the payment was made. | "SasaPay" |
TransactionDate | TimeStamp | This is a timestamp that represents the date and time that the transaction completed in the format YYYYMMDDHHmmss | 20220504064810 |
TransactionAmount | Numeric | This is the amount of money transferred from the beneficiary account. | "50" |
SasaPayTransactionID | Alpha-Numeric | A unique identifier of the payment transaction request generated from the API. | "W****67" |
MerchantTransactionReference | Alpha-Numeric | A unique identifier of the payment transaction request generated from the merchant’s system. | "a38104d5-0306-****-a6e6-2867ebcc4949" |
MerchantAccountBalance | Numeric | This 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"
}