Void Transaction
void a transaction means that the previously authorized/held amount from a previous auth
transaction (that reserved but not yet transferred to the merchant acquirer bank) will be released back to the cardholder's bank account from his own bank side, as it was kept on hold there. In this manual, we walk you through how to use and manage the mentioned endpoint.Void
requests are available for ONLY Authenticated Authorized transactions that are not fully captured
yet. To process a void
request, tran_type
should be void
, and the transaction id of the original Authorize transaction that you want to capture should be passed in the tran_ref
parameter.
Through out the article we will use the transaction types clarified in ourWhat is the "tran_type" (transaction type)?solution article.
Be aware that Void request is ONLY available for successfully Authorized Auth
(A) transactions that not captured yet.
and that the tran_type
MUST be Void
.
The Endpoint and Related Postman Collection
In this tutorial, we will rely on the PayTabs Void Transaction API Endpoint, mentioned on the PayTabs API endpoints postman collection, which you can access fromhere. The endpoint will need to be accessed with a POST request on the below-mentioned URL
POST | {{domain}}/payment/request |
---|
Please note that not using the proper endpoint URL {domain} will lead to authentication issues within your responses. To find the your proper domain you can read ourWhat is my (Region)/(endpoint URL)?tutorial article.
- KSA
- UAE
- Egypt
- Oman
- Jordan
- Kuwait
- Global
https://secure.paytabs.sa/payment/request
https://secure.paytabs.com/payment/request
https://secure-egypt.paytabs.com/payment/request
https://secure-oman.paytabs.com/payment/request
https://secure-jordan.paytabs.com/payment/request
https://secure-kuwait.paytabs.com/payment/request
https://secure-global.paytabs.com/payment/request
The Minimum Required Parameters
To initiate a Void payment request, there are minimum required parameters that need to be passed with valid information. The specification of these required parameters is clarified below:
Parameter | Data Type | Required | |
---|---|---|---|
| STRING | ✔ | |
Indicates the Transaction Reference on the PayTabs side check details on [Response Parameters | tran_ref] | |||
|
Sample Request Payloads
The below sample request payload will show you how you can pass the above-mentioned parameters, which are needed to be passed with valid values to perform a request.
{
"profile_id": 703XX,
"tran_type": "void",
"tran_class": "ecom",
"cart_id": "CART#10001",
"cart_currency": "SAR",
"cart_amount": 99.99,
"cart_description": "Void reason",
"tran_ref": "TST2016700000XXX"
}
Sample Response Payloads
The below sample response payload will show you the received payload parameters after the above direct Void
transaction.
{
"tran_ref": "TST2105900091XXX",
"tran_type": "void"
"cart_id": "CART#10001",
"cart_description": "Product/Service description",
"cart_currency": "SAR",
"cart_amount": "100.00",
"tran_currency": "SAR",
"tran_total": "100.00",
"payment_result": {
"response_status": "A",
"response_code": "036501",
"response_message": "Authorised",
"acquirer_message": "00:Approved",
"acquirer_rrn": "42550903****",
"transaction_time": "2024-09-11T09:01:51Z"
},
"payment_info": {
"payment_method": "MasterCard",
"card_type": "Credit",
"card_scheme": "MasterCard",
"payment_description": "5500 00## #### 5559",
"expiryMonth": 12,
"expiryYear": 2026
},
"user_defined": {
"udf1": "UDF1 Test",
"udf2": "UDF2 Test",
"udf3": "UDF3 Test",
"udf4": "UDF4 Test",
"udf5": "UDF5 Test",
"udf6": "UDF6 Test",
"udf7": "UDF7 Test",
"udf8": "UDF8 Test",
"udf9": "UDF9 Test"
},
"serviceId": 1,
"profileId": 703XX,
"merchantId": 46XXX,
"trace": "PMNT****.6769****.0005****"
}