Work Order
A work order record exposes a work order to REST web services. This record is not a subrecord.
This record:
-
is not a subrecord
-
has one subrecord: item
The REST API Browser includes information about the field names and field types of the work order record, and about the HTTP methods, request parameters, and operations available to this record. For details, see the REST API Browser’s workOrder reference page.
For information about using the REST API Browser, see The REST API Browser.
Record IDs
The record ID for a work order REST record is workOrder.
Prerequisites
You must enable the Work Orders feature.
Code Samples
The following samples show common use cases for work orders. The example ID is 4.
Creating a Work Order Using a POST Request
POST https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/workOrder
{ "assemblyItem": {"id": "66"}, "subsidiary": {"id": "5"}, "location": {"id": "5"}, "quantity": 5, "isWip": true
}
Converting Work Orders Using PATCH Requests
The following code sample shows how to convert a work order to a work order issue.
POST https://demo123.suitetalk.api.snap.netsuite.com/services/record/v1/workOrder/4/!transform/workOrderIssue
The following code sample shows how to convert a work order to a work order completion.
POST https://demo123.suitetalk.api.snap.netsuite.com/services/record/v1/workOrder/4/!transform/workOrderCompletion
{ "startOperation": {"refName": "10"}, "endOperation": {"refName": "20"}
}
The following code sample shows how to convert a work order to a work order completion with backflush.
POST https://demo123.suitetalk.api.snap.netsuite.com/services/record/v1/workOrder/4/!transform/workOrderCompletion
{ "isBackflush": true, "startOperation": {"refName": "10"}, "endOperation": {"refName": "40"}, "component" : { "items": [{ "item": "59", "quantity": 1 }] }
}
The following code sample shows how to convert a work order to a work order close.
https://demo123.suitetalk.api.snap.netsuite.com/services/record/v1/workOrder/4/!transform/workOrderClose
The following code sample shows how to create an assembly build from a non-WIP work order.
https://demo123.suitetalk.api.snap.netsuite.com/services/record/v1/workOrder/4/!transform/assemblyBuild
{ "location": {"id": 5}
}
Creating a Work Order With Items Using a POST Request
POST https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/workOrder
{ "subsidiary": { "id": "5" }, "assemblyItem": { "id": "67" }, "quantity": 1.0, "item": { "items": [{ "item": { "id": 63 } }, { "item": { "id": 65 } }] }
}
Retrieving a Work Order Using a GET Request
GET https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/workOrder/4
Updating Work Orders Using a PATCH Request
The following code sample shows how to add an item to the item members of a work order.
PATCH https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/workOrder/4
{ "item": { "items": [ { "item": { "id": 63 }, "quantity": 6 }] }
}
The following code sample shows how to update a member item of a work order. The item ID is 7.
PATCH https://demo123.suitetalk.api.snap.netsuite.com/services/record/v1/workOrder/4/item/7
{ "quantity": 55
}