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 Hide shipping (hide_shipping) parameter. The Shipping Details indicate the shipping details for this payment. If hide shipping is 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 | hide_shipping |
JSON Example | { "hide_shipping": true } |
Data Type | Boolean |
Required | ❌ |
Validation Rules |
|
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 "hide_shipping" 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", "customer_details": { "name": "first last", "email": "email@domain.com", "phone": "0522222222", "street1": "address street", "city": "cc", "state": "DU", "country": "AE", "zip": "12345" }, "shipping_details": { "name": "name1 last1", "email": "email@domain.com", "phone": "971555555555", "street1": "street2", "city": "dubai", "state": "DU", "country": "AE", "zip": "54321" }, "hide_shipping": true }
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@domain.com", "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 and the billing/customer details the Pay Page will not ask the customer/cardholder to fill in any details as shown below:
The expected behaviors according to the passed value are:
Passing invalid values or missing parameters within the shipping details.
The shipping details will totally ignored and the customer will not be asked to pass any valid shipping information.
Passing invalid values or missing parameters within the billing/shipping details.
In this case, the customer will be asked to fill in the missed details and pass the valid details as shown below: