Initiating The Payment
PayTabs provides you with a collection of API endpoints which used to process all payments, regardless of if they are through either your own payment pages, the managed payment pages, or if you are using the hosted payment pages.
PayLinks integration type is suitable for merchants with PCI SAQ A or merchants does not have any PCI levels. To customize the UI of the PayPage, check thisHow to customize the PayPage (Hosted Payment Page) UI?, and to know more about the Hosted Payment Page PCI DSS merchant requirements, please check this article.
In this manual, we will walk you through how to initiate a payment request via this integration type. You will be introduced to the required parameters that need to be passed to initiate the request, along with all the possible optional parameters as well. We highly recommend that you and your team check our PayLinks | Payment Workflow manual first to understand the business/logic this integration type relay on.
The Endpoint and Related Postman Collectionβ
In this tutorial, we will rely on the PayTabs Hosted Payment Page API Endpoint, mentioned on PayTabs API endpoints postman collection, which you can access from PayTabs Postman APIs Collection. The endpoint will need to be accessed with a POST request on the below-mentioned URL
POST | {{domain}}/payment/link/create |
---|
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/link/create
https://secure.paytabs.com/payment/link/create
https://secure-egypt.paytabs.com/payment/link/create
https://secure-oman.paytabs.com/payment/link/create
https://secure-jordan.paytabs.com/payment/link/create
https://secure-kuwait.paytabs.com/payment/link/create
https://secure-global.paytabs.com/payment/link/create
Request Parametersβ
To initiate a payment request using this integration type, there are minimum required parameters that need to be passed with valid information. The specification of these required parameters is clarified below:
- The Minimum Required Parameters
- The Available Optional Parameters
paylinks
with filter required
.paylinks
with filter optional
.Request & Response Payload Samplesβ
This section is dedicated give you a sample API request payload using both the above mentioned required and optional parameters, along with showing you the response payload received upon using each request payload.
- Required Parameters Sample Payloads
- Optional Parameters Sample Payloads
The below sample request payload will show you how you can pass the above-mentioned required parameters, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Sample Request Payload
- Sample Response Payload
{
"profile_id": 109XXX,
"link_title": "AK-Test Title",
"cart_amount": "400",
"cart_currency": "SAR"
}
{
"link_id": 147XXX,
"profile_id": 109XXX,
"link_url": "https://secure.paytabs.com/payment/link/109XXX/1474XXX",
"link_title": "AK-Test Title",
"cart_currency": "SAR",
"cart_amount": "400",
"cart_min": "0",
"cart_max": "0",
"shipping_required": false,
"link_status": true,
"donation_mode": false,
"created_at": "2024-10-02T09:39:41Z",
"updated_at": "2024-10-02T09:39:41Z"
}
The below sample request payload will show you how you can pass the above-mentioned optional parameters, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Sample Request Payload
- Sample Response Payload
{
"profile_id": 109XXX,
"link_title": "AK-Test Title",
"cart_amount": "200",
"cart_currency": "SAR",
"shipping_required": true,
"return_url": "https://example.com/order/10001",
"cart_min": "100",
"cart_max": "500",
"donation_mode": true,
"discount_cards": "44444,400000",
"discount_amount": "120",
"discount_percent": "12",
"discount_title": "120 SAR discount on cards start with 44444,400000",
"opengraph": {
"status": true,
"title": "PayLink OpenGraph Title",
"desc": "PayLink OpenGraph Description",
"type": "testtype",
"filename": "thumbnail.png",
"img": "iVBORw0KGgoAAAANCYII="
}
}
{
"link_id": 147XXX,
"profile_id": 109XXX,
"link_url": "https://secure.paytabs.com/payment/link/109XXX/1474XX7",
"link_title": "AK-Test Title",
"cart_currency": "SAR",
"cart_amount": "0",
"cart_min": "100",
"cart_max": "500",
"return_url": "https://example.com/order/10001",
"shipping_required": true,
"link_status": true,
"donation_mode": true,
"created_at": "2024-10-02T14:09:22Z",
"updated_at": "2024-10-02T14:09:22Z"
"opengraph":
{
"status": true,
"title": "PayLink OpenGraph Title",
"desc": "PayLink OpenGraph Description",
"imgPath": "paylink/1804/47122/82045/opengraph.png",
"imgExt": "png",
"imgW": 640,
"imgH": 640,
"type": "website"
}
}
}
The Payment Page Experienceβ
Reaching this point, you are now able to initiate a PayLinke API request and as you now, the process involves several key steps that ensure a smooth payment and tracking experience for both you and customers. Hereβs how it works:
- Initiating the Request: Once you initiate a payment request, you will receive a response that includes a link URL. This URL is crucial for guiding your customer through the payment process.
"link_url": "https://secure.paytabs.com/payment/link/109XXX/1474XX7",
In the meantime, your PayLink would be already created on your dashboard, which you can access from your merchant dashboard.
- Redirecting the Customer: You should redirect your customer to this URL as you normally would in a payment transaction. This step allows the customer to complete their payment securely and efficiently. Below are the resulted payment page that your customer will be redirected to:
- Tracking in the Merchant Dashboard: After the payment is completed, the transaction will be displayed in your Merchant Dashboard. You can view the details of it in the transaction view.
This process ensures that you have full visibility and control over your split payouts, from initiating the transaction to tracking its completion in the dashboard.