Skip to main content

Customer Details (customer_details)

Warning

This parameter ONLY working with those integration types (Hosted Payment Page, Invoices(Payment Endpoint), PayLinks).

The customer_details is one of the optional parameters that you can use while initiating a hosted payment page. It allows merchants to prefill the payment page with customer information, enhancing the user experience by reducing the amount of data entry required at checkout.

However, the customer/billing details are mandatory; if you don't provide them or provide invalid details, the PayTabs payment page will ask the customer to fill out those details.

You can manage the customer details, for more details please check the following information:

info
Digital Product Mode: This mode is available through the dashboard only, but affect the payment page, means that when you activate it from the dashboard, the customer billing data will be no more mandatory except email and name even if you initiate the payment page from the APIs, check how to activate hereDigital Product
info
Hide Billing/Shipping: Hide Billing/shipping feature is also available in different integration methods, kindly check hereHow to remove/hide the billing/shipping information?

How this parameter could benefit you?​

Here are some scenarios to help you understand when to use the customer_detailsparameter:

  • Digital Products: If you’re selling items like software, e-books, or online courses that don’t require all customer details like address you can use this feature then you can provide one the customer name and email.

  • Prevent fraud transaction: Providing the customer valid details prevent you from fraud transactions.

  • Cardholder reference: A useful details reference to the cardholder/customer who made the payment



How to Use?​

In order for you to start use the customer_details feature, you kindly need to follow the below simple steps:

  • Within the initiation of the request payload of the payment page/link in Step 3 via any of the supported integration types by this feature, you will use the optional parameter customer_details within the main request payload itself as shown below:

    {    
    .
    .
    "customer_details": {
    "name": "Technical Support",
    "email": "[email protected]",
    "phone": "+966 55 xxxxxx6",
    "street1": "address street",
    "city": "Jeddah",
    "state": "Makkah",
    "country": "SA",
    "ip": "86.111.XXX.X"
    },
    .
    .
    }

  • Once you post your request, you will receive a response that includes redirect URL like the following:

    "redirect_url": "https://secure.paytabs.com/payment/page/599458B182E5B6B********************B4818688",

  • Next, you should redirect your customer to this URL so that he can fulfill the payment successfully. You may need to check his customer experience after in the coming Expected Payment Flow Behavior.


Parameter Specifications​

  • customer_details

    Parameter
    customer_details
    DescriptionIndicates the customer details for this payment. If provided, the payment page will be prefilled with the provided data.
    To know more about this parameter please click here.
    Data TypeObject
    Required✘
    Sample
    {
    "customer_details": {
    "name": "first last",
    "email": "[email protected]",
    "phone": "0522222222",
    "street1": "address street",
    "city": "dubai",
    "state": "du",
    "country": "AE",
    "zip": "12345"
    }
    }
    customer_details's Nested Parameters
    Nested ParameterData TypeMinMaxRequired
    name
    STRING3128βœ”
    email
    STRINGN/AN/Aβœ”
    phone
    STRINGN/AN/Aβœ”
    street1
    STRING3128βœ”
    city
    STRING3128βœ”
    state
    STRING22βœ”
    country
    STRINGN/AN/Aβœ”
    zip
    STRINGN/AN/Aβœ”



Request & Response Payloads Samples​

The below sample request payload will show you how you can pass the above-mentioned required parameter/s, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.

{
"profile_id": {{profile_id}},
"tran_type": "sale",
"tran_class": "ecom",
"cart_description": "Description of the items/services",
"cart_id": "Unique order reference00",
"cart_amount": 25000.2,
"cart_currency": "SAR",

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


}


Expected Payment Flow Behavior​

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


  2. 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",

  3. Next, you should embed this url inside your checkout page directly using the needed mark up tags

  4. After this, your customer would proceed normally with payment by providing his card information, and he will be able to do that withing your story as you can see below:

    Alt text

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

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