Create a new order. Requires orders.create permission.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
with[] |
string[] | no | Include related resources in the response. Pass multiple values as separate query parameters (e.g., ?with[]=createdBy&with[]=updatedBy). One of: createdBy, updatedBy, organization, site, supplierOrganization, lines. |
Request body
Required.
application/json
notesstringsiteIdstring (uuid) · requiredsupplierOrganizationIdstring (uuid)workTaskCanonicalIdsstring (uuid)[] — Canonical IDs of work tasks to add to the order
{
"notes": "Special instructions for this order",
"siteId": "019222d4-1d93-7d47-a3c4-b547e009a0f7",
"supplierOrganizationId": "019222d4-1d93-7d47-a3c4-b547e009a0f8",
"workTaskCanonicalIds": [
"string"
]
}
Responses
| Status | Description |
|---|---|
| 201 | The order was created successfully |
| 403 | The requesting user lacks appropriate permissions |
| 422 | Validation error |
Response 201 body
dataobject · requiredmetaobject · required
{
"data": {
"id": "019222d4-1d93-7d47-a3c4-b547e009a0f7",
"completedAt": "string",
"confirmedAt": "string",
"createdAt": "2024-06-30T19:00:00Z",
"createdBy": {
"id": "019222d9-d87d-7724-bba6-ba91503ea311",
"firstName": "John",
"lastName": "Doe"
},
"lines": [
{
"workTaskGroupId": "string",
"displayOrder": 0,
"workTask": {
"id": "string",
"canonicalId": "string",
"version": 0,
"name": "string",
"description": "string"
},
"steps": [
{
"workStepGroupId": "string",
"workStep": {
"id": null,
"canonicalId": null,
"version": null,
"name": null,
"description": null,
"riskLevel": null,
"order": null
},
"requirements": []
}
]
}
],
"notes": "string",
"number": "25-0000001",
"organization": {
"id": "019222d9-d87d-7724-bba6-ba91503ea311",
"name": "ACME Corporation"
},
"site": {
"id": "019222d9-d87d-7724-bba6-ba91503ea311",
"name": "Stockholm Office"
},
"status": "draft",
"supplierOrganization": {
"id": "019222d9-d87d-7724-bba6-ba91503ea311",
"name": "ACME Corporation"
},
"updatedAt": "2024-06-30T19:00:00Z",
"updatedBy": {
"id": "019222d9-d87d-7724-bba6-ba91503ea311",
"firstName": "John",
"lastName": "Doe"
}
},
"meta": {
"requestId": "019a3a60-6328-7075-8a41-76ff545ca5d3",
"userId": "019a3a60-929c-7820-9b35-bf79a8bf83a6",
"organizationId": "019a3a60-8175-7a68-88da-ecb4a7040b86"
}
}