Reserve a build order
const url = 'https://app.buildtrace.eu/api/build-orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/reserve';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"expectedVersion":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.buildtrace.eu/api/build-orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/reserve \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "expectedVersion": 1 }'Required scope: production:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”object
Optional optimistic-lock guard. When supplied and it does not match the build order’s current version, the operation returns 409 with the current version so the caller can retry.
Example generated
{ "expectedVersion": 1}Responses
Section titled “Responses”OK
object
The order’s number within the organization, e.g. BO-0001
Code of the assembly’s part (read-only; populated by list/detail reads).
Name of the assembly’s part (read-only; populated by list/detail reads).
Label of the assembly revision (read-only; populated by list/detail reads).
Code of the consume-from location (read-only; populated by list/detail reads).
Name of the consume-from location (read-only; populated by list/detail reads).
Code of the produce-to location (read-only; populated by list/detail reads).
Name of the produce-to location (read-only; populated by list/detail reads).
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "orderNumber": "example", "assemblyRevisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetQty": 1, "consumeFromLocationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "produceToLocationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "status": "example", "version": 1, "partCode": "example", "partName": "example", "revisionLabel": "example", "consumeFromLocationCode": "example", "consumeFromLocationName": "example", "produceToLocationCode": "example", "produceToLocationName": "example"}Unauthorized
Not found
Conflict: a version conflict, unacknowledged ECOs, not enough stock, or an OBSOLETE part (the assembly, or a part on the order’s lines; a top-up of an order already reserved is not refused for it). The error message names what is in the way.
object
Example generated
{ "error": "example", "currentVersion": 1}