Request/Response: Profile ID (profile_id)
This parameter behaving the same regardless of the integration type you are using.
In the evolving landscape of online payments, accurate identification and management of merchant accounts are crucial. PayTabs introduces the profile_id
parameter, one of the required/must parameters & a key component designed to uniquely identify each merchant's profile within the payment system. This parameter assures you that all transactions are correctly attributed to the respective profile, facilitating seamless and efficient payment processing.
By leveraging the profile_id
parameter, businesses can manage multiple payment profiles, each with specific settings and preferences. This flexibility enables merchants to cater to diverse customer needs, providing a seamless and customized payment experience.
By understanding the key parameters such as profile_id
, merchant_id
, and tran_ref
, businesses can effectively integrate this feature to streamline their transaction workflows and enhance the overall payment experience.
How this parameter could benefit you?β
Theprofile_id
parameter offers significant advantages for merchants managing multiple profiles. Hereβs how it can benefit you:- Enhanced Customization: With the ability to create multiple profiles, you can tailor payment settings to specific customer segments or transaction types. This ensures that each payment experience is optimized for the user's needs.
- Enhanced Security: By assigning unique
profile_id
's to different payment scenarios, you can implement specific security measures for each profile. This reduces the risk of fraud and enhances the overall security of your transactions against fraudulent-activities/unauthorized-transactions IPNs/Callbacks. - Flexibility in Payment Options: Different profiles can be configured with various payment options and preferences, providing flexibility to accommodate diverse customer preferences and business requirements.
- Improved Reporting: Facilitates detailed and accurate reporting by linking transactions to specific merchant's profile, aiding in better financial analysis and decision-making.
- Better Customer Support: Enables quicker resolution of issues by providing a clear reference to the merchant's profile involved in each transaction, improving the overall customer support experience.
Name but a few different Businesses/Industries that can benefit from this API parameter:
- E-commerce Platforms: Online retailers can create multiple profiles to manage different product categories, seasonal promotions, or regional pricing strategies, enhancing the shopping experience for their customers.
- Non-Profits Organizations: Charities and non-profits can create profiles for various fundraising campaigns, events, and donation drives, making it easier to manage and track contributions.
- Educational Institutions: Schools and universities can use multiple profiles to handle payments for tuition, extracurricular activities, and other fees, providing a seamless payment experience for students and parents.
- Travel and Hospitality: Travel agencies and hotels can create profiles for different types of bookings, such as flights, accommodations, and packages, allowing for tailored payment options and streamlined management.
- Event Management Companies: Event organizers can use different profiles for ticket sales, sponsorships, and merchandise, ensuring a smooth and organized payment process for each aspect of their events.
- Healthcare Providers: Clinics and hospitals can manage profiles for different departments or services, such as consultations, treatments, and diagnostics, ensuring secure and efficient payment processing.
- Subscription Services: Businesses offering subscription-based services can use different profiles to handle various subscription tiers, billing cycles, and promotional offers, ensuring a smooth and personalized user experience.
- Educational Institutions: Schools and universities can use this for flexible tuition payments, where students or parents can pay an amount within a specified range based on their financial situation.
Limitationsβ
- Mandatory Inclusion: This parameter must be included in every payment creation request. Omitting this parameter will result in the failure of the request.
- Duplicate Request Error: If the same details (
cart_id
,cart_amount
,cart_currency
,profile_id
) are duplicated within less than 2 minutes, it will cause a duplicate request error. This is a safeguard to prevent accidental double charges or duplicate transactions.
How to Use?β
In order for you to start use theprofile_id
parameter, you kindly need to follow the below simple steps:- Within the initiation of the request payload of the payment page as mentioned in Step 3 via regardless the integration types, you will MUST use the mandatory parameter
profile_id
within the main request payload itself as shown below. You need also to ensure that all required parameters are included and correctly formatted.{
...
"profile_id": "9***4",
....
} - Once you post your request, you will receive a response that includes the
profile_id
as well:WarningOnly in "Invoices" integration type (via the invoice endpoint), you will NOT receive the
profile_id
in the response, as mentioned in theInvoices - Step 3 | Initiate the payment manual.{
...
"profile_id": "9***4",
....
} - Depending on the integration type and the request, not within all the payments life cycle, you will will need to redirect the customer to the payment page or any other external links for either authenticate the cardholder via the 3D Secure or other needed actions.
You may need to check his customer experience after in the coming Expected Payment Flow Behavior.
Parameter Specificationsβ
-
profile_id
Parameter profile_id
Description The merchant Profile ID you can get from your PayTabs dashboard. For more information please check our How to get your account information from PT2 Dashboard? solution article. To know more about this parameter please click here. Data Type INT Required β Validation Rules Accept only valid profile number. Sample {
"profile_id": 987654
}
Request & Response Payloads Samplesβ
- Hosted Payment Page
- Invoices
- PayLinks
- ManagedForm
- Own Form
The below sample request payload will show you how you can pass the above-mentioned required parameter, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Request Sample Payload
- Response Sample Payload
{
"profile_id": "79010",
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "cart_1",
"cart_currency": "SAR",
"cart_amount": 12.3,
"cart_description": "Description of the items/services",
"paypage_lang": "en",
"customer_details": {
"name": "FirstName LastName",
"email": "[email protected]",
"phone": "9771555555555",
"street1": "street2",
"city": "dubai",
"state": "dubai",
"country": "AE",
"zip": "54321"
},
"shipping_details": {
"name": "FirstName LastName",
"email": "[email protected]",
"phone": "971555555555",
"street1": "street2",
"city": "dubai",
"state": "dubai",
"country": "AE",
"zip": "54321"
}
}
{
"tran_ref": "TST22********159",
"tran_type": "sale",
"cart_id": "cart_1",
"cart_description": "Description of the items/services",
"cart_currency": "SAR",
"cart_amount": "12.30",
"tran_total": "0",
"return": "none",
"redirect_url": "https://secure.paytabs.com/payment/wr/5DBXXX4F5BB9C2EXXXX8249E75E3D4D8C84",
"customer_details": {
"name": "FirstName LastName",
"email": "[email protected]",
"phone": "971555555555",
"street1": "street2",
"city": "dubai",
"state": "dubai",
"country": "AE",
"zip": "54321"
},
"shipping_details": {
"name": "FirstName LastName",
"email": "[email protected]",
"phone": "971555555555",
"street1": "street2",
"city": "dubai",
"state": "dubai",
"country": "AE",
"zip": "54321"
},
"serviceId": 2,
"profileId": "79010",
"merchantId": 43796,
"trace": "PMN****4.63****A8.00****C4"
}
The below sample request payload will show you how you can pass the above-mentioned required parameter, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
Only in "Invoices" integration type (via the invoice endpoint), you will NOT receive the profile_id
in the response, as mentioned in theInvoices - Step 3 | Initiate the payment manual.
- Request Sample Payload
- Response Sample Payload
{
"profile_id": "79010",
"tran_type": "sale",
"tran_class": "ecom",
"cart_description": "Description of the items/services",
"cart_id": "Unique order reference00",
"cart_amount": 200,
"cart_currency": "SAR",
"invoice": {
"line_items": [
{
"unit_cost": 100,
"quantity":2
}
]
}
}
{
"tran_ref": "TST22********159",
"tran_type": "Sale",
"cart_id": "Unique order reference00",
"cart_description": "Description of the items/services",
"cart_currency": "SAR",
"cart_amount": "200.00",
"tran_total": "0",
"return": "none",
"redirect_url": "https://secure.paytabs.com/payment/wr/5DB410*******9762FE9DBA2",
"invoice": {
"id": 3123814,
"shipping_charges": "0",
"extra_charges": "0",
"extra_discount": "0",
"total": "200",
"activation_date": 0,
"expiry_date": 0,
"due_date": 0,
"issue_date": 1732761054,
"line_items": [
{
"unit_cost": "100",
"quantity": "2",
"net_total": "200",
"discount_rate": "0",
"discount_amount": "0",
"tax_rate": "0",
"tax_total": "0",
"total": "200"
}
]
},
"serviceId": 2,
"profileId": "79010",
"merchantId": 28882,
"trace": "PMN****4.63****A8.00****C4"
}
The below sample request payload will show you how you can pass the above-mentioned required parameter, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Request Sample Payload
- Response Sample Payload
{
"profile_id": "79010",
"link_title": "AK-Test Title",
"cart_amount": "400",
"cart_currency": "SAR"
}
{
"link_id": "147XXX",
"profile_id": "79010",
"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 required parameter, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Request Sample Payload
- Response Sample Payload
{
"profile_id": "79010",
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "CART#1001",
"cart_currency": "SAR",
"cart_amount": 9.5,
"cart_description": "Description of the items/services",
"customer_details":
{
"name": "FirstName LastName",
"email": "[email protected]",
"phone": "971555555555",
"street1": "street2",
"city": "dubai",
"state": "dubai",
"country": "AE",
"zip": "54321"
},
"payment_token": "Dh4r8Jw*******zKgtk"
}
{
"tran_ref": "TST22********159",
"tran_type": "Sale",
"cart_id": "CART#1001",
"cart_description": "Description of the items/services",
"cart_currency": "SAR",
"cart_amount": "9.5",
"return": "none",
"redirect_url": "https://secure.paytabs.com/payment/page/599458B182E5B6B********************B4817FD44318539688688",
"serviceId": 2,
"profileId": "79010",
"merchantId": 28882,
"trace": "PMN****4.63****A8.00****C4"
}
The below sample request payload will show you how you can pass the above-mentioned required parameter, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Request Sample Payload
- Response Sample Payload
{
"profile_id": "9xxx4",
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "CART#1001",
"cart_currency": "SAR",
"cart_amount": 9.5,
"cart_description": "Description of the items/services",
"customer_details":
{
"name": "Technical Support Team",
"email": "[email protected]",
"phone": "+201234567890",
"street1": "address street",
"city": "Cairo",
"state": "CAI",
"country": "EG",
"zip": "45555",
"ip": "1.1.1.1"
},
"card_details": {
"pan": "4111111111111111",
"cvv": "123",
"expiry_month": 12,
"expiry_year": 2023
}
}
{
"tran_ref": "TST22********159",
"tran_type": "Sale",
"cart_id": "CART#1001",
"cart_description": "Description of the items/services",
"cart_currency": "SAR",
"cart_amount": "9.5",
"return": "none",
"redirect_url": "https://secure.paytabs.com/payment/page/599458B182E5B6B********************B4817FD44318539688688",
"customer_details":
{
"name": "Technical Support Team",
"email": "[email protected]",
"phone": "+201234567890",
"street1": "address street",
"city": "Cairo",
"state": "CAI",
"country": "EG",
"zip": "45555",
"ip": "1.1.1.1"
},
"serviceId": 2,
"profileId": "79010",
"merchantId": 28882,
"trace": "PMN****4.63****A8.00****C4"
}
Expected Payment Flow Behaviorβ
- Hosted Payment Page
- Invoices
- PayLinks
- Managed Form
- Own Form
- As mentioned above in the How to use? section, As a merchant you would initiate a payment request per the above Specifications, same as the sample codes mentioned in the samples section above.
- Then, you will receive a response that includes the same
profile_id
you passed in the request payload, along with the redirect URL. This means you have initiated a correct payment request/page successfully.{
"profile_id": "79010",
.
.
"redirect_url": "https://secure.paytabs.com/payment/page/52E5B6B*************B4818688",
.
.
} - Next, you should redirect your customer to this URL so the payment process can be finalized.
- After this, your customer would proceed normally with payment by choosing the preferred payment method (if available), and providing his card information.
- Then, he will be redirected to his issuer bank 3DS/OTP page to authenticate the used card
- Finally, he would be redirect to a success/error page accordingly. By this time, you will be able to see his transaction on your merchant dashboard, whether it's accepted/authorized or not.
- As mentioned above in the How to use? section, As a merchant you would initiate a payment request per the above Specifications, same as the sample codes mentioned in the samples section above.
- Then, you will receive a response that includes the same
profile_id
you passed in the request payload, along with the redirect URL. This means you have initiated a correct payment request/page successfully.WarningOnly in "Invoices" integration type (via the invoice endpoint), you will NOT receive the
profile_id
in the response, as mentioned in theInvoices - Step 3 | Initiate the payment manual."redirect_url": "https://secure.paytabs.com/payment/page/5995B6B*************B4818688",
- In the meantime, your invoice would be already created on your dashboard, which you can access from your merchant dashboard.
- After this, your customer would proceed normally with payment by providing his card information.
- Then, he will be redirected to his issuer bank 3DS/OTP page to authenticate the used card
- Finally, he would be redirect to a success/error page accordingly. By this time, you will be able to see his transaction on your merchant dashboard, whether it's accepted/authorized or not. Only successful payments will be connected to the invoice itself in the invoice record.
- As mentioned above in the How to use? section, As a merchant you would initiate a payment request per the above Specifications, same as the sample codes mentioned in the samples section above.
- Then, you will receive a response that includes link URL. This means you have initiated a correct PayLink page successfully.
"link_url": "https://secure.paytabs.com/payment/link/109430/1474XX7",
- In the meantime, your PayLink would be already created on your dashboard, which you can access from your merchant dashboard.
- Next, you should redirect your customer to this URL so the payment process can be finalized.
- After this, your customer would proceed normally with payment by choosing the preferred payment method (if available), and providing his card information.
- Then, he will be redirected to his issuer bank 3DS/OTP page to authenticate the used card
- Finally, he would be redirect to a success/error page accordingly. By this time, you will be able to see his transaction on your merchant dashboard, whether it's accepted/authorized or not.
image
- As mentioned above in the How to use? section, as a merchant you would initiate a payment request per the above Specifications, same as the sample codes mentioned in the samples section above.
- Then, you will receive a response that includes redirect URL. This means you have initiated a correct payment request/page successfully.
"redirect_url": "https://secure.paytabs.com/payment/page/599458B182E5B6B********************B4818688",
- Then, your customer will be redirected to his issuer bank 3DS/OTP page to authenticate the used card
- Finally, he would be redirect to a success/error page accordingly. And now, you will be able to see his transaction on your merchant dashboard, whether it's accepted/authorized or not.
- As mentioned above in the How to use? section, as a merchant you would initiate a payment request per the above Specifications, same as the sample codes mentioned in the samples section above.
- Then, you will receive a response that includes redirect URL. This means you have initiated a correct payment request/page successfully.
"redirect_url": "https://secure.paytabs.com/payment/page/599458B182E5B6B********************B4818688",
- Then, your customer will be redirected to his issuer bank 3DS/OTP page to authenticate the used card
- Finally, he would be redirect to a success/error page accordingly. And now, you will be able to see his transaction on your merchant dashboard, whether it's accepted/authorized or not.