Skip to main content

Business to Business (B2B)

Transact between SasaPay Biller number to another SasaPay or M-PESA Biller number.

Alt test Endpoint: https://sandbox.sasapay.app/api/v1/payments/b2b/

Request Parameters

FieldTypeDescriptionExamples
MerchantCodeStringA unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number)“95**43”
MerchantTransactionReferenceAlpha-NumericA unique identifier of the transaction generated by the Merchant system."87065"
CurrencyStringStandardization that defines alpha codes and numeric codes for the representation of currenciesKES
AmountStringThe amount of money being sent to the receiver merchant.30.00
ReceiverMerchantCodeStringThis is the merchant code where the funds are to be received."94**17"
AccountReferenceStringThis is the reference to of the transaction being made. This field is optional for TILL payments."1234"
ReceiverAccountTypeStringThis is the identifier of the receiver merchant code. MUST be PAYBILL or TILL"PAYBILL"
NetworkCodeStringThis is the identifier of the mobile money provide being paid to.63902-M-PESA 0-SasaPay "
ReasonStringThe reason for payment."Payment of transportation fee"
CallBackURLString(URL)This is the URL to be specified in your request that will be used by SasaPay to send notification upon processing of the payment request"https://**.io/4bdd-47d5-a54d"
Sample request
Headers
Key: Authorization
Value: Bearer cFJZcjZ6anEwaThMMXp6d1FETUxwWkIzeVBDa2hNc2M6UmYyMkJmWm9nMHFRR2xWOQ==
Body {
"MerchantCode": "59**75",
"MerchantTransactionReference": "87065",
"Currency":"KES",
"Amount": 1,
"ReceiverMerchantCode": "3209",
"AccountReference": "Test",
"ReceiverAccountType": "PAYBILL",
"NetworkCode": "0",
"CallBackURL": "https://******.io/4bdd-47d5-a54d",
"Reason": "Payment of transportation fee"
}

Response Sample

FieldTypeDescriptionExample
statusBooleanThis is a boolean true or false status that indicates the outcome of the response. true means success and false means transaction failed or intermittent error occured.true
detailStringA description of the response status sent by SasaPay API."Transaction is being processed"
B2BRequestIDStringAn identifier for the transaction request returned by SasaPay upon successful request submission. This is generated by SasaPay API."4040359-0f8****1-4779-85b3-44e575166f7a"
ConversationIDStringAn identifier for the transaction request returned by SasaPay upon successful request submission. This is generated by SasaPay API."0f8dc1f9-6721-****-44e575166f7a"
OriginatorConversationIDStringAn identifier for the transaction request from the merchant side. This is generated by merchant system. It is the input given as MerchantTransactionReference when sending B2C request."123344"
TransactionChargesStringThis is the amount of money the merchant is charged for the transaction.0
ResponseCodeStringThis is a numeric status code that indicates the status of the response. 0 means success and any other code means an error occurred or the request failed.0
ResponseDescriptionStringThis is a true or false status the details of the status of the request from SasaPay API.true
Sample response
{
"status": true,
"detail": "Transaction is being processed",
"B2BRequestID": "95000-6471280a-151c-4acd-98f0-abab82b3e951",
"ConversationID": "6471280a-151c-4acd-98f0-abab82b3e951",
"OriginatorConversationID": "87065",
"TransactionCharges": "0.00",
"ResponseCode": "0",
"ResponseDescription": "Transaction is being processed"
}

Results Response

FieldTypeDescriptionExample
MerchantCodeStringA unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number)“2*****8”
DestinationChannelStringThis name of entity channel where the funds are sent."MPESA"
RecipientNameStringThis full name of the customer receiving the funds."John Kym Doe"
RecipientAccountNumberStringThis account number where the funds are received"2547*******7"
ResultCodeStringThe numeric status of the results, sent to the callback url0 means success, while any other code indicates that an error occurred. The specific error is describe in the ResultDesc field
ResultDescStringThis is a message from the API that gives the status of the request processing and usually maps to a specific result code value."Transaction processed successfully."
SourceChannelStringThe name of the entity channel from where the funds transfer is initiated"SasaPay"
SasaPayTransactionCodeStringThis is the transaction code from SasaPay"CRVSUVGIRP"
CheckoutRequestIDStringThis is a unique SasaPay transaction ID for every payment request. Same value is sent to the customer over SMS upon successful processing."6f3ebd0d-b892-4c4e-952a-f3eea030af85"
SasaPayTransactionIDStringThis is a unique SasaPay transaction ID for every payment request. Same value is sent to the customer over SMS upon successful processing. It is usually returned under the ResultParameter array.PR52
ThirdPartyTransactionCodeStringThis is a unique ThirdParty transaction reference for a B2C transaction."SQ33424"
TransactionAmountStringThis is the amount that was transacted. It is usually returned under the ResultParameter array."10.00"
TransactionChargesStringThis is the amount of money the merchant is charged for the transaction.0
MerchantRequestIDStringThe unique id sent with the transaction request from the Merchant system"25*******77"
MerchantTransactionReferenceStringA unique identifier of the transaction generated by the Merchant system."254******77"
TransactionDateStringThis is the date and time that the transaction completed SasaPay."20220305103101"
MerchantAccountBalanceStringThis is the available balance of the Charges Paid account under the B2C MerchantCode used in the transaction.564.00
sample result response
{
"MerchantCode": "6***0",
"DestinationChannel": "MPESA",
"RecipientName": "Johh Kym Doe",
"RecipientAccountNumber": "2547*******7",
"ResultCode": 0,
"CheckoutRequestID": "6f3ebd0d-b892-4c4e-952a-f3eea030af85",
"MerchantRequestID": "25*******77",
"ResultDesc": "Transaction processed successfully.",
"SourceChannel": "SasaPay",
"SasaPayTransactionCode": "CRVSUVGIRP",
"TransactionDate": "20220305103101",
"TransactionAmount": "10.00",
"TransactionCharge": "0.00",
"SasaPayTransactionID": "PR52",
"ThirdPartyTransactionCode": "",
"MerchantTransactionReference": "254******77",
"MerchantAccountBalance": "564.00"
}