Skip to main content

Check Transaction Status

As a merchant, you need to check the status of the transaction to confirm that the payment was successful before completing the transaction. For every transaction, you must supply the Checkout Request ID. To make the you need to make a POST call to the following url with merchant code being mandatory and atleast one of the other fields.

Alt test Endpoint: https://sandbox.sasapay.app/api/v1/transactions/status-query/

Request Parameters

FieldTypeDescriptionExample
MerchantCodeStringA unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number). This field is Mandatory.40****9
CheckoutRequestIdStringA unique identifier of the transaction generated by the SasaPay API. This field is optional.6e1e251f-afb0-****-a097-f1ae0e0b2ce6
MerchantTransactionReferenceStringA unique identifier of the transaction generated by the Merchant system. This ield is optional.123456****4
TransactionCodeStringA unique identifier of the transaction generated by the SasaPay API. This ield is optional.EDSWKTT****FR
CallbackUrlString(URL)The callback URL where SasaPay will send transaction status details.https://example.com
sample request
Headers
Key: Authorization
Value: Bearer cFJZcjZ6anEwaThM6UmYyMkJmWm9nMHFRR2xWOQ==
Body:
{
"MerchantCode":"6*****2",
"CheckoutRequestId": "6e1e251f-afb0-****-a097-f1ae0e0b2ce6",
"MerchantTransactionReference":"123456****4",
"TransactionCode":"EDSWKTT****FR",
"CallbackUrl": "https://example.com"
}

Response Parameters

FieldTypeDescriptionExample
statusBoolThis is a boolean value that indicates the status of the response. true means success and false means an error occurred or the request failed.true
messageStringDescription of the response returned by SasaPay APIYour request has been received. Check your callback url for response
sample response
{
"status": true,
"message": "Your request has been received. Check your callback url for response"
}

Response Parameters

FieldTypeDescriptionExample
statusBoolThis is a boolean value that indicates the status of the response. true means success and false means an error occurred or the request failed.true
MerchantCodeStringA unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number)40****9
TransactionTypeStringThis indicates the type of transaction performed.C2B
TransactionDateStringThis is the timestamp of when the transaction was performed."2022-05-09T10:50:48.359022Z"
CheckoutIdStringA unique identifier of the transaction generated by the Merchant system. This must be identical to the CheckoutRequestId used to query the transaction status.6e1e251f-afb0-****-a097-f1ae0e0b2ce6
TransactionAmountStringThe amount of money the customer is expected to pay as per the transaction.'100'
PaidStringThis is a true o false status showing whether the customer paid or not.true
AmountPaidStringThis is the actual amount of money paid by the customer.'100'
PaidDateStringThis indicates the date and time the customer paid for the transaction.2022-05-09T10:50:48.359022Z
SourceChannelStringThis is the source of the funds facilitating the transaction.'SasaPay'
DestinationChannelStringThis is the destination of the funds from the transaction.'M-PESA'
sample response
{
"ResultCode": "0",
"ResultDescription": "Transaction completed successfully",
"TransactionType": "C2B",
"TransactionDate": "2024-06-28 08:01:52.646222+00:00",
"CheckoutId": "146***fd-af6d-****-bffc-72bb8ef55fa5",
"CheckoutRequestID": "146fa4fd-af6d-438b-bffc-72bb8ef55fa5",
"MerchantReference": "6767**2320",
"RequestedAmount": "500.00",
"Paid": true,
"PaidAmount": "500.00",
"PaidDate": "2024-06-28 08:02:22.987679+00:00",
"SourceChannel": "M-PESA",
"DestinationChannel": "SasaPay",
"TransID": "J2BL*****CG6",
"TransactionCode": "J2BL*****CG6",
"ThirdPartyTransactionCode": "SF****2TRP"
}