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​

Parameter
shipping_details
DescriptionIndicates the customer shipping details for this payment. If provided, the payment page will be prefilled with the provided data..
Data TypeObject
Required✘
Sample
{
"shipping_details": {
"name": "first last",
"email": "[email protected]",
"phone": "0522222222",
"street1": "address street",
"city": "dubai",
"state": "du",
"country": "AE",
"zip": "12345"
}
}
shipping_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✔


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": "[email protected]",
"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.com/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

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.