Skip to content

produceUnit

POST
/build-orders/{id}/produce-unit
curl --request POST \
--url https://app.dev.buildtrace.eu/api/build-orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/produce-unit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "serialNumber": "example", "consumedSerialIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "rawConsumptions": [ { "childRevisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "lot": "example", "quantity": "example" } ], "ecoDispositions": [ { "ecoId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "disposition": "example", "skippedReason": "example" } ], "completedStepSequences": [ 1 ], "finalTest": { "testPlanId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "testPlanVersion": 1, "notes": "example", "results": [ { "name": "example", "valueNum": 1, "valueText": "example", "passed": true } ] } }'

Required scope: production:write.

id
required
string format: uuid
Media typeapplication/json
object
serialNumber
string
consumedSerialIds
required
Array<string>
rawConsumptions
required
Array<object>
object
childRevisionId
required
string format: uuid
lot
required
string
quantity
required
string
ecoDispositions
required
Array<object>
object
ecoId
required
string format: uuid
disposition
required
string
skippedReason
string
completedStepSequences

Work-instruction steps the builder ticked off. Optional: a unit produced without them is recorded as having no steps reported, which is honest.

Array<integer>
finalTest

The results of the revision’s final test (its effective test plan). The server judges them against the plan’s own limits — the outcome is computed, never taken from the client — and records them as a FINAL inspection of the new unit in the same transaction as producing it, so a unit is never produced while its test record is refused. A FAIL still produces the unit, which the failed inspection quarantines. Required when the revision has a final test, and refused when it has none. Every required check needs a result.

object
testPlanId

The plan the operator ran (EffectiveTestPlan.testPlan.id). With testPlanVersion, a 409 if the plan in force has changed since.

string format: uuid
testPlanVersion
integer
notes
string
results
required
Array<object>
<= 50 items

One check’s result, matched to the check by name. A measurement takes valueNum, a pass/fail check takes passed, a text check takes valueText. A result with no value at all is treated as not recorded (allowed for an optional check).

object
name
required
string
valueNum
number format: double
valueText
string
<= 500 characters
passed
boolean

Example generated

{
"serialNumber": "example",
"consumedSerialIds": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"rawConsumptions": [
{
"childRevisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"lot": "example",
"quantity": "example"
}
],
"ecoDispositions": [
{
"ecoId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"disposition": "example",
"skippedReason": "example"
}
],
"completedStepSequences": [
1
],
"finalTest": {
"testPlanId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"testPlanVersion": 1,
"notes": "example",
"results": [
{
"name": "example",
"valueNum": 1,
"valueText": "example",
"passed": true
}
]
}
}

Created

Media typeapplication/json
object
serialId
required
string format: uuid
serialNumber
required
string
asBuiltRecordId
required
string format: uuid
finalTestResult
required

The computed outcome of the final test. NOT_TESTED when the revision has no final test. A FAIL unit is produced and quarantined by its failed inspection.

string
Allowed values: PASS FAIL NOT_TESTED
inspectionId

The FINAL inspection the results were recorded as (absent when NOT_TESTED).

string format: uuid

Example

{
"finalTestResult": "PASS"
}

Bad request

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}

Unauthorized

Forbidden. Also when a finalTest is sent by a caller who may not record inspections (quality:write).

Not found

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}

Conflict

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}