Order Service
Order
Create a new order
1 min
code examples curl location globoff 'https //{base url}/core/api/v1/orders/' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{"body" {"shipmentflow" "string","workorderflowtype" "string","dropdetails" {"contact" {},"location" {}},"clientdetails" {"clientid" "string","clientorderid" "string"},"ordersummary" {"orderdescription" "string","totalweight" {},"totalordercost" {}},"workorders" \["string","string",{"contact" {},"location" {},"pickupslot" {}},{"contact" {},"location" {},"returnslot" {}},{"deliveryslot" {}},{},{},"string\<move container | physical service | digital service>"],"attributes" {},"callback" {"meta" {}},"onrequest" {"url" "string","requestheader" {},"requestbody" {},"method" "string","onresponse" {"wait"\ false}},"onerror" {"url" "string","requestheader" {},"requestbody" {},"method" "string","onresponse" {}}}}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "body" { "shipmentflow" "string", "workorderflowtype" "string", "dropdetails" { "contact" {}, "location" {} }, "clientdetails" { "clientid" "string", "clientorderid" "string" }, "ordersummary" { "orderdescription" "string", "totalweight" {}, "totalordercost" {} }, "workorders" \[ "string", "string", { "contact" {}, "location" {}, "pickupslot" {} }, { "contact" {}, "location" {}, "returnslot" {} }, { "deliveryslot" {} }, {}, {}, "string\<move container | physical service | digital service>" ], "attributes" {}, "callback" { "meta" {} }, "onrequest" { "url" "string", "requestheader" {}, "requestbody" {}, "method" "string", "onresponse" { "wait" false } }, "onerror" { "url" "string", "requestheader" {}, "requestbody" {}, "method" "string", "onresponse" {} } } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //{base url}/core/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 //{base url}/core/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 body = json dump({ "body" { "shipmentflow" "string", "workorderflowtype" "string", "dropdetails" { "contact" {}, "location" {} }, "clientdetails" { "clientid" "string", "clientorderid" "string" }, "ordersummary" { "orderdescription" "string", "totalweight" {}, "totalordercost" {} }, "workorders" \[ "string", "string", { "contact" {}, "location" {}, "pickupslot" {} }, { "contact" {}, "location" {}, "returnslot" {} }, { "deliveryslot" {} }, {}, {}, "string\<move container | physical service | digital service>" ], "attributes" {}, "callback" { "meta" {} }, "onrequest" { "url" "string", "requestheader" {}, "requestbody" {}, "method" "string", "onresponse" { "wait" false } }, "onerror" { "url" "string", "requestheader" {}, "requestbody" {}, "method" "string", "onresponse" {} } } }) response = https request(request) puts response read body import requests import json url = "https //{base url}/core/api/v1/orders/" payload = json dumps({ "body" { "shipmentflow" "string", "workorderflowtype" "string", "dropdetails" { "contact" {}, "location" {} }, "clientdetails" { "clientid" "string", "clientorderid" "string" }, "ordersummary" { "orderdescription" "string", "totalweight" {}, "totalordercost" {} }, "workorders" \[ "string", "string", { "contact" {}, "location" {}, "pickupslot" {} }, { "contact" {}, "location" {}, "returnslot" {} }, { "deliveryslot" {} }, {}, {}, "string\<move container | physical service | digital service>" ], "attributes" {}, "callback" { "meta" {} }, "onrequest" { "url" "string", "requestheader" {}, "requestbody" {}, "method" "string", "onresponse" { "wait" false } }, "onerror" { "url" "string", "requestheader" {}, "requestbody" {}, "method" "string", "onresponse" {} } } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // accepted { "error" { "code" "", "description" "", "additionalinfo" {} }, "request" { "uri" "", "method" "", "querystring" "", "body" {} }, "data" { "id" "" } }// error occurred { "error" { "code" "", "description" "", "additionalinfo" {} }, "request" { "uri" "", "method" "", "querystring" "", "body" {} }, "data" { "id" "" } }// error occurred { "error" { "code" "", "description" "", "additionalinfo" {} }, "request" { "uri" "", "method" "", "querystring" "", "body" {} }, "data" { "id" "" } }