Order App APIs
Orders
Create a new order
1 min
code examples curl location globoff 'https //{tenantsubdomain}/tms/api/v1/orders/' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x coreos request id string' \\ \ header 'x coreos tid string' \\ \ header 'x coreos access string' \\ \ header 'x coreos userinfo string' \\ \ data '{ "origin" "del", "destinationdetails" { "address" "string", "zipcode" "string", "city" "string", "state" "string", "pocdetails" { "name" "string", "number" "string", "email" "string" } }, "ordernumber" "ord1233422f", "invoicedetails" \[ { "invoicenumber" "string", "invoicedt" 1737635778000, "invoiceamount" 233 56, "invoicedescription" "string", "ewaybill" "string", "ewaybillexpdt" 1737635778000, "irn" "string", "sellergst" "string", "buyergst" "string" } ], "boxdimension" \[ { "length" 24 67, "breadth" 24 67, "height" 24 67, "weight" 24 67, "quantity" 24 67, "weightunit" "string", "boxid" "string", "loadid" "string" } ], "lineitems" \[ { "lineitemnumber" "li00122", "measurementunit" "box", "volume" { "value" 24 5, "unit" "cft" }, "weight" { "value" 24 07, "unit" "kgs" }, "quantity" 2, "product" { "mrp" 1000, "category" "electronics", "code" "60000000019522" } } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x coreos request id", "string"); myheaders append("x coreos tid", "string"); myheaders append("x coreos access", "string"); myheaders append("x coreos userinfo", "string"); var raw = json stringify({ "origin" "del", "destinationdetails" { "address" "string", "zipcode" "string", "city" "string", "state" "string", "pocdetails" { "name" "string", "number" "string", "email" "string" } }, "ordernumber" "ord1233422f", "invoicedetails" \[ { "invoicenumber" "string", "invoicedt" 1737635778000, "invoiceamount" 233 56, "invoicedescription" "string", "ewaybill" "string", "ewaybillexpdt" 1737635778000, "irn" "string", "sellergst" "string", "buyergst" "string" } ], "boxdimension" \[ { "length" 24 67, "breadth" 24 67, "height" 24 67, "weight" 24 67, "quantity" 24 67, "weightunit" "string", "boxid" "string", "loadid" "string" } ], "lineitems" \[ { "lineitemnumber" "li00122", "measurementunit" "box", "volume" { "value" 24 5, "unit" "cft" }, "weight" { "value" 24 07, "unit" "kgs" }, "quantity" 2, "product" { "mrp" 1000, "category" "electronics", "code" "60000000019522" } } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //{tenantsubdomain}/tms/api/v1/orders/", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //{tenantsubdomain}/tms/api/v1/orders/") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["x coreos request id"] = "string" request\["x coreos tid"] = "string" request\["x coreos access"] = "string" request\["x coreos userinfo"] = "string" request body = json dump({ "origin" "del", "destinationdetails" { "address" "string", "zipcode" "string", "city" "string", "state" "string", "pocdetails" { "name" "string", "number" "string", "email" "string" } }, "ordernumber" "ord1233422f", "invoicedetails" \[ { "invoicenumber" "string", "invoicedt" 1737635778000, "invoiceamount" 233 56, "invoicedescription" "string", "ewaybill" "string", "ewaybillexpdt" 1737635778000, "irn" "string", "sellergst" "string", "buyergst" "string" } ], "boxdimension" \[ { "length" 24 67, "breadth" 24 67, "height" 24 67, "weight" 24 67, "quantity" 24 67, "weightunit" "string", "boxid" "string", "loadid" "string" } ], "lineitems" \[ { "lineitemnumber" "li00122", "measurementunit" "box", "volume" { "value" 24 5, "unit" "cft" }, "weight" { "value" 24 07, "unit" "kgs" }, "quantity" 2, "product" { "mrp" 1000, "category" "electronics", "code" "60000000019522" } } ] }) response = https request(request) puts response read body import requests import json url = "https //{tenantsubdomain}/tms/api/v1/orders/" payload = json dumps({ "origin" "del", "destinationdetails" { "address" "string", "zipcode" "string", "city" "string", "state" "string", "pocdetails" { "name" "string", "number" "string", "email" "string" } }, "ordernumber" "ord1233422f", "invoicedetails" \[ { "invoicenumber" "string", "invoicedt" 1737635778000, "invoiceamount" 233 56, "invoicedescription" "string", "ewaybill" "string", "ewaybillexpdt" 1737635778000, "irn" "string", "sellergst" "string", "buyergst" "string" } ], "boxdimension" \[ { "length" 24 67, "breadth" 24 67, "height" 24 67, "weight" 24 67, "quantity" 24 67, "weightunit" "string", "boxid" "string", "loadid" "string" } ], "lineitems" \[ { "lineitemnumber" "li00122", "measurementunit" "box", "volume" { "value" 24 5, "unit" "cft" }, "weight" { "value" 24 07, "unit" "kgs" }, "quantity" 2, "product" { "mrp" 1000, "category" "electronics", "code" "60000000019522" } } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json', 'x coreos request id' 'string', 'x coreos tid' 'string', 'x coreos access' 'string', 'x coreos userinfo' 'string' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // order creation response { "message" { "requestid" "ad583d43 b053 4eec 8f6c 93410720deb7", "ordernumber" "ordrx128" }, "success" true }// order creation error response { "success" false, "error" { "code" 400, "message" "error while creating order" } }// internal server error
