Add Order
Order creation API will let you upload the order details where you can also create the multiple orders using a single request. System will not let you create an order in case of no proper validation.
Staging URL
Production URL
Parameter
| Field | Type | Description | Mandatory |
|---|---|---|---|
| data | Json | data is the package data which further categorize by keys pick location details & shipments. Refer to the request example for more clarity on usage. | Yes |
| shipments | Varchar | Order Maximum Limit 10 | Yes |
| waybill | Integer | Waybill number for the order | No |
| order | Varchar | Order number | Yes |
| sub_order | Varchar | Sub Order number | No |
| order_date | Datetime | Order creation date | Yes |
| total_amount | Float | Order total amount | Yes |
| name | Varchar | Customer Name | Yes |
| company_name | Varchar | Customer company name | No |
| add | Varchar | Customer address line-1 | Yes |
| add2 | Varchar | Customer address line-2 | No |
| add3 | Varchar | Customer address line-3 | No |
| pin | Integer | Customer pincode | Yes |
| city | Varchar | Customer city | No |
| state | Varchar | Customer state | No |
| country | Varchar | Customer country | No |
| phone | Integer | Customer contact | Yes |
| alt_phone | Integer | Customer alternate contact | No |
| Varchar | Customer email | No | |
| is_billing_same_as_shipping | Varchar | No- if billing address is not same as customer address | No |
| billing_name | Varchar | Billing customer name | Yes |
| billing_company_name | Varchar | Billing company name | No |
| billing_add | Varchar | Billing address line-1 | Yes |
| billing_add2 | Varchar | Billing address line-2 | No |
| billing_add3 | Integer | Billing address line-3 | No |
| billing_pin | Varchar | Billing pincode | Yes |
| billing_city | Varchar | Billing city | No |
| billing_state | Varchar | Billing state | No |
| billing_country | Integer | Billing country | No |
| billing_phone | Integer | Billing contact | Yes |
| billing_alt_phone | Varchar | Billing alternate contact | No |
| billing_email | Varchar | Billing email | No |
| products | Json | Product Maximum Limit 40 | Yes |
| product_name | Varchar | Product name | Yes |
| product_sku | Varchar | Product SKU | No |
| product_quantity | Integer | Product quantity | Yes |
| product_price | Float | Product price | Yes |
| product_tax_rate | Float | Product tax rate value | No |
| product_hsn_code | Varchar | Product HSN code | No |
| product_discount | Float | Product discount amount | No |
| product_img_url | Varchar | Product Image Url | No |
| shipment_length | Float | Shipment length | Yes |
| shipment_width | Float | Shipment height | Yes |
| shipment_height | Float | Shipment height | Yes |
| weight | Float | Shipment weight | Yes |
| shipping_charges | Float | Shipping charges | No |
| giftwrap_charges | Float | Gift Wrap charges | No |
| transaction_charges | Float | Transaction charges | No |
| total_discount | Float | Total discount amount | No |
| first_attemp_discount | Float | First attempt discount amount | No |
| cod_charges | Float | Handling fees | No |
| advance_amount | Float | Advance paid | No |
| cod_amount | Float | No | |
| payment_mode | Varchar | cod/Prepaid (if not given then cod considered) | No |
| reseller_name | Varchar | No | |
| eway_bill_number | Varchar | No | |
| gst_number | Varchar | No | |
| what3words | Varchar | The what3words address is captured for the delivery address in the format ”word.word.word” | No |
| return_address_id | Integer | Return address Id | Yes |
| pickup_address_id | Integer | *Required Pickup Warehouse Id | Yes |
| access_token | Varchar | You will get this from IThink Logistics team. | Yes |
| secret_key | Varchar | You will get this from IThink Logistics team. | Yes |
| logistics | String | Allowed values delhivery, bluedart, xpressbees, ecom, ekart. For reverse Shipments: Delhivery, Bluedart, Xpressbees Only | No |
| order_type | Varchar | forward/reverse (default-forward) | No |
| s_type | String | If bluedart or delhivery than Allowed values air, surface. | No |
Copy { "data": { "shipments": [ { "waybill":"", "order":"GK0033", "sub_order":"A", "order_date":"31-01-2018", "total_amount":"999", "name":"Bharat", "company_name":"ABC Company", "add":"104, Shreeji Sharan", "add2":"", "add3":"", "pin":"400067", "city":"Mumbai", "state":"Maharashtra", "country":"India", "phone":"9876543210", "alt_phone":"9876543210", "email":"abc@gmail.com", "is_billing_same_as_shipping":"no", "billing_name":"Bharat", "billing_company_name":"ABC Company", "billing_add":"104,Shreeji Sharan", "billing_add2":"", "billing_add3":"", "billing_pin" :"400067", "billing_city":"Mumbai", "billing_state":"Maharashtra", "billing_country":"India", "billing_phone":"9876543210", "billing_alt_phone":"9876543210", "billing_email":"abc@gmail.com", "products":[ { "product_name" : "Green color tshirt", "product_sku" : "GC001-1", "product_quantity" : "1", "product_price" : "100", "product_tax_rate" : "5", "product_hsn_code" : "91308", "product_discount" : "0", "product_img_url" : "https://abc.com/image.jpeg", }, { "product_name" : "Red color tshirt", "product_sku" : "GC002-2", "product_quantity" : "1", "product_price" : "200", "product_tax_rate" : "5", "product_hsn_code" : "91308", "product_discount" : "0", "product_img_url" : "https://abc.com/image.jpeg", } ], "shipment_length" : "10", #in cm "shipment_width" : "10", #in cm "shipment_height" : "5", #in cm "weight" : "400", #in Kg "shipping_charges" : "0", "giftwrap_charges" : "0", "transaction_charges" : "0", "total_discount" : "0", "first_attemp_discount" : "0", "cod_charges" : "0", "advance_amount" : "0", "cod_amount" : "300", "payment_mode" : "COD", #For reverse Shipments: Prepaid Only "reseller_name" : "", "eway_bill_number" : "", "gst_number" : "", "what3words" : "", #This Parameter is currently Live for bluedart, Ecom Express And DTDC logistics only "return_address_id" : "24" "api_source" : "0" #Service source used to book orders => 1: own website, 11: Uinware, 12: easyecom "store_id" : "1" #Id of your store which is integrated in iThink, will be provided by iThink } ], "pickup_address_id" : "24", "access_token" : "8ujik47cea32ed386b1f65c85fd9aaaf", #You will get this from iThink Logistics Team "secret_key" : "65tghjmads9dbcd892ad4987jmn602a7", #You will get this from iThink Logistics Team "logistics" : "Delhivery", #Allowed values delhivery, fedex, xpressbees, ecom, ekart. For reverse Shipments: Delhivery Only "s_type" : "", #If fedex than Allowed values standard, priority, ground. "order_type" : "" #If placing reverse shipment, pass 'reverse' else can be left blank. } }
Copy { "status": success, "status_code": 200, "html_message": ' ', If any error message for order creation "data": { "1" : { "status" : "Success", "remark" : "", "waybill" : "1369010531020", "refnum" : "GK0034", "logistic_name" : "delhivery", "tracking_url" : "https://ithinklogistics.co.in/postship/tracking/1369010531020", } } }
Sample Code
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://pre-alpha.ithinklogistics.com/api_v3/order/add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"data\":{\"shipments\":[{\"waybill\":\"\",\"order\":\"GK0034\",\"sub_order\":\"\",\"order_date\":\"31-01-2018\",\"total_amount\":\"999\",\"name\":\"Bharat\",\"company_name\":\"ABC Company\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"alt_phone\":\"9876542210\",\"email\":\"abc@gmail.com\",\"is_billing_same_as_shipping\":\"no\",\"billing_name\":\"Bharat\",\"billing_company_name\":\"ABC Company\",\"billing_add\":\"104, Shreeji Sharan\",\"billing_add2\":\"\",\"billing_add3\":\"\",\"billing_pin\":\"400067\",\"billing_city\":\"Mumbai\",\"billing_state\":\"Maharashtra\",\"billing_country\":\"India\",\"billing_phone\":\"9876543210\",\"billing_alt_phone\":\"9876543211\",\"billing_email\":\"abc@gmail.com\",\"products\":[{\"product_name\":\"Green color tshirt\",\"product_sku\":\"GC001-1\",\"product_quantity\":\"1\",\"product_price\":\"100\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"},{\"product_name\":\"Red color tshirt\",\"product_sku\":\"GC002-2\",\"product_quantity\":\"1\",\"product_price\":\"200\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"}],\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"5\",\"weight\":\"400.00\",\"shipping_charges\":\"0\",\"giftwrap_charges\":\"0\",\"transaction_charges\":\"0\",\"total_discount\":\"0\",\"first_attemp_discount\":\"0\",\"cod_amount\":\"550\",\"payment_mode\":\"COD\",\"reseller_name\":\"\",\"eway_bill_number\":\"\",\"gst_number\":\"\",\"what3words\":\"\",\"return_address_id\":\"24\"}],\"pickup_address_id\":\"24\",\"access_token\":\"8ujik47cea32ed386b1f65c85fd9aaaf\",\"secret_key\":\"65tghjmads9dbcd892ad4987jmn602a7\",\"logistics\":\"fedex\",\"s_type\":\"ground\",\"order_type\":\"\"}}",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/json"
)
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
{
echo "cURL Error #:" . $err;
}
else
{
echo $response;
}
import requests
url = "https://pre-alpha.ithinklogistics.com/api_v3/order/add.json"
payload = "{\"data\":{\"shipments\":[{\"waybill\":\"\",\"order\":\"GK0034\",\"sub_order\":\"\",\"order_date\":\"31-01-2018\",\"total_amount\":\"999\",\"name\":\"Bharat\",\"company_name\":\"ABC Company\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"alt_phone\":\"9876542210\",\"email\":\"abc@gmail.com\",\"is_billing_same_as_shipping\":\"no\",\"billing_name\":\"Bharat\",\"billing_company_name\":\"ABC Company\",\"billing_add\":\"104, Shreeji Sharan\",\"billing_add2\":\"\",\"billing_add3\":\"\",\"billing_pin\":\"400067\",\"billing_city\":\"Mumbai\",\"billing_state\":\"Maharashtra\",\"billing_country\":\"India\",\"billing_phone\":\"9876543210\",\"billing_alt_phone\":\"9876543211\",\"billing_email\":\"abc@gmail.com\",\"products\":[{\"product_name\":\"Green color tshirt\",\"product_sku\":\"GC001-1\",\"product_quantity\":\"1\",\"product_price\":\"100\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"},{\"product_name\":\"Red color tshirt\",\"product_sku\":\"GC002-2\",\"product_quantity\":\"1\",\"product_price\":\"200\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"}],\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"5\",\"weight\":\"400.00\",\"shipping_charges\":\"0\",\"giftwrap_charges\":\"0\",\"transaction_charges\":\"0\",\"total_discount\":\"0\",\"first_attemp_discount\":\"0\",\"cod_amount\":\"550\",\"payment_mode\":\"COD\",\"reseller_name\":\"\",\"eway_bill_number\":\"\",\"gst_number\":\"\",\"what3words\":\"\",\"return_address_id\":\"24\"}],\"pickup_address_id\":\"24\",\"access_token\":\"8ujik47cea32ed386b1f65c85fd9aaaf\",\"secret_key\":\"65tghjmads9dbcd892ad4987jmn602a7\",\"logistics\":\"fedex\",\"s_type\":\"ground\",\"order_type\":\"\"}}"
headers =
{
'content-type': "application/json",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"shipments\":[{\"waybill\":\"\",\"order\":\"GK0034\",\"sub_order\":\"\",\"order_date\":\"31-01-2018\",\"total_amount\":\"999\",\"name\":\"Bharat\",\"company_name\":\"ABC Company\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"alt_phone\":\"9876542210\",\"email\":\"abc@gmail.com\",\"is_billing_same_as_shipping\":\"no\",\"billing_name\":\"Bharat\",\"billing_company_name\":\"ABC Company\",\"billing_add\":\"104, Shreeji Sharan\",\"billing_add2\":\"\",\"billing_add3\":\"\",\"billing_pin\":\"400067\",\"billing_city\":\"Mumbai\",\"billing_state\":\"Maharashtra\",\"billing_country\":\"India\",\"billing_phone\":\"9876543210\",\"billing_alt_phone\":\"9876543211\",\"billing_email\":\"abc@gmail.com\",\"products\":[{\"product_name\":\"Green color tshirt\",\"product_sku\":\"GC001-1\",\"product_quantity\":\"1\",\"product_price\":\"100\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"},{\"product_name\":\"Red color tshirt\",\"product_sku\":\"GC002-2\",\"product_quantity\":\"1\",\"product_price\":\"200\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"}],\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"5\",\"weight\":\"400.00\",\"shipping_charges\":\"0\",\"giftwrap_charges\":\"0\",\"transaction_charges\":\"0\",\"total_discount\":\"0\",\"first_attemp_discount\":\"0\",\"cod_amount\":\"550\",\"payment_mode\":\"COD\",\"reseller_name\":\"\",\"eway_bill_number\":\"\",\"gst_number\":\"\",\"what3words\":\"\",\"return_address_id\":\"24\"}],\"pickup_address_id\":\"24\",\"access_token\":\"8ujik47cea32ed386b1f65c85fd9aaaf\",\"secret_key\":\"65tghjmads9dbcd892ad4987jmn602a7\",\"logistics\":\"fedex\",\"s_type\":\"ground\",\"order_type\":\"\"}}");
Request request = new Request.Builder()
.url("https://pre-alpha.ithinklogistics.com/api_v3/order/add.json")
.post(body)
.addHeader("content-type", "application/json")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://pre-alpha.ithinklogistics.com/api_v3/order/add.json");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"data\":{\"shipments\":[{\"waybill\":\"\",\"order\":\"GK0034\",\"sub_order\":\"\",\"order_date\":\"31-01-2018\",\"total_amount\":\"999\",\"name\":\"Bharat\",\"company_name\":\"ABC Company\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"alt_phone\":\"9876542210\",\"email\":\"abc@gmail.com\",\"is_billing_same_as_shipping\":\"no\",\"billing_name\":\"Bharat\",\"billing_company_name\":\"ABC Company\",\"billing_add\":\"104, Shreeji Sharan\",\"billing_add2\":\"\",\"billing_add3\":\"\",\"billing_pin\":\"400067\",\"billing_city\":\"Mumbai\",\"billing_state\":\"Maharashtra\",\"billing_country\":\"India\",\"billing_phone\":\"9876543210\",\"billing_alt_phone\":\"9876543211\",\"billing_email\":\"abc@gmail.com\",\"products\":[{\"product_name\":\"Green color tshirt\",\"product_sku\":\"GC001-1\",\"product_quantity\":\"1\",\"product_price\":\"100\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"},{\"product_name\":\"Red color tshirt\",\"product_sku\":\"GC002-2\",\"product_quantity\":\"1\",\"product_price\":\"200\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"}],\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"5\",\"weight\":\"400.00\",\"shipping_charges\":\"0\",\"giftwrap_charges\":\"0\",\"transaction_charges\":\"0\",\"total_discount\":\"0\",\"first_attemp_discount\":\"0\",\"cod_amount\":\"550\",\"payment_mode\":\"COD\",\"reseller_name\":\"\",\"eway_bill_number\":\"\",\"gst_number\":\"\",\"what3words\":\"\",\"return_address_id\":\"24\"}],\"pickup_address_id\":\"24\",\"access_token\":\"8ujik47cea32ed386b1f65c85fd9aaaf\",\"secret_key\":\"65tghjmads9dbcd892ad4987jmn602a7\",\"logistics\":\"fedex\",\"s_type\":\"ground\",\"order_type\":\"\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
require 'uri'
require 'net/http'
url = URI("https://pre-alpha.ithinklogistics.com/api_v3/order/add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'
request.body = "{\"data\":{\"shipments\":[{\"waybill\":\"\",\"order\":\"GK0034\",\"sub_order\":\"\",\"order_date\":\"31-01-2018\",\"total_amount\":\"999\",\"name\":\"Bharat\",\"company_name\":\"ABC Company\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"alt_phone\":\"9876542210\",\"email\":\"abc@gmail.com\",\"is_billing_same_as_shipping\":\"no\",\"billing_name\":\"Bharat\",\"billing_company_name\":\"ABC Company\",\"billing_add\":\"104, Shreeji Sharan\",\"billing_add2\":\"\",\"billing_add3\":\"\",\"billing_pin\":\"400067\",\"billing_city\":\"Mumbai\",\"billing_state\":\"Maharashtra\",\"billing_country\":\"India\",\"billing_phone\":\"9876543210\",\"billing_alt_phone\":\"9876543211\",\"billing_email\":\"abc@gmail.com\",\"products\":[{\"product_name\":\"Green color tshirt\",\"product_sku\":\"GC001-1\",\"product_quantity\":\"1\",\"product_price\":\"100\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"},{\"product_name\":\"Red color tshirt\",\"product_sku\":\"GC002-2\",\"product_quantity\":\"1\",\"product_price\":\"200\",\"product_tax_rate\":\"5\",\"product_hsn_code\":\"91308\",\"product_discount\":\"0\",\"product_img_url\":\"http://www.abc.com/image.jpg\"}],\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"5\",\"weight\":\"400.00\",\"shipping_charges\":\"0\",\"giftwrap_charges\":\"0\",\"transaction_charges\":\"0\",\"total_discount\":\"0\",\"first_attemp_discount\":\"0\",\"cod_amount\":\"550\",\"payment_mode\":\"COD\",\"reseller_name\":\"\",\"eway_bill_number\":\"\",\"gst_number\":\"\",\"what3words\":\"\",\"return_address_id\":\"24\"}],\"pickup_address_id\":\"24\",\"access_token\":\"8ujik47cea32ed386b1f65c85fd9aaaf\",\"secret_key\":\"65tghjmads9dbcd892ad4987jmn602a7\",\"logistics\":\"fedex\",\"s_type\":\"ground\",\"order_type\":\"\"}}"
response = http.request(request)
puts response.read_body