Skip to main content

Request/Response: shipping Details (shipping_details)

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


Why You Should Use This Parameter

This is one of the optional parameter that you can use in the Hosted Payment Page and Invoices integration types so that your shipping does not have to fill it himself. Additionally, this object is required to passed in both Own Form and Managed Form integration types.



Parameter Specifications

Parametershipping_details
Data TypeObject
Description
Indicates the customer shipping details for this payment. If provided, the payment page will be prefilled with the provided data..
Required
Sample
{
"shipping_details": {
"name": "first last",
"email": "demo@paytabs.com",
"phone": "0522222222",
"street1": "address street",
"city": "dubai",
"state": "du",
"country": "AE",
"zip": "12345"
}
}
Object Nested Parameters
Parameter
Data Type
Required
Min
Max
name
STRING
3
128
email
STRING
Valid email format
phone
STRING
Valid number + country code prefix
street1
STRING
3
128
city
STRING
3
128
state
STRING
2
2
country
STRING
ISO 3166-1 alpha-2 codes (two-letter country codes)
zip
STRING
Valid zip code


Sample Request & Response Payloads

Click to view the full Request Payload!
{
"profile_id": "987###",
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "CART#1001",
"cart_currency": "SAR",
"cart_amount": 500,
"cart_description": "Description of the items/services",

"shipping_details": {
"name": "first last",
"email": "demo@paytabs.com",
"phone": "+966 000000",
"street1": "address street",
"city": "ryad",
"state": "rd",
"country": "SA",
"zip": "12345"
}
}
Click to view the full Response Payload!
{
"tran_ref": "TST22********159",
"tran_type": "Sale",
"cart_id": "CART#1001",
"cart_description": "Description of the items/services",
"cart_currency": "SAR",
"cart_amount": "500.00",
"return": "none",
"redirect_url": "https://secure.paytabs.sa/payment/page/599458B182E5B6B********************B4817FD44318539688688",
"serviceId": 2,
"profileId": 987###,
"merchantId": 1*****7,
"trace": "PMN****4.63****A8.00****C4"
}


Expected behavior

  1. You will initiate a payment request using the guide mentioned here

  2. You will use the "shipping_details" parameter according to the above Specifications

  3. Then you will receive the response payload containing the "redirect_url" meaning you have initiated a correct payment request.

  4. Finally, you should redirect your shipping to this URL so the payment process can be finalized, and the shipping will not be required to fill his shipping details as shown below:

Sample Payment Page with shipping details