WorkOrder_Get (Get)
- Last UpdatedNov 06, 2025
- 7 minute read
| Get | WorkOrder_Get |
Resource Path:/api/WorkOrder
Get information about one or more work orders.
You can filter the work orders by line, time period, and one job-related work order status. You can also filter the work orders by all job-related work order statuses together and other filters.
Filter the work orders by line, time period, and a job-related work order status
Use the following parameters to filter the work orders by line, time period, and a job-related work order status. This Get returns an array of objects that are of type WO model.
Parameters:
woId (string)
The work order ID. If not provided, all work orders that match the other filter parameters will be returned.
targetScheduleLineId (integer)
The ID of a line on which work orders have been scheduled.
lastEditHr (integer)
This filter applies only to Completed or Canceled work orders. The number hours prior to the current time during which work orders have been completed or canceled.
statusCd (integer)
The job-related status code of the work order:
1 = New
2 = Ready
3 = Running (In Progress)
4 = Complete
5 = Suspended
6 = On Hold
The work order status code is based on the status of its member jobs according to the first true condition in the following order:
- If there is a job running, the work order status is Running.
- If all the jobs are completed or canceled, the work order status is Complete.
- If there is any one on-hold job, then the work order status is On Hold.
- If there is any one suspended job, then the work order status is Suspended.
- If there is any one ready job, then the work order status is Ready.
- If none of the above conditions are true, the work status is New.
Filter the work orders by their jobs' statuses and other filters
Use the following parameters to filter the work orders by all job-related work order statuses together and several other filters. Instead of returning an array of objects based on the WO model, this Get returns an array of objects with the properties described below under "Response."
Parameters:
Note: All of the state filter parameters are required, even if their values are set to false. If you do not provide a value for even one of the state filter parameters, then the other version of the workorder endpoint is used and an array of objects that are of type WO model will be returned instead of the JSON array returned by this version of the endpoint. Also, all non-state filter parameter settings will still be implemented in the call of the other workorder endpoint.
newState (Boolean)
Required. Indicates whether to include work orders that have any jobs in the New state.
readyState (Boolean)
Required. Indicates whether to include work orders that have any jobs in the Ready state.
runningState (Boolean)
Required. Indicates whether to include work orders that have any jobs in the Running state.
completeState (Boolean)
Required. Indicates whether to include work orders that have any jobs in the Complete state.
suspendedState (Boolean)
Required. Indicates whether to include work orders that have any jobs in the Suspended state.
onholdState (Boolean)
Required. Indicates whether to include work orders that have any jobs in the On Hold state.
woId (string)
The work order ID of a specific work order. If not provided, all work orders that match the other filter parameters will be returned.
itemId (string)
The ID of an item being produced.
numberOfWos (integer)
The maximum number of work order records to return.
If no value is supplied and there are a large number of work order records, system performance might be affected as all work orders that match the other filter parameters will be returned.
targetScheduleLineId (integer)
The ID of a line on which work orders have been scheduled. If null, only work orders not assigned to a line will be considered in the retrieval. To ignore this parameter so that all work orders that are assigned to lines will be considered in the retrieval, set the value to -1.
lastEditHr (integer)
This filter applies only to Completed or Canceled work orders. Enter the number hours prior to the current time during which work orders have been completed or canceled.
includeFromProcess (Boolean)
Indicates whether to include work orders created from a process. The default is false.
| Name | Description | Data Type |
|---|---|---|
| woId | The work order ID. Required if getting information about a specific work order. | string |
The response body is of type Mes.WebApi.Models.WO.
If you used a call that included the job state parameters to filter by job states, the following properties are returned in the response body instead of the WO model properties.
wo_id (string)
The work order ID.
wo_desc (string)
The work order description.
process_id (string)
The ID of the process from which the work order was generated, if the work order was generated from a process.
item_id (string)
The ID of the final item being made, unless all its jobs are disassembly jobs, in which case this is the initial item.
item_desc (string)
The item description.
uom_id (integer)
The ID of the unit of measure.
uom_desc (string)
The description of the unit of measure.
num_decimals (integer)
The number of decimals for formatting numeric values.
num_decimals_good_pp (integer)
The value of the system_attr 326 Max decimals of good piece part entries and is used when num_decimals is 0.
release_time_utc (datetime)
The date and time when the work order was/will be released in UTC.
release_time_local (datetime)
The date and time when the work order was/will be released in the local time of the target scheduled entity.
req_finish_time_utc (datetime)
The date and time by when the work order must be completed in UTC.
req_finish_time_local (datetime)
The date and time by when the work order must be completed in the local time of the target scheduled entity.
state_cd (integer)
The code that indicates the state of the work order.
0 = Released (default)
1 = Started
2 = Completed
3 = Closed. When closed, nothing else for this work order is editable.
wo_priority (integer)
The work order priority. This is the default value for job_priority in the Job table.
cust_info (string)
The customer information for the work order.
mo_id (string)
The manufacturing order, for grouping different final parts.
notes (string)
The work order’s notes.
target_sched_line_id (integer)
The ID of the production line to which the work order is assigned.
target_sched_line_name (string)
The name of the production line to which the work order is assigned
wo_status (integer)
The job-related status code of the work order:
1 = New
2 = Ready
3 = Running (In Progress)
4 = Complete
5 = Suspended
6 = On Hold
The work order status code is based on the status of its member jobs according to the first true condition in the following order:
- If there is a job running, the work order status is Running.
- If all the jobs are completed or canceled, the work order status is Complete.
- If there is any one on-hold job, then the work order status is On Hold.
- If there is any one suspended job, then the work order status is Suspended.
- If there is any one ready job, then the work order status is Ready.
- If none of the above conditions are true, the work status is New.
wo_status_desc (string)
The description of the job-related status of the work order.
color (string)
The name or hex value of the HTML color that is the background color of the job-related status of the work order.
qty_reqd (double)
The sum of items that the work order is required to produce based on the jobs that are run on the entity or entities identified as the production source for the line.
qty_at_start (double)
The sum of items that the work order can optimally produce given the raw material available based on the jobs that are run on the entity or entities identified as the production source for the line.
qty_prod (double)
The sum of acceptable items that the work order has produced based on the jobs that are run on the entity or entities identified as the production source for the line.
qty_rejected (double)
The sum of rejected items that the work order has produced based on the jobs that are run on the entity or entities identified as the production source for the line.
qty_remaining (double)
The sum of the number of remaining items that the work order must still produce based on the jobs that are run on the entity or entities identified as the production source for the line.
def_reqd_qty (double)
The value that is the original required qty - good qty produced in any job for this work order that ran on an entity identified as a line's production entity or those in parallel with them, or 0, whichever is greater.
last_edit_at (datetime)
The date and time, in UTC, when the record was added or last updated.
row_num (integer)
The number of the work order in the list of returned work orders in the array. Row numbers represent the creation time order of the work orders, with the lowest number being the most recent work order.
If a web application has set a maximum number of work orders that can be returned (for performance reasons), the row numbers can be used to ensure that the most recent work orders are returned if the maximum number is exceeded.
To get all work orders:
api/WorkOrder
To get the work order WO20171213.2445:
api/WorkOrder?woId=WO20171213.2445
To get all work orders that were scheduled on the line with the ID 8 and that have been completed or canceled within the last 24 hours:
api/WorkOrder?targetScheduleLineIdFilter=8&lastEditHr=24&statusCd=4
To get all work orders with a status of New:
api/WorkOrder?statusCd=1
To get all work orders with a New or Ready status and not created from a process:
api/workorder?newState=true&readyState=true&runningState=false&completeState=false
&suspendedState=false&onholdState=false
To get all work orders with a Completed status that have been scheduled on the line with the ID 8 within the last 24 hours and can be created from a process:
api/workorder?newState=false&readyState=false&runningState=false
&completeState=true&suspendedState=false
&onholdState=false&targetSchedLineId=8&lastEditHr=24&includeFromProcess=true
Examples: Work Tasks Lookups
To get all work orders:
api/WorkOrder
To get a specific work order:
api/WorkOrder?woId={woId}
To get all work orders that were scheduled on a specific line and were completed or canceled within a certain time period:
api/WorkOrder?targetScheduleLineIdFilter={targetScheduleLineIdFilter}
&lastEditHr={lastEditHr}&statusCd={statusCd}
To get all work orders based on their overall status:
api/WorkOrder?statusCd={statusCd}
To get all work orders based on their status and not created from a process:
api/workorder?newState={newState}&readyState={readyState}&runningState={runningState}
&completeState={completeState}&suspendedState={suspendedState}&onholdState={onhold}
To get all work orders that have been scheduled on a specific line within a certain time duration, and based on their status and whether they were created from a process:
api/workorder?newState={newState}&readyState={readyState}&runningState={runningState}
&completeState={completeState}&suspendedState={suspendedState}
&onholdState={onhold}&targetSchedLineId={targetSchedLineId}&lastEditHr={lastEditHr}
&includeFromProcess={ifp}