Restore an archived order type
curl --request POST \ --url https://example.com/api/v1/order-types/example/restore \ --header 'Authorization: Bearer <token>'Brings an archived order type back after the last active one. Restoring an active type succeeds without change. Requires the settings.manage permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Resource identifier (CUID2).
Resource identifier (CUID2).
Responses
Section titled “Responses”The restored order type.
object
A workspace order type: one behavior with its name, code and default report range. Six system types are provisioned.
object
The axes as stored, one per rule an order of the type runs on. Each axis is optional: null takes the preset of the type’s behavior, and the response’s effectiveAxes shows the value an order of the type actually runs on. A combination no order can run is refused with reason INVALID_AXES. Once an order uses the type, its budget, renewal, payment, pricing, billable and overage axes are locked (reason AXES_IN_USE).
object
What an order of the type does. SUBSCRIPTION (Subscription): Renews each period on its renewal day. HOUR_BLOCK (Hour block): Prepaid hours used up over time. Extra blocks and overage can move to a new order. SPRINT (Sprint): Fixed scope with prepaid hours. Overage is absorbed and never billed. TIME_AND_MATERIALS (Time & Materials): No budget. Billed afterwards from the time logged. TOKENS (Tokens): Prepaid tokens. Each root task linked to the order uses one. NON_BILLABLE (Non billable): Time that is not charged, against a monthly budget.
Whether POST /orders accepts this type as orderTypeId: it is active and its behavior can open orders. Only types whose behavior is HOUR_BLOCK, SPRINT, SUBSCRIPTION or NON_BILLABLE can open orders today; each type’s canOpenOrders says whether it can.
The axes an order of the type runs on: each stored axis, or the preset of the behavior where it is null. A few stay null by design, such as the unit name of an hours budget.
object
System types (one per behavior) can be renamed and recoded but never archived, and keep their behavior.
Display order, ascending.
The default window an order’s hours report opens on. ORDER_START: Runs from the order start to today, or to its end date once that has passed. CURRENT_PERIOD: The order’s current budget period. CURRENT_MONTH: The current calendar month.
Revenue account for invoice lines of this type’s orders with no service; null when the type has none. New invoice lines for an order of this type with no service start on this account; a custom type with none uses the account of the system type of the same behavior.
Example
{ "data": { "axes": { "budgetUnit": "HOURS", "consumptionRule": "ROOT_TASK_CREATED", "defaultOveragePolicy": "CARRY_OVER", "formEndDate": "REQUIRED", "invoiceAttach": "EXTRA_BLOCK", "invoiceRequirement": "REQUIRED", "overageKind": "MANAGED", "payment": "PREPAID", "ratePricing": "SNAPSHOT", "recurrence": "RENEWAL" }, "behavior": "SUBSCRIPTION", "effectiveAxes": { "budgetUnit": "HOURS", "consumptionRule": "ROOT_TASK_CREATED", "defaultOveragePolicy": "CARRY_OVER", "formEndDate": "REQUIRED", "invoiceAttach": "EXTRA_BLOCK", "invoiceRequirement": "REQUIRED", "overageKind": "MANAGED", "payment": "PREPAID", "ratePricing": "SNAPSHOT", "recurrence": "RENEWAL" }, "reportRange": "ORDER_START" }}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: no such order type in this workspace.
Error envelope whose reason names the order type rule that was broken.
object
object
Stable machine-readable error code.
With AXES_IN_USE: the locked axes the request tried to change.
Human-readable error message.
Stable code for the rule an order type request broke.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED", "reason": "NOT_FOUND" }}DUPLICATE_NAME: an active type took the name meanwhile.
Error envelope whose reason names the order type rule that was broken.
object
object
Stable machine-readable error code.
With AXES_IN_USE: the locked axes the request tried to change.
Human-readable error message.
Stable code for the rule an order type request broke.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED", "reason": "NOT_FOUND" }}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