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.postapay.app/api/v1/transactions/status/
Request Parameters
Field | Type | Description | Example |
---|---|---|---|
MerchantCode | Number | 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 | Alpha-Numeric | A unique identifier of the transaction generated by the PostaPay API. This field is optional. | 6e1e251f-afb0-****-a097-f1ae0e0b2ce6 |
MerchantTransactionReference | Alpha-Numeric | A unique identifier of the transaction generated by the Merchant system. This ield is optional. | 123456****4 |
TransactionCode | Alpha-Numeric | A unique identifier of the transaction generated by the PostaPay API. This ield is optional. | EDSWKTT****FR |
sample request
Headers
Key: Authorization
Value: Bearer cFJZcjZ6anEwaThM6UmYyMkJmWm9nMHFRR2xWOQ==
Body:
{
"MerchantCode":"6*****2",
"CheckoutRequestId": "6e1e251f-afb0-****-a097-f1ae0e0b2ce6",
"MerchantTransactionReference":"123456****4",
"TransactionCode":"EDSWKTT****FR"
}
Response 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) | 40****9 |
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 |
TransactionType | String | This indicates the type of transaction performed. | C2B |
TransactionDate | Time | 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 | Numeric | The amount of money the customer is expected to pay as per the transaction. | '100' |
Paid | Bool | This is a true o false status showing whether the customer paid or not. | true |
AmountPaid | Numeric | 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. | 'PostaPay' |
DestinationChannel | String | This is the destination of the funds from the transaction. | 'M-PESA' |
sample response
{
"status": true,
"message": "B2C Transaction Details",
"data": {
"ResultCode": "0",
"ResultDescription": "The service request is processed successfully.",
"TransactionType": "B2C",
"TransactionDate": "2023-07-01T08:00:32.90984641Z",
"CheckoutRequestId": "93d0fc82-****-45b1-****-c71ddfe77dee",
"MerchantCode": "1****1",
"MerchantReference": "H*****145",
"TransactionAmount": "50.00",
"SourceChannel": "PostaPay",
"DestinationChannel": "ARTEL-MONEY",
"TransactionCode": "S****L48B****HR",
"ThirdPartyTransactionCode": "RG*&**0E9",
"DestinationAccountNumber": "25472******3",
"DestinationAccountName": "JOHN DOE"
}
}