Give a code to the orders that have none
curl --request POST \ --url https://example.com/api/v1/order-format-settings/missing-codes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "clientId": "example", "dryRun": true }'Gives every order that has no code the code a new order of its company and type would get, numbered oldest first (start date, else creation date) after the highest number already issued under the same prefix and type code; a template’s {year} is the order’s own year. An order whose name starts with a code in square brackets, such as [AG-S01] Sprint, takes that code as written, with no number issued, unless another order of the workspace already holds it as its code or an alias (ignoring case) or an older order of the run names it first; those are numbered as usual and counted in bracketFallbacks. An order that already has a code is never changed. An order is skipped, and counted by reason, when its company has no prefix (NO_COMPANY_PREFIX), its order type has no code (NO_TYPE_CODE), the workspace has code generation off (CODES_DISABLED), or another order took the generated code while the run was writing it (CODE_TAKEN; run it again). Each assignment is audited like an edit of the order’s code. It is safe to repeat: a second run assigns nothing. dryRun defaults to true, so a call without it only previews; the response counts the orders per company and per skip reason and lists a sample of the codes. 404 when clientId is not a company of the workspace. Requires the settings.manage permission.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
Limits the run to the orders of this company; omit it to cover the workspace.
When true (the default) nothing is written and the response says what would be assigned. Send false to assign the codes.
Responses
Section titled “Responses”What was assigned, or would be on a dry run.
object
What assigning codes to the orders that have none did, or would do.
object
Orders given a code, or that would be on a dry run.
The first 25 of the bracketFallbacks orders, by id and name. Absent on an older server.
object
Orders that wanted the code their name starts with and were numbered as usual, because another order holds it or an older order of the run names it first.
Of the assigned orders, those that took the code their name starts with.
The counts per company that had orders without a code.
object
Only the reasons that apply to this company.
object
True when nothing was written.
Orders without a code when the run started, within the company asked for.
A few of the codes: the oldest orders of several companies, then a few that took the code of their name.
object
True when the code is the one the order’s name starts with.
The code given, or that would be.
Orders left without a code.
The skipped orders by why they could not be coded.
object
Example generated
{ "data": { "assigned": 1, "bracketFallbackOrders": [ { "orderId": "example", "orderName": "example" } ], "bracketFallbacks": 1, "bracketed": 1, "companies": [ { "assigned": 1, "clientId": "example", "clientName": "example", "prefix": "example", "skipped": 1, "skippedByReason": { "CODES_DISABLED": 1, "CODE_TAKEN": 1, "NO_COMPANY_PREFIX": 1, "NO_TYPE_CODE": 1 } } ], "dryRun": true, "missing": 1, "sample": [ { "bracketed": true, "clientName": "example", "code": "example", "orderId": "example", "orderName": "example" } ], "skipped": 1, "skippedByReason": { "CODES_DISABLED": 1, "CODE_TAKEN": 1, "NO_COMPANY_PREFIX": 1, "NO_TYPE_CODE": 1 } }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Not found.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC