Skip to main content

Response: Merchant ID (merchant_id)

Be Aware Of

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 the merchant_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 the merchant_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 thecallback manual as well, during transaction callbacks, the merchant_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, the merchant_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 the previous_tran_ref parameter could benefit you, you kindly need to check the below simple steps:

  1. 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.

  2. 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 the merchant_id as shown below:

    You Should Know
    To 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
    .
    .
    }

  3. 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.

Parameter Specifications​

  • merchant_id

    No parameters found for manual hpp with filter merchant_id.

Request & Response Payloads Samples​

The below sample request payload will show you how the above-mentioned parameter works with full code sample, along with the response payload received.

{
"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",
}


Expected Payment Flow Behavior​

Be Aware Of

This parameter behaving the same regardless of the integration type you are using.

  1. 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.

  2. 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 the merchant_id parameter as shown below:

    You Should Know
    To 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
    .
    .
    }

  3. Next, you should redirect your customer to this URL so the payment process can be finalized.

  4. After this, your customer would proceed normally with payment by choosing the preferred payment method (if available), and providing his card information.

    payment page view

  5. Then, he will be redirected to his issuer bank 3DS/OTP page to authenticate the used card

  6. 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
    .
    .
    }

  7. 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.transaction view

    transaction view

We are glad to be always in help. We aim to serve you better each time. As such, please spare a minute to share feedback about your recent experience with PayTabs Developers , on Trustpilot, or Google Reviews.