Response: Merchant ID (merchant_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 merchant_id
parameter, a key component designed to uniquely identify each merchant within the payment system. This parameter assures you that all transactions are correctly attributed to the respective merchant, facilitating seamless and efficient payment processing.
By understanding the key parameters such as merchant_id
,profile_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?​
Receiving themerchant_id
parameter can provide a more organized and efficient transaction management experience, benefiting both your business operations and customer satisfaction.- Accurate Merchant Identification: Ensures that each transaction is correctly attributed to the respective merchant, reducing the risk of errors and misattributions.
- Enhanced Security: By uniquely identifying each merchant, the
merchant_id
parameter helps in preventing fraudulent-activities/unauthorized-transactions IPNs/Callbacks. - Improved Reporting: Facilitates detailed and accurate reporting by linking transactions to specific merchants, aiding in better financial analysis and decision-making.
- Better Customer Support: Enables quicker resolution of issues by providing a clear reference to the merchant involved in each transaction, improving the overall customer support experience.
When Will You Receive This Parameter?​
Understanding the specific scenarios in which themerchant_id
parameter is included in the response payload can help you effectively utilize it in your transaction response handling.- Initiation Transactions Response: As clarified in any of the integration manuals in Step 3 - initiating the payment, the
merchant_id
parameter is included in the response payload when a transaction is initiated, ensuring that the transaction is correctly attributed to the respective merchant from the start. - Transactions Callback: As clarified in any of the integration manuals in Step 6 - Handle post-payment response, and within the
callback
manual as well, during transaction callbacks, themerchant_id
parameter is provided to reference the merchant involved in the transaction, facilitating real-time updates and tracking. - Transactions IPNs: As clarified in any of the integration manuals in Step 6 - Handle post-payment response, In Instant Payment Notifications (IPN), the
merchant_id
parameter is included to ensure that the notification is correctly linked to the merchant, aiding in automated transaction processing. - Follow-Up Transaction Endpoints: Also, as clarified in any of the integration manuals in Step 7 - Manage Transactions, When performing action on a transaction such as
void
,capture
, or even query a transaction details via the API, themerchant_id
parameter will be included in the response to provide a clear reference to the merchant associated with the transaction.
How it Works?​
In order for you to understand more how theprevious_tran_ref
parameter could benefit you, you kindly need to check the below simple steps:- Initiation Transactions Response
- Transaction Callback
- Transaction IPN
- Follow-Up Transaction Endpoints
- Within the initiation the request payload of the payment page/link in Step 3 - Initiating the payment, via any of the supported integration types, you will pass the normal request with all the parameters that fits your business needs.
- Once you post your request, you will receive a response that includes so many information such as the
tran_ref
, and either a redirect URL, or other link URL (depending on the integration type used), along with themerchant_id
as shown below:You Should KnowTo know more about how you can receive this parameter, and what are the different ways you can receive this parameter with, you may need to check ourWhat are the Five (5) ways of receiving transaction response?{
.
.
"merchant_id":11567
.
.
} - Finally you will need navigate/redirect your customer to the the previous mentioned link as this is crucial for your customer to proceed through the payment process. You may need to check his customer experience after in the "Expected Payment Flow Behavior" section related to your integration type.
- Within the initiation the request payload of the payment page/link in Step 3 - Initiating the payment, via any of the supported integration types, you will use the optional parameter
callback
within the main request payload itself with your webhook endpoint on your side (the URL which you will receive the server-to-server notification).{
.
.
"callback": "https://webhook.site/80XXXX07-ea81-XXXX-b44e-0332XXXXa60b"
.
.
} - Once you post your request, you will receive a response that includes so many information such as the
tran_ref
, and either a redirect URL, or other link URL (depending on the integration type used), along with themerchant_id
parameter as shown below:You Should KnowTo know more about how you can receive this parameter, and what are the different ways you can receive this parameter with, you may need to check ourWhat are the Five (5) ways of receiving transaction response?{
.
.
"redirect_url": "https://secure.paytabs.com/payment/page/59945B6B********************B4818688"
.
.
"merchant_id":11567
.
.
} - Then, you will need navigate/redirect your customer to the the previous mentioned link as this is crucial for your customer to proceed through the payment process. You may need to check his customer experience after in the "Expected Payment Flow Behavior" section related to your integration type.
- Once your customer proceeds with the payment to the end whether it's canceled, rejected, or authenticated, you will receive a server-to-server notification that include the
merchant_id
parameter, as shown below:You Should KnowTo know more about how you can receive this parameter, and what are the different ways you can receive this parameter with, you may need to check ourWhat are the Five (5) ways of receiving transaction response?{
"tran_ref": "TST22********159",
.
.
"merchant_id":11567
.
.
}
- In this scenario case, you will need to configure an IPN first to receive any post payment notifications.You Should KnowTo know more about how you may configure an IPN and how use it, you may need to check ourHow to configure Instant Payment notification (IPN)? solution article.
- Then, within the initiation the request payload of the payment page/link in Step 3 - Initiating the payment, via any of the supported integration types, you will pass the normal request with all the parameters that fits your business needs.
- Once you post your request, you will receive a response that includes so many information such as the
tran_ref
, and either a redirect URL, or other link URL (depending on the integration type used), along with themerchant_id
parameter as shown below:You Should KnowTo know more about how you can receive this parameter, and what are the different ways you can receive this parameter with, you may need to check ourWhat are the Five (5) ways of receiving transaction response?{
.
.
"redirect_url": "https://secure.paytabs.com/payment/page/59945B6B********************B4818688"
.
.
"merchant_id":11567
.
.
} - Then, you will need navigate/redirect your customer to the the previous mentioned link as this is crucial for your customer to proceed through the payment process. You may need to check his customer experience after in the "Expected Payment Flow Behavior" section related to your integration type.
- Once your customer proceeds with the payment to the end whether it's canceled, rejected, or authenticated, you will receive a server-to-server notification that include the
merchant_id
parameter, as shown below:You Should KnowTo know more about how you can receive this parameter, and what are the different ways you can receive this parameter with, you may need to check ourWhat are the Five (5) ways of receiving transaction response?{
"tran_ref": "TST22********159",
.
.
"merchant_id":11567
.
.
}
- Within the initiation of the request payload for the release follow-up transaction or what we call in Step 7, managing your transactions, you will pass the
tran_ref
parameter with the desired transaction reference.{
.
.
"tran_ref": "TST22********159",
.
.
} - Once you post your request, you will receive a response that includes so many information such as the
tran_ref
, along with themerchant_id
parameter as shown below:You Should KnowTo know more about how you can receive this parameter, and what are the different ways you can receive this parameter with, you may need to check ourWhat are the Five (5) ways of receiving transaction response?{
"tran_ref": "TST22********159",
.
.
"merchant_id":11567
.
.
}
Parameter Specifications​
merchant_id
No parameters found for manualhpp
with filtermerchant_id
.
Request & Response Payloads Samples​
- Hosted Payment Page
The below sample request payload will show you how the above-mentioned parameter works with full code sample, along with the response payload received.
- Request Sample Payload
- Response Sample Payload
{
"profileId": 79010,
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "merchant_id code sample Transaction",
"cart_currency": "SAR",
"cart_amount": 10,
"cart_description": "Description of the items/services",
}
{
"tran_ref": "TST2430601944067",
"previous_tran_ref": "TST2430601944066",
"tran_type": "capture",
"cart_id": "merchant_id code sample Transaction",
"cart_description": "Description of the items/services",
"cart_currency": "SAR",
"cart_amount": "10.00",
"tran_currency": "SAR",
"tran_total": "10.00",
"customer_details": {
"name": "Technical Support Operations",
"email": "[email protected]",
"street1": "Address",
"city": "Riyadh",
"state": "Riyadh",
"country": "SA",
},
"payment_result": {
"response_status": "A",
"response_code": "G81709",
"response_message": "Authorised",
"transaction_time": "2024-11-01T17:21:49Z"
},
"payment_info": {
"payment_method": "Visa",
"card_type": "Credit",
"card_scheme": "Visa",
"payment_description": "4111 11## #### 1111",
"expiryMonth": 12,
"expiryYear": 2025
},
"serviceId": 1,
"profileId": 79010,
"merchantId": 28882,
"trace": "PMNT0***.672***2D.00***81F"
}
Expected Payment Flow Behavior​
This parameter behaving the same regardless of the integration type you are using.
- All Integration Types
- As mentioned above in the How it works? section, As a merchant you would receive a payment response in one of the above When Will You Receive This Parameter?, same as the sample codes mentioned in the samples section above.
- Once you post your request, you will receive a response that includes so many information such as the
tran_ref
, and either a redirect URL, or other link URL (depending on the integration type used), along with themerchant_id
parameter as shown below:You Should KnowTo know more about how you can receive this parameter, and what are the different ways you can receive this parameter with, you may need to check ourWhat are the Five (5) ways of receiving transaction response?{
.
.
"redirect_url": "https://secure.paytabs.com/payment/page/59945B6B********************B4818688"
.
.
"merchant_id":11567
.
.
} - 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
- Once your customer proceeds with the payment to the end whether it's canceled, rejected, or authenticated, you will receive a server-to-server notification (if configured) that include the
merchant_id
parameter, as shown below:{
"tran_ref": "TST22********159",
.
.
"merchant_id":11567
.
.
} - 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.