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.
Endpoint: https://sandbox.sasapay.app/api/v1/transactions/status-query/
Request Parameters
Field | Type | Description | Example |
---|---|---|---|
MerchantCode | String | A 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 |
CheckoutRequestId | String | A unique identifier of the transaction generated by the SasaPay API. This field is optional. | 6e1e251f-afb0-****-a097-f1ae0e0b2ce6 |
MerchantTransactionReference | String | A unique identifier of the transaction generated by the Merchant system. This ield is optional. | 123456****4 |
TransactionCode | String | A unique identifier of the transaction generated by the SasaPay API. This ield is optional. | EDSWKTT****FR |
CallbackUrl | String(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
Field | Type | Description | Example |
---|---|---|---|
status | Bool | This 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 |
message | String | Description of the response returned by SasaPay API | Your 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
Field | Type | Description | Example |
---|---|---|---|
status | Bool | This 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 |
MerchantCode | String | A unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number) | 40****9 |
TransactionType | String | This indicates the type of transaction performed. | C2B |
TransactionDate | String | This is the timestamp of when the transaction was performed. | "2022-05-09T10:50:48.359022Z" |
CheckoutId | String | A 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 |
TransactionAmount | String | The amount of money the customer is expected to pay as per the transaction. | '100' |
Paid | String | This is a true o false status showing whether the customer paid or not. | true |
AmountPaid | String | This is the actual amount of money paid by the customer. | '100' |
PaidDate | String | This indicates the date and time the customer paid for the transaction. | 2022-05-09T10:50:48.359022Z |
SourceChannel | String | This is the source of the funds facilitating the transaction. | 'SasaPay' |
DestinationChannel | String | This 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"
}