1. U4 ERPx
  2. API Reference
  3. Project management
  4. Work Orders

Work Orders

The Work Orders API in Unit4 ERPx manages project work order data - creation, retrieval, updates, and closure (soft-delete) of work order records. It is designed for integration with mobile and other external applications, supporting microservice-based development, testing, and maintenance.

Purpose:
The Work Orders API allows you to manage project work orders via microservices and external applications. It supports creating new work orders, updating existing ones, closing work orders, and retrieving work order information.

Base URL:
/v1/work-orders

Authentication:
All APIs require a Client ID and Client Secret.
Refer to the global authentication documentation for details.

System Parameters:
System parameters for this API are available in Online Help → Project Management → Project Information → Fixed Registers → System Parameters.    

Supported Methods

HTTP MethodEndpointDescriptionLimits & Notes
POST/v1/work-ordersCreate a single work order recordOnly 1 work order per call. Supports auto-numbering.
GET/v1/work-orders/{workOrderId}Retrieve single work order dataSupports optional company filter. Returns complete work order information.
PATCH/v1/work-orders/{workOrderId}Update work order dataOne work order per call, multiple fields can be updated.
DELETE/v1/work-orders/{workOrderId}Close (soft-delete) a work orderChanges status to ‘Closed’.
   

Swagger / Schema

Version v1

   

Method Details

Sample Request

{
  "companyId": "COMP1",
  "dateFrom": "2001-01-01",
  "costCentre": "C1",
  "workOrderName": "NewWorkOrder",
  "periodFrom": 200101,
  "periodTo": 200153,
  "projectId": "ProId1",
  "projectManagerId": "33225",
  "status": "N",
  "workOrderId": "123",
  "customerInformation": {
    "currencyCode": "GBP"
  },
  "relatedValues": [
    {
      "relationId": "C1",
      "relatedValue": "100",
      "dateFrom": "1900-01-01",
      "dateTo": "2099-12-31"
    }
  ]
}

Note: The workOrderId field is optional. When not provided, the system will auto-generate a work order ID based on configured numbering series.

Default Values

During the posting process, some fields are auto-completed by the API when they are empty:

Standard Fields:

  • serviceOrder: Default = false
  • periodFrom: Default = period related to dateFrom date
  • periodTo: Default = period related to dateTo date

Customer Information:

  • customerInformation.invoiceSeparately: Default = false
  • customerInformation.invoiceStatus: Default = T (not billable)

Related Values:

  • relationId B0 (Project attribute Id): Default = same value as projectId
  • relationId C0 (Resource/Employee attribute Id): Default = same value as projectManagerId

When customerId is provided:

  • customerInformation.reference: Auto-populated with the name of the contact person for the customer

   

Validation Rules for POST Method

POST_001 - User is not authorised
ElementDetails
Scenario IDPOST_001
Scenario NameUser is not authorised
HTTP Code403
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUTUser does NOT have permissions
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
POST_002 - Missing mandatory fields
ElementDetails
Scenario IDPOST_002
Scenario NameMissing mandatory fields
HTTP Code422
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUTA mandatory field is missing
THENWork order is not created; 422 response is returned
Example Error Message“The {0} field is required.” / “Illegal value entered” / “A value must be entered for {0}.” / “This number series requires a relation value for {0}. Please enter the relation value.”
POST_003 - Invalid format of fields
ElementDetails
Scenario IDPOST_003
Scenario NameInvalid format of fields
HTTP Code422
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUTField format is invalid
THENWork order is not created; 422 response is returned
Example Error Message“Invalid date time format…” / “Error converting value {0} to type ‘{1}’…” / “The field {0} must be between 0 and 100.”
POST_004 - Unsatisfied model restrictions
ElementDetails
Scenario IDPOST_004
Scenario NameUnsatisfied model restrictions
HTTP Code422
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUTField violates model restrictions (length, range, numeric limits)
THENWork order is not created; 422 response is returned
Example Error Message“The field {0} must be a string with max length {1}” / “{0} must be equal or earlier than {1}”
POST_005 - Duplicate workOrderId
ElementDetails
Scenario IDPOST_005
Scenario NameDuplicate workOrderId
HTTP Code422
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUTworkOrderId already exists within companyId
THENWork order is not created; 422 response is returned
Example Error Message“The work order already exists.”
POST_006 - Invalid data
ElementDetails
Scenario IDPOST_006
Scenario NameInvalid data
HTTP Code422
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUTData does not exist on ERP (attribute values, list of possible values)
THENWork order is not created; 422 response is returned
Example Error Message“{0} is not a legal {1}” / “Illegal {0}”
POST_007 - Work order created
ElementDetails
Scenario IDPOST_007
Scenario NameWork order created
HTTP Code201
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUT
THENA new work order is created
Example Error MessageRESPONSE: returns the created work order
POST_008 - Work order created with auto-numbering
ElementDetails
Scenario IDPOST_008
Scenario NameWork order created with auto-numbering
HTTP Code201
GIVENA new work order needs to be created
WHENCalling the POST method of the API
BUTworkOrderId is not provided
THENA new work order is created with auto-generated workOrderId
Example Error MessageRESPONSE: returns the created work order with new workOrderId (auto-numbering)

   

Sample Request

GET /v1/projects/work-orders/123?companyId=COMP1

   

Additional Parameters

The following parameters help retrieve basic information about a work order:

ParameterValueDescriptionData TypeDefault Value
companyIdoptionalSpecify if you wish to retrieve a work order that exists in a specific company or client.stringempty

   

Validation Rules for GET Method

GET_001 - User is not authorised
ElementDetails
Scenario IDGET_001
Scenario NameUser is not authorised
HTTP Code403
GIVENData from an existing work order needs to be retrieved
WHENCalling the GET method of the API
BUTUser does NOT have permissions
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
GET_002 - Unknown companyID
ElementDetails
Scenario IDGET_002
Scenario NameUnknown companyID
HTTP Code403
GIVENData from an existing work order needs to be retrieved
WHENCalling the GET method of the API
BUTcompanyID does not exist
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
GET_003 - Missing mandatory fields
ElementDetails
Scenario IDGET_003
Scenario NameMissing mandatory fields
HTTP Code405
GIVENData from an existing work order needs to be retrieved
WHENCalling the GET method of the API
BUTworkOrderId is not indicated
THENWork order is not retrieved; 405 response is returned
Example Error Message(Empty message)
GET_004 - workOrderId does not exist
ElementDetails
Scenario IDGET_004
Scenario NameworkOrderId does not exist
HTTP Code404
GIVENData from an existing work order needs to be retrieved
WHENCalling the GET method of the API
BUTworkOrderId does not exist for the companyId
THENWork order is not retrieved; 404 response is returned
Example Error Message“The entity of the following parameters [Company: {0}, Work order: {1}] was not found.”
GET_005 - Work order exists
ElementDetails
Scenario IDGET_005
Scenario NameWork order exists
HTTP Code200
GIVENData from an existing work order needs to be retrieved
WHENCalling the GET method of the API
BUT
THEN200 response is returned together with the information of the work order
Example Error MessageRESPONSE: Work order information is retrieved

   

Sample Request

[{
  "path": "/",
  "op": "Replace",
  "value": {
    "workOrderName": "Updated Work Order Name",
    "status": "C",
    "probability": 70
  }
}]
[{
  "path": "/workOrderName",
  "op": "Replace",
  "value": "New name"
}]
   

Additional Parameters

The following parameters help update basic information about a work order:

ParameterValueDescriptionData TypeDefault Value
companyIdoptionalSpecify if you wish to update a work order that exists in a specific company or client.stringempty

   

Limits & Notes

  • One work order per call.
  • Possibility to update several fields per call.
  • Patch operators available: Replace, Add, Remove    

Supported Operations

The PATCH endpoint supports the following JSON Patch operations:

OperationDescriptionUse Case
ReplaceReplaces existing valueUpdate existing fields
AddAdds new value to array/objectAdd new array elements or properties
RemoveRemoves valueDelete array elements or optional properties

   

Validation Rules for PATCH Method

PATCH_001 - User is not authorised
ElementDetails
Scenario IDPATCH_001
Scenario NameUser is not authorised
HTTP Code403
GIVENUser needs to modify existing work order
WHENCalling PATCH method of the API
BUTUser does NOT have permissions
THENAPI is not reached; 403 response is returned
Example Error Message“User is not authorised.”
PATCH_002 - Missing mandatory fields
ElementDetails
Scenario IDPATCH_002
Scenario NameMissing mandatory fields
HTTP Code422
GIVENUser needs to modify existing work order
WHENCalling PATCH method of the API
BUTMandatory field is missing
THENData is not updated; 422 response is returned
Example Error Message“The {0} field is required.”
PATCH_003 - Invalid format of fields
ElementDetails
Scenario IDPATCH_003
Scenario NameInvalid format of fields
HTTP Code422
GIVENUser needs to modify existing work order
WHENCalling PATCH method of the API
BUTField format is invalid
THENData is not updated; 422 response is returned
Example Error Message“Invalid date time format…” / “Error converting value {0} to type ‘{1}’…”
PATCH_004 - Unsatisfied model restrictions
ElementDetails
Scenario IDPATCH_004
Scenario NameUnsatisfied model restrictions
HTTP Code422
GIVENUser needs to modify existing work order
WHENCalling PATCH method of the API
BUTField violates model restrictions
THENData is not updated; 422 response is returned
Example Error Message“The date must be between {0} and {1}” / “The field {0} must be a string with max length {1}”
PATCH_006 - Unknown workOrderId
ElementDetails
Scenario IDPATCH_006
Scenario NameUnknown workOrderId
HTTP Code404
GIVENUser needs to modify existing work order
WHENCalling PATCH method of the API
BUTworkOrderId does not exist
THENData is not updated; 404 response is returned
Example Error Message“Work order with ID {0} was not found within the company {1}.”

   

Sample Request

DELETE /v1/projects/work-orders/123?companyId=COMP1

   

Additional Parameters

The following parameters help to delete a work order:

ParameterValueDescriptionData TypeDefault Value
companyIdoptionalSpecify if you wish to delete a work order that exists in a specific company or client.stringempty

   

Limits & Notes

  • Changes the status of a work order to “Closed”.
  • Does not permanently delete the work order.
  • If you need to update the status to something other than “Closed”, use the PATCH endpoint.

   

Validation Rules for DELETE Method

DEL_001 - User is not authorised
ElementDetails
Scenario IDDEL_001
Scenario NameUser is not authorised
HTTP Code403
GIVENWork order needs to be ‘Closed’
WHENCalling DELETE method of the API
BUTUser is not authorised
THENAPI is not reached; 403 response is returned
Example Error Message or Response“User is not authorised.”
DEL_002 - Missing required parameters
ElementDetails
Scenario IDDEL_002
Scenario NameMissing required parameters
HTTP Code405
GIVENWork order needs to be ‘Closed’
WHENCalling DELETE method of the API
BUTRequired parameter is missing
THENAPI is not reached; 405 response is returned
Example Error Message or Response(Empty message)
DEL_003 - Work order does not exist
ElementDetails
Scenario IDDEL_003
Scenario NameWork order does not exist
HTTP Code404
GIVENWork order needs to be ‘Closed’
WHENCalling DELETE method of the API
BUTworkOrderId does not exist
THENNo deletion; 404 response is returned
Example Error Message or Response“WorkOrder with Id {0} was not found within company {1}”
DEL_004 - Work order exists
ElementDetails
Scenario IDDEL_004
Scenario NameWork order exists
HTTP Code200
GIVENWork order needs to be ‘Closed’
WHENCalling DELETE method of the API
BUT
THENWork order is ‘Closed’; 200 response is returned
Example Error Message or Response(Empty message - no content)

Best Practices

  • Use Swagger UI for testing and schema validation before production calls.
  • Handle error codes gracefully - implement retry/backoff logic according to global rate limits.
  • Always check for deprecation alerts on this endpoint version.
  • Leverage auto-numbering when creating work orders without specifying workOrderId to ensure unique identifiers.
  • Understand default values - many fields are auto-populated during POST operations to simplify integration.
  • Use PATCH for status updates other than “Closed” - the DELETE endpoint only sets status to “Closed”.    

Action APIs


Query APIs (Read-Only)