Create a build order
const url = 'https://app.buildtrace.eu/api/build-orders';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"assemblyRevisionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","targetQty":1,"consumeFromLocationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","produceToLocationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "assemblyRevisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetQty": 1, "consumeFromLocationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "produceToLocationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Required scope: production:write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Where the order’s materials are reserved and consumed from.
Example generated
{ "assemblyRevisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "targetQty": 1, "consumeFromLocationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "produceToLocationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”Created
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"}Bad request
object
Example generated
{ "error": "example"}Unauthorized
Not found
Conflict: the assembly, or a part on its effective BOM, is OBSOLETE; or none of the next numbers from the numbering scheme is free (a template change made it produce numbers already issued). The message says which, and how to get past it.
object
Example generated
{ "error": "example"}