Skip to content

Set a numbering template

PUT
/numbering-schemes/{scope}
curl --request PUT \
--url https://app.buildtrace.eu/api/numbering-schemes/SERIAL \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "template": "example", "nextValue": 1 }'

Sets the organization-wide template for a scope and, optionally, moves its next value forward (at most 999999999999). The next value can’t go below the current one, so no number is issued twice. Only SERIAL, BUILD_ORDER and REWORK_ORDER can be set; LOT and DEVICE are refused with a 400, since BuildTrace doesn’t generate those numbers.

Required scope: settings:write.

scope
required
string
Allowed values: SERIAL LOT DEVICE BUILD_ORDER REWORK_ORDER
Media typeapplication/json
object
template
required
string
nextValue

Omit to keep the current next value. Can’t be below the current one.

integer format: int64
>= 1 <= 999999999999

Example generated

{
"template": "example",
"nextValue": 1
}

OK

Media typeapplication/json
object
scope
required
string
Allowed values: SERIAL LOT DEVICE BUILD_ORDER REWORK_ORDER
template
required

Literal text plus tokens: {YYYY} {YY} {MM} and {SEQ} or {SEQ:n} (zero-padded to n digits, 1-9).

string
nextValue
required

The sequence value the next number will use.

integer format: int64
preview
required

The next number, formatted now.

string
maxLength
required

The longest number this scope can store.

integer

Example

{
"scope": "SERIAL"
}

Bad request (invalid template, next value out of range, unknown scope or one BuildTrace doesn’t generate numbers for)

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}

Unauthorized

Forbidden