OS1 Services
...
Order Service
Integrate with Platform Order ...
How To: Platform Order Management
8min
how to config platform order attributes for information about prerequisites, see platform order attributes and lifecycle docid\ ji9tzsb 428vvul3sqs t call the create order config docid 2jpn3uobo8w2h7ethztg endpoint to add the attributes to a platform order the following sample request body only defines a couple of custom attributes such as the name of order attributes for an order { "attributes" \[ { "name" "order1", "description" "creating order attribute", "indexed" true, "datatype" "string", "validation" { "range" { "min" 0, "max" 5 }, "regex" "string", "valueoneof" \[ "string123", "string124" ], "required" false } }, { "name" "order2", "description" "initiating", "indexed" true, "datatype" "number", "defaultvalue" 1, "validation" { "range" { "min" 0, "max" 5 }, "valueoneof" \[ 0,1,2,3,4,5 ], "required" true } } ] } how to update configured order attributes to update the configured order attributes, call the update order config docid\ ui fersllcbhr9wtjcc0d endpoint how to get configuration of order attributes to get the list of all configured order attributes, call the get the custom attributes of an order docid\ cmrcra80r0iqpo3t es0b endpoint how to configure order state machine learn more about the state machine docid\ onamjh1ianfuwvykha69n service learn more about state machine docid\ onamjh1ianfuwvykha69n how to get order state machine configuration to get the configuration of a state machine for an order call the get state machine configuration for an order docid\ bn6t5a7qqbfk2bqdtu0co endpoint how to update order state machine configuration call the update state machine configuration for an order docid\ zaajxmzmw8e8vomw42v i for an order endpoint to update the state machine configuration how to create an order before creating an order, configure platform order attributes and lifecycle docid\ ji9tzsb 428vvul3sqs t once the attributes are configured call create order endpoint and pass the payload similar to what is shown below { "shipmentflow" "consignment", "workorderflowtype" "sequential", "dropdetails" { "contact" { "name" "order", "phone" { "countrycode" "+1", "number" "+15559876543", "ismobile" true } }, "location" { "address" { "addressline1" "123 main street anytown", "city" "queen", "country" { "code" "usa", "name" "united states" } } } }, "clientdetails" { "clientname" "john doe", "clientid" "tenants\ cfecb885 e060 514a b4f7 0094cf6148e2", "clientorderid" "order\ bd5f3a6c 761d 4bd1 aa69315d3850" }, "ordersummary" { "invoicenumber" "h xv 9ohhcety zr1wrnmmigeght5hwm14cjwdx70 41piyw0vclc3xvgwbwq29o", "orderdescription" "sample description for the order", "totalweight" { "value" 0, "unit" "kg" }, "totalitems" 0, "totalordercost" { "cost" 100, "currencycode" "lkr", "minorunit" 2 } }, "workorders" \[ { "servicetemplateid" "template\ ed63ac89 f13e 4f49 8714 98648", "servicetemplatename" "expressservice", "pickupdetails" { "contact" { "name" "jane doe", "phone" { "countrycode" "+1", "number" "5559876543", "ismobile" true } }, "location" { "address" { "addressline1" "456 oak avenue springfield", "city" "queen", "country" { "code" "usa", "name" "united states" } } }, "pickupslot" { "from" 21216521, "to" 276216712 }, "servicetime" 1 }, "returndetails" { "contact" { "name" "john doe", "phone" { "countrycode" "+1", "number" "5559876543", "ismobile" true } }, "location" { "address" { "addressline1" "123 main street anytown", "city" "queens", "country" { "code" "usa", "name" "united states" } } }, "returnslot" { "from" 162733, "to" 2162172 }, "servicetime" 1 }, "attributes" { "producttype" "parcel", "mile" "singleleg", "speedoftransport" "express", "modeoftransport" "surface", "shipmentflow" "reverse", "paymenttype" "cod", "teamid" "team01" }, "containers" \[ { "containertype" "orderfpasts", "scannableid" "scan\ id\ bd5f3a6c 761d 4bd2 a6912", "trackingdetails" { "operator" "delhi", "trackingid" "delhi 01", "isprimary" true }, "attributes" { "dimensions" { "length" "10", "breadth" "10", "height" "10", "unit" "m" }, "weight" { "value" "10", "unit" "kg" }, "shipmentdetails" \[ { "name" "bag", "code" "bag", "quantity" 1, "totalcost" { "cost" 0, "currencycode" "lkr", "minorunit" 0 } } ] } } ], "type" "move container" } ] } managing orders to manage an order, utilize the endpoints provided by the create a new order docid\ a l1si8ohshicgwphho b call the update order attributes endpoint for modifications in order created, while the get order details endpoint helps retrieve in depth details about the orders apply the order cancellation endpoint for changes in cancellation details and to add or update the workorder, use the add workorder to the order endpoint add workorder to the order \[ { "amounttocollectondelivery" { "currencycode" "inr", "amount" 1000 }, "pickupqualitychecks" {}, "collectamountonpickup" true, "description" "sample first workorder", "type" "move containers", "pickupaddress" "location 653163f0 cb49 4451 aecb 491303c56ea4", "attributes" { "stringvalidations" "string111", "intvalidations" 1 }, "containers" \[ "container 001", "container 002" ] } ] how to configure custom code in platform order management learn more about custom code docid\ mz ewp1umtozx39tr2n6k to register custom code configuration in the platform order management service call register custom code configurations docid\ dnkabqncd3ws7xxmb nnq api endpoint sample payload for adding custom code configuration is given below { "url" "https //mocki io/v1/54eaffb4 9a3b 4043 807a e1f6586773hd", "requestheader" { "header2" "header2" }, "method" "get", "wait" true, "acceptablestatuscodes" \[ 200, 404 ], "raiseerroronstatusmismatch" true, "methodname" "updateorder\ onrequest", "enabled" true } how to update custom code configuration to update the custom code configuration in platform order management, call the update custom code configurations docid\ gxbr9r2psg2dgf4b8ppox endpoint how to get configured custom code to get the details of configured custom code in platform order management, call the get custom code configurations docid\ ajv93avhocpthcdtjq93d endpoint