Capture Transaction
To capture a transaction means that the previously authorized amount from a previous auth transaction will be captured/transferred from the cardholder's bank account to your bank account. In this manual, we walk you through how to use and manage the mentioned endpoint.
To process a capture request, tran_type
MUST be capture, and the transaction reference of the original Authorized 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.
The Endpoint and Related Postman Collection
In this tutorial, we will rely on the PayTabs Technical Portal Capture Transaction API Endpoint, mentioned on the PayTabs Technical Portal 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 capture 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 Technical Portal 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.
Be aware that Capture request is ONLY available for successfully Authorized (A) transactions.
{
"profile_id": 703XX,
"tran_type": "capture",
"tran_class": "ecom",
"cart_id": "CART#10001",
"cart_currency": "SAR",
"cart_amount": 99.99,
"cart_description": "Capture reason",
"tran_ref": "TST2016700000XXX"
}
Be aware that that the tran_type
MUST be capture.
Sample Response Payloads
{
"tran_ref": "TST2105900091XXX",
"tran_type": "Capture"
"cart_id": "CART#10001",
"cart_description": "Product/Service description",
"cart_currency": "SAR",
"cart_amount": "100",
"customer_details": {
"name": "Technical Support",
"email": "demo@paytabs.com",
"phone": "+966 55 xxxxxx6",
"street1": "address street",
"city": "Jeddah",
"state": "Makkah",
"country": "SA",
"ip": "86.111.XXX.X"
},
"payment_result": {
"response_status": "A",
"response_code": "G15046",
"response_message": "Authorised",
"transaction_time": "2021-02-28T12:24:06Z"
},
"payment_info": {
"card_type": "Credit",
"card_scheme": "Visa",
"payment_description": "4111 11## #### 1111"
}
}