OS1 Services
Order Service
Work Order Attributes and Lifecycle
6 min
work order attributes attributes of a work order can be divided into one of the following categories core these are the attributes mandated by the platform for work order entities some of these attributes are required system these are system defined attributes custom these attributes are defined by the tenant to enhance their usability tenants can define custom validations and also specify whether they are to be indexed or non indexed true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type creating work order custom attribute to create a work order custom attribute, call the post /work order/config/attributes endpoint and pass the following parameters in the request body true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type note some of the core work order attributes that can be updated are listed below pickupdetails returndetails deliverydetails the following sample payload shows how to create work order custom attributes named stringvalidations and intvalidations post /work order/config/attributes { "attributes" \[ { "name" "stringvalidations", "description" "string", "indexed" true, "datatype" "string", "validation" { "range" { "min" 0, "max" 5 }, "regex" "string", "valueoneof" \[ "string123", "string124" ], "required" false } }, { "name" "intvalidations", "description" "int", "indexed" true, "datatype" "number", "defaultvalue" 1, "validation" { "range" { "min" 0, "max" 5 }, "valueoneof" \[ 0,1,2,3,4,5 ], "required" true } } ] } adding work order to an order to add a work order to an order, call the put /{orderid}/work order endpoint the following sample payload shows how to add a work order to an order \[ { "amounttocollectondelivery" { "currencycode" "usd", "amount" 1000 }, "pickupqualitychecks" {}, "collectamountonpickup" true, "description" "testing first workorder", "type" "move containers", "pickupaddress" "location 1234", "attributes" { "stringvalidations" "string124", "intvalidations" 1 }, "containers" \[ "container 001" ] } ] work order lifecycle a work order has the following lifecycle states and sub states created work order has been created in the system inprogress\ scheduled a job has been created for the work order inprogress\ assigned job corresponding to work order has been added to a dispatch inprogress\ active job corresponding to the work order has been started onhold\ onhold logistics provider wants to restrict any further actions to be taken by the operations (for ex payment issues for an order / damage issue for an order) closed\ success work order has been completed successfully closed\ partial work order containers have been partially delivered closed\ failed work order has not been successfully delivered closed\ canceled cancellation request raised by a client is processed