Work Order REST API
Accounts Notes
Accounts are considered master data and managed via the Account REST APIs or NexusFS web application.
If the Account section contains only the AccountNum property then the API will automatically fill in the rest of the information from the account master data. This requires that the account exists in our system. In this scenario if the account does not exists an error will be returned.
If the Account
section contains any additional properties besides AccountNum,
the API will assume that this is an override and assumes all required properties are present and this API will not join any additional properties from the account master.
Account Locations Notes
Account locations are considered master data which are managed via the Account Location REST APIs or NexusFS web application.
If the AccountLoc section of the work order object contains only the LocNum property then this API will automatically fill in the rest of the information from the account location's master data. This requires that the account location details exists in our system. In this scenario if the account location does not exists an error will be returned.
If the AccountLoc section contains any additional properties besides the LocNum property the API will assume that this is an override and assumes all required fields are present. The API will not join any additional data from the account's location master data.
Resource URL Summary
Retrieve the details of a specific Work Order
GET /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
Insert or Update the details of a specific Work Order
PUT /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
Update the details of a specific Work Order 3.19.0
POST /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
Update only supplied details of a specific Work Order 3.19.0
PATCH /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
Delete a specific Work Order
DELETE /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
API Specific Parameters
Parameter | Description |
---|---|
| Identifies the Work Order Object. |
HTTP Headers
This API uses the default ServiceMobility HTTP Headers.
API Specifics
Retrieve the details of a specific Work Order
This REST API will return a Work Order with the specified ID. The Work Order with the specified ID must already exist in the system.
URL
GET /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
HTTP Request Body
This request does not require a request body.
HTTP Response Body
On success, an HTTP response code of 200 will be returned, and the response body will contain a Work Order Object.
Otherwise, on error, the API returns the standard response object.
Insert or Update the details of a specific Work Order
This REST API will insert a new Work Order with the specified ID into the system, if a Work Order with the specified ID does not already exist in the system.
If, however, the Work Order with the specified ID does already exist in the system, then this REST API will update (i.e. replace) the already existing Work Order with the specified ID with the details of the Work Order supplied in the HTTP Request Body.
URL
PUT /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
HTTP Request Body
The HTTP request body must contain a valid Work Order Object.
HTTP Response
The API returns the standard response object on both success and error.
Update the details of a specific Work Order
The implementation of this API changed in 3.19.0. Prior to this version of the API, this API method would update only the supplied details; the API now updates (i.e. replaces) the entire Work Order. This is a non-backwards compatible API change; users of the API who want to update only the supplied details without replacing the entire object must update their API integration to use the PATCH API method instead (see below).
This REST API will update (i.e. replace) the already existing Work Order with the specified ID with the details of the Work Order supplied in the HTTP Request Body.
The Work Order with the specified ID must already exist in the system.
URL
POST /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
HTTP Request Body
The HTTP request body must contain a valid Work Order Object.
HTTP Response
The API returns the standard response object on both success and error.
Update only supplied details of a specific Work Order
This API was introduced in 3.19.0. This API is effectively the how the POST API method worked in prior versions of the API.
This REST API will update an existing Work Order with the information provided.
Any existing information not specified in the new request will remain unchanged.
The Work Order with the specified ID must already exist in the system.
URL
PATCH /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
API users with clients that do not support the PATCH method may use a POST
method with the X-HTTP-Method-Override: PATCH
header. See: http://jsonapi.org/recommendations/#patchless-clients
HTTP Request Body
The HTTP request body must contain a valid Work Order Object.
HTTP Response
The API returns the standard response object on both success and error.
Delete a specific Work Order
This REST API will delete a Work Order with the specified ID from the system. The Work Order with the specified ID must already exist in the system.
URL
DELETE /seiapi/v3/trans/WorkOrder/${WorkOrderNum}
HTTP Request Body
This request does not require a request body.
HTTP Response
The API returns the standard response object on both success and error.
PATCH Request Examples
The following examples assume the specified work order already exist in the system.
Example 1: Add an Asset
Initial Work Order
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
PATCH Request
{ "Assets": [{ "AssetNum": "3182", "Desc": "Dishwasher", "IsComponent": false, "Type": "1001" }], "OrderNum": "1214" }
Result
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Assets": [{ "AssetNum": "3182", "Desc": "Dishwasher", "IsComponent": false, "Type": "1001" }], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
Example 2: Replace Assets
Initial Work Order
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Assets": [{ "AssetNum": "3182", "Desc": "Dishwasher", "IsComponent": false, "Type": "1001" }], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
PATCH Request
{ "_fields": ["Assets"], "Assets": [{ "AssetNum": "310067", "Desc": "Vending Machine", "IsComponent": false, "Type": "1001" }], "OrderNum": "1214" }
Result
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Assets": [{ "AssetNum": "310067", "Desc": "Vending Machine", "IsComponent": false, "Type": "1001" }], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
Example 3: Remove Rules
Initial Work Order
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
PATCH Request
{ "_fields": ["Rules"], "OrderNum": "1214" }
Result
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003" }
Example 4: Empty Rules
Initial Work Order
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
PATCH Request
{ "OrderNum": "1214", "Rules": {} }
Result
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003" }
Example 5: Remove FlexView with a specific ID from FlexView collection
Initial Work Order
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "FlexView": [{ "ID": "1001", "Title": "Customer", "Items": [{ "Label": "Status", "Value": "Preferred Customer" }] }, { "ID": "1002", "Title": "Special Instructions", "Items": [{ "Label": "Parking", "Value": "Parking in the rear" }] } ], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
PATCH Request
{ "_paths": ["$.FlexView[?(@.ID=='1001')]"], "OrderNum": "1214" }
Result
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "FlexView": [{ "ID": "1002", "Title": "Special Instructions", "Items": [{ "Label": "Parking", "Value": "Parking in the rear" }] }], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
Example 6: Remove FlexView with a specific ID from FlexView collection (Alternative Approach)
Initial Work Order
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "FlexView": [{ "ID": "1001", "Title": "Customer", "Items": [{ "Label": "Status", "Value": "Preferred Customer" }] }, { "ID": "1002", "Title": "Special Instructions", "Items": [{ "Label": "Parking", "Value": "Parking in the rear" }] } ], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
PATCH Request
{ "FlexView": [{ "ID": "1001", "Delete": true }], "OrderNum": "1214" }
Result
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "FlexView": [{ "ID": "1002", "Title": "Special Instructions", "Items": [{ "Label": "Parking", "Value": "Parking in the rear" }] }], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
Example 7: Add “Fixed” property to the Discount object and update “Percentage” value
Initial Work Order
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Discounts": [{ "ID": "1", "Desc": "", "IsApplied": true, "Percentage": 4.0, "ProdTypes": [ "1001" ] }], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }
PATCH Request
{ "OrderNum": "1214", "Discounts": [{ "ID": "1", "Fixed": 4.0, "Percentage": 5.2 }] }
Result
{ "Account": { "AccountNum": "1029", "AccountType": "1001", "Name": "Buckhead Inc." }, "Discounts": [{ "ID": "1", "Desc": "", "Fixed": 4.0, "IsApplied": true, "Percentage": 5.2, "ProdTypes": [ "1001" ] }], "Location": { "Address": { "AddrLine1": "1 Buckhead Loop Northeast", "City": "Atlanta", "Country": "United States", "Region": "Georgia", "Zip": "30326" }, "LanguageID": "en", "LocationNum": "1030", "Name": "Buckhead Station", "SigReq": false, "WorkCenter": "Default" }, "DispatchUTC": "2016-02-19T20:44:15.498Z", "DispatchStatus": 3, "OrderDate": "2016-02-19T20:44:15.498Z", "OrderNum": "1214", "OrderStatus": "1", "OrderType": "1001", "Priority": "1003", "Rules": { "CanEditAsset": false, "CanEditDiscounts": false, "CanSetChargeable": false, "CanSetPrice": false, "InWarranty": false, "IsOps": false, "StackDiscounts": false } }