Paytabs provides you with a collection of API endpoints which used to process all payments, regardless of if they are through either your own payment pages, the managed payment pages, or if you are using the hosted payment pages.
This article is dedicated to the clarification of the Shipping Details parameter. The Shipping Details indicate the shipping details for this payment. If provided, the payment page will be prefilled with the provided data.
In this article, you will be going to know:
Specifications
The Parameter Tag/Name | shipping_details |
JSON Example | { "shipping_details": { "name": "first last", "email": "[email protected]", "phone": "0522222222", "street1": "address street", "city": "dubai", "state": "du", "country": "AE", "zip": "12345" } } |
Data Type | Object |
Required | ❌ |
Validation Rules |
|
Shipping Details Object parameters:
Parameter | Data Type | Min | Max | Required |
shipping_details.name | STRING | 4 | 128 | ❌ |
shipping_details.email | STRING | Valid email format | ❌ | |
shipping_details.phone | STRING | Valid number + country code prefix | ❌ | |
shipping_details.street1 | STRING | 4 | 128 | ❌ |
shipping_details.city | STRING | 2 | 128 | ❌ |
shipping_details.state | STRING | 2 | 2 | ❌ |
shipping_details.country | STRING | ISO 3166-1 alpha-2 codes (two-letter country codes) | ❌ | |
shipping_details.zip | STRING | Valid zip code | ❌ |
Usage Workflow
Along with the required parameters mentioned in our Step 3 - PT2 API Endpoints | Initiating the payment solution article, you will need to set the shipping details as shown below:
Sample Request Payload
{ "profile_id": "987654", "tran_type": "sale", "tran_class": "ecom", "cart_id": "CART#1001", "cart_currency": "USD", "cart_amount": 500, "cart_description": "Description of the items/services", "shipping_details": { "name": "first last", "email": "[email protected]", "phone": "0522222222", "street1": "address street", "city": "dubai", "state": "du", "country": "AE", "zip": "12345" } }
Sample Response Payload
{
"tran_ref": "TST2231101374414",
"tran_type": "Sale",
"cart_id": "CART#1001",
"cart_description": "Description of the items/services",
"cart_currency": "USD",
"cart_amount": "500.00",
"return": "https://example.com/order/10001",
"redirect_url": "https://secure-egypt.paytabs.com/payment/page/59***ED7",
"shipping_details": {
"name": "first last",
"email": "[email protected]",
"phone": "0522222222",
"street1": "address street",
"city": "dubai",
"state": "du",
"country": "AE",
"zip": "12345",
"ip":"1.1.1.1"
}
"serviceId": 2,
"profileId": 987654,
"merchantId": 123456,
"trace": "PMNT0404.6368BC3D.000BAF4C"
}
The Expected Parameter Behaviors
After passing the customer Shipping Details the Pay Page will not ask the customer/cardholder to fill in any shipping details.
The expected behaviors according to the passed value are:
Passing invalid values or missing parameters
In case any of the details are missing or passed with invalid values; these details will be ignored and the cardholder will be required to enter any of the missing details on the payment page as shown below:
The customer can check the "Same as Billing details" to clone the Billing info to the shipping info form, if there is exist shipping info a alret will display to the customer to confirm the Overrides of the current Shipping info. as shown below: