Add Order V - 2.0.0
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 |
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 |
{ "data": { "shipments" : [ { "waybill" : "", "order" : "GK0033", "sub_order" : "A", "order_date" : "31-01-2018", "total_amount" : "999", "name" : "Bharat", "add" : "104, Shreeji Sharan", "add2" : "", "add3" : "", "pin" : "400067", "city" : "Mumbai", "state" : "Maharashtra", "country" : "India", "phone" : "9876543210", "email" : "abc@gmail.com", "products" : "T-Shirt", "products_desc" : "Clothing", "quantity" : "1", "shipment_length" : "10", "shipment_width" : "10", "shipment_height" : "5", "weight" : "400.00", "cod_amount" : "999", "payment_mode" : "COD", For reverse Shipments: Prepaid Only "seller_tin" : "", "seller_cst" : "", "return_address_id" : "24", "product_sku" : "S01", "extra_parameters" : { "return_reason" : "", "encryptedShipmentID" : "" } } ], "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. } }
{ "status_code": 200, "data": { "1" : { "status" : "Success", "remark" : "", "waybill" : "1369010531020", "refnum" : "GK0034", "payment" : "COD", "cod_amount" : "999" } } }
Sample Code
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://pre-alpha.ithinklogistics.com/api_v2/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\":\"GK0011\",\"sub_order\":\"\",\"order_date\":\"15-06-2018\",\"total_amount\":\"100\",\"name\":\"Bharat\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"email\":\"bharatkarotra11@gmail.com\",\"products\":\"Tshirt\",\"products_desc\":\"Clothing\",\"quantity\":\"1\",\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"10\",\"weight\":\"0.5\",\"cod_amount\":\"100\",\"payment_mode\":\"COD\",\"seller_tin\":\"\",\"seller_cst\":\"\",\"return_address_id\":\"3\",\"product_sku\":\"S01\",\"extra_parameters\":{\"return_reason\":\"\",\"encryptedShipmentID\":\"\"}}],\"pickup_address_id\":\"3\",\"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_v2/order/add.json" payload = "{\"data\":{\"shipments\":[{\"waybill\":\"\",\"order\":\"GK0011\",\"sub_order\":\"\",\"order_date\":\"15-06-2018\",\"total_amount\":\"100\",\"name\":\"Bharat\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"email\":\"bharatkarotra11@gmail.com\",\"products\":\"Tshirt\",\"products_desc\":\"Clothing\",\"quantity\":\"1\",\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"10\",\"weight\":\"0.5\",\"cod_amount\":\"100\",\"payment_mode\":\"COD\",\"seller_tin\":\"\",\"seller_cst\":\"\",\"return_address_id\":\"3\",\"product_sku\":\"S01\",\"extra_parameters\":{\"return_reason\":\"\",\"encryptedShipmentID\":\"\"}}],\"pickup_address_id\":\"3\",\"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\":\"GK0011\",\"sub_order\":\"\",\"order_date\":\"15-06-2018\",\"total_amount\":\"100\",\"name\":\"Bharat\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"email\":\"bharatkarotra11@gmail.com\",\"products\":\"Tshirt\",\"products_desc\":\"Clothing\",\"quantity\":\"1\",\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"10\",\"weight\":\"0.5\",\"cod_amount\":\"100\",\"payment_mode\":\"COD\",\"seller_tin\":\"\",\"seller_cst\":\"\",\"return_address_id\":\"3\",\"product_sku\":\"S01\",\"extra_parameters\":{\"return_reason\":\"\",\"encryptedShipmentID\":\"\"}}],\"pickup_address_id\":\"3\",\"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_v2/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_v2/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\":\"GK0011\",\"sub_order\":\"\",\"order_date\":\"15-06-2018\",\"total_amount\":\"100\",\"name\":\"Bharat\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"email\":\"bharatkarotra11@gmail.com\",\"products\":\"Tshirt\",\"products_desc\":\"Clothing\",\"quantity\":\"1\",\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"10\",\"weight\":\"0.5\",\"cod_amount\":\"100\",\"payment_mode\":\"COD\",\"seller_tin\":\"\",\"seller_cst\":\"\",\"return_address_id\":\"3\",\"product_sku\":\"S01\",\"extra_parameters\":{\"return_reason\":\"\",\"encryptedShipmentID\":\"\"}}],\"pickup_address_id\":\"3\",\"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_v2/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\":\"GK0011\",\"sub_order\":\"\",\"order_date\":\"15-06-2018\",\"total_amount\":\"100\",\"name\":\"Bharat\",\"add\":\"104 Shreeji\",\"add2\":\"\",\"add3\":\"\",\"pin\":\"400067\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"country\":\"India\",\"phone\":\"9876543210\",\"email\":\"bharatkarotra11@gmail.com\",\"products\":\"Tshirt\",\"products_desc\":\"Clothing\",\"quantity\":\"1\",\"shipment_length\":\"10\",\"shipment_width\":\"10\",\"shipment_height\":\"10\",\"weight\":\"0.5\",\"cod_amount\":\"100\",\"payment_mode\":\"COD\",\"seller_tin\":\"\",\"seller_cst\":\"\",\"return_address_id\":\"3\",\"product_sku\":\"S01\",\"extra_parameters\":{\"return_reason\":\"\",\"encryptedShipmentID\":\"\"}}],\"pickup_address_id\":\"3\",\"access_token\":\"8ujik47cea32ed386b1f65c85fd9aaaf\",\"secret_key\":\"65tghjmads9dbcd892ad4987jmn602a7\",\"logistics\":\"fedex\",\"s_type\":\"ground\",\"order_type\":\"\"}}" response = http.request(request) puts response.read_body