Update an order
curl --request PATCH \ --url https://example.com/api/v1/orders/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "color": "example", "endsAt": "example", "expiryDate": "example", "hourlyRate": 1, "hoursChangeReason": "example", "isInternal": true, "isRecurring": true, "name": "example", "notes": "example", "orderTypeId": "example", "overagePolicy": "CARRY_OVER", "projectId": "example", "recurringInterval": "WEEKLY", "recurringIntervalCount": 1, "startsAt": "example", "status": "ACTIVE", "totalHours": 1 }'Requires the orders.edit permission. An included projectId sets or clears the order’s PRIMARY project link; it never touches secondary links. hourlyRate overrides the order’s rate (rateSource becomes OVERRIDE) unless it equals the stored rate, which changes nothing; omitting it leaves the rate as it is, so a legacy order that never had one stays editable. A prepaid order whose rate came from the company or the workspace default (rateSource COMPANY or WORKSPACE_DEFAULT) takes the rate in force on a new startsAt, refused with 422 RATE_REQUIRED when there is none. A prepaid order’s rate can be changed but not cleared: hourlyRate: null is refused with 422 on one that has a rate. Setting a rate on a billable order whose billingRateType is NONE moves it to ORDER. A NON_BILLABLE order takes no rate: any hourlyRate sent for it clears the rate it held (it is stored as null), and omitting hourlyRate leaves the order as it is. overagePolicy accepts CARRY_OVER, RESET or ABSORB; ABSORB only fits a fixed-scope order, so setting it on a recurring order, on an order that took an overage carried from another order (void that carry first), or making an ABSORB order recur, is refused with 422 (OVERAGE_POLICY_CONFLICT). A totalHours that differs from the order’s budget needs hoursChangeReason, refused with 422 (HOURS_CHANGE_REASON_REQUIRED) without it. An orderTypeId other than the order’s own needs the orders.change_type permission (403 ORDER_TYPE_CHANGE_FORBIDDEN) and one of the allowed moves: Hour block and Sprint swap, and Time & Materials becomes either with totalHours; anything else is refused with 422 (ORDER_TYPE_CHANGE_NOT_ALLOWED). An order whose type requires an end date (a Sprint) keeps it: endsAt: null on one, or a move to such a type without one, is refused with 422 (INVALID_ORDER_FIELDS). A price, hours or type refusal happens before a projectId in the same body is applied, so it leaves the primary project as it was. If the order’s name is still the one its type and old dates generated, a new startsAt or endsAt renames it to match; send name to set your own.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Resource identifier (CUID2).
Resource identifier (CUID2).
Request Body
Section titled “Request Body”object
An override of the order’s rate per hour, stored with rateSource OVERRIDE. Sending the stored rate again is no override and changes nothing. Omit it to leave the rate as it is; a rate taken from the company or the workspace default then follows a new startsAt. A prepaid order’s rate can be changed but not cleared: null is refused with 422 PRICE_REQUIRED on one that has a rate, while a legacy order that never had one can still be saved without it. On a Time & Materials order null drops the override, so its entries bill at the company rate of their day again (or the workspace default, which rateSource then reports). Setting a rate on a billable order whose billingRateType is NONE moves it to ORDER. On a NON_BILLABLE order, which is cost-only and takes no rate, any hourlyRate sent clears the rate it held (it is stored as null); omit it to leave the order as it is.
Why the order’s hours change; required whenever totalHours differs from the order’s current budget (422 HOURS_CHANGE_REASON_REQUIRED without it). It is the note of the ADJUSTMENT balance entry, or the audit entry’s metadata on a recurring order.
True for an order of the organization’s own work rather than a client’s. Time entries on it are left out of compliance auditing and the violation scan.
The type to move the order to; needs the orders.change_type permission (403 ORDER_TYPE_CHANGE_FORBIDDEN without it). Allowed: Hour block and Sprint swap, and Time & Materials becomes either one when totalHours is sent. A move to any other behavior is refused with 422 ORDER_TYPE_CHANGE_NOT_ALLOWED: create a new order. A Subscription comes only from POST /orders/{id}/subscription. The code stays, and the overage policy follows the new behavior (a Sprint absorbs it). A Sprint needs an end date.
Sets or clears the order’s PRIMARY project (null unassigns). Does not affect secondary links — see POST/DELETE /orders/{id}/projects for those.
A CLOSED order is never moved back to ACTIVE or DEPLETED here (409): POST /orders/{id}/reopen does that.
Responses
Section titled “Responses”The updated order.
object
A client order, opened on one of the workspace’s order types.
object
Activity types a time entry against this order may name. A time entry must carry one of these ids; ids are order-scoped, so one from another order is refused.
object
Billing rate source: NONE, ORDER, MEMBER or ACTIVITY_TYPE.
The fee budget. Absent when the caller lacks invoices.view, which alone shows what the agency charges.
Budget mode, e.g. TOTAL_ORDER_FEES or FEES_PER_ACTIVITY_TYPE.
The company’s people emailed when the team posts a client-visible message on the order: of the invited, active contacts who can open it in the portal, every Hours holder, else the primary contact, else the oldest one, less those whose own notification preference turns that email off. Internal notes reach nobody. Returned by get only.
object
Why this person receives the order’s chat: they hold the company’s Hours role, or nobody who can open the order does and they are the company’s primary contact, else its oldest invited contact.
The order’s rate per hour. A prepaid order keeps the rate it opened with; a Time & Materials order without an override holds none, since each entry bills at the company rate of its day. Absent when the caller lacks invoices.view, which alone shows what the agency charges.
True when the order has no primary project, so it sits in its company’s General section, as the company’s Orders tab marks it. Returned by the list only; absent on an older server.
True for an order of the organization’s own work rather than a client’s. Time entries on it are left out of compliance auditing and the violation scan.
Sent when an update of the hours leaves linked adjustments out of step. Absent otherwise and on an older server.
object
Orders linked further along the chain.
object
object
The adjustment as it stands; null when the order is out of reach.
Null when the order is outside the caller’s reach.
Why a person has to decide; null when suggestedHours is set.
What it would become if a person confirms; null when left for a person.
Read-only notification recipients derived from the union of active client responsibles and responsibles of every linked project, deduplicated by member. Access grants do not define recipients.
object
Whether this notification recipient is responsible for a linked project or the client. Orders cannot assign responsibles.
What an order does with the hours it runs over: CARRY_OVER deducts a recurring order’s overrun from the next period; RESET starts every period at the full budget; ABSORB (fixed scope, non-recurring orders only) takes the overrun as a loss, never billed and never carried.
The order’s PRIMARY project — the one that counts for hour/amount totals. Null when the order has no primary membership (“Unassigned”).
The name of the primary project, when the caller reaches that project; null otherwise. Returned by the list only; absent on an older server.
Every project this order is linked to (Order <-> Project is N:M via OrderProject).
Order status: ACTIVE, DEPLETED, CLOSED, ARCHIVED, or PENDING (a portal purchase awaiting Stripe payment confirmation — not settable directly through this API).
The order’s subscription, when the order was opened from a recurring service.
The subscription that owns a recurring order’s state and billing period.
object
How each cycle is collected. CHARGE_AUTOMATICALLY sends the cycle invoice and charges the card on file; SEND_INVOICE only sends the invoice with its payment link, due by the company’s payment terms, and is never charged or retried.
The company user its cycle invoices are addressed to; null addresses the company’s Billing contact, else its primary user.
The coupon still discounting this subscription’s renewals, or null once a REPEATING coupon has used up its cycles. Absent when the caller lacks invoices.view, which alone shows what the agency charges.
Whether the client has a usable saved payment method, from a live Stripe check. Always null on GET /orders (list) — only the single-order GET /orders/{id} affords it.
Printed in the notes of every cycle invoice it generates.
What every cycle invoice bills; renewalPrice is their sum. Empty bills renewalPrice as one line named after the order. Absent when the caller lacks invoices.view, which alone shows what the agency charges.
object
What the line prints on every cycle invoice.
Percentage taken off the line, above 0 and below 100; null for none.
The next charge’s total after any active coupon discount and tax. Null on GET /orders (list), which never makes this per-row Stripe check; populated on GET /orders/{id}. Absent when the caller lacks invoices.view, which alone shows what the agency charges.
What each cycle bills. Absent when the caller lacks invoices.view, which alone shows what the agency charges.
Which day of its cycle invoice the subscription renews on. BILLING_DAY renews the day the invoice is issued; DUE_DATE, only with SEND_INVOICE, renews on its due date, the company’s net days (else the workspace’s) after it is issued. Changing it keeps the next invoice’s issue day and moves the next renewal by the net days.
The order’s behavior, which its type sets. 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.
Example
{ "data": { "clientMessageRecipients": [ { "reason": "hours_role" } ], "notificationRecipients": [ { "source": "project" } ], "orderType": { "behavior": "SUBSCRIPTION", "reportRange": "ORDER_START" }, "overagePolicy": "CARRY_OVER", "rateSource": "COMPANY", "recurringInterval": "WEEKLY", "subscription": { "collectionMethod": "CHARGE_AUTOMATICALLY", "coupon": { "discountType": "PERCENTAGE", "duration": "ONCE" }, "interval": "WEEKLY", "renewalTiming": "BILLING_DAY", "status": "ACTIVE" } }}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" }}The order has an active subscription. Cancel it with POST /orders/{id}/cancel-subscription before closing or archiving. Or the order is CLOSED and the update moves it back to ACTIVE or DEPLETED: reopen it with POST /orders/{id}/reopen.
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" }}The project was not found, the update would clear the rate of a prepaid order (PRICE_REQUIRED), it would leave a recurring or carried-into order absorbing its overage (OVERAGE_POLICY_CONFLICT), it names a move to another type the rules do not allow (ORDER_TYPE_CHANGE_NOT_ALLOWED), it changes the hours without a reason (HOURS_CHANGE_REASON_REQUIRED), it leaves an order whose type requires an end date without one (INVALID_ORDER_FIELDS), or it sets a code another order of the workspace already uses as its code or alias (ORDER_CODE_TAKEN, ignoring case; an unchanged code is never refused).
Error envelope whose reason names the order rule that was broken and whose fieldErrors names the body fields at fault; either is left out when it does not apply.
object
object
Stable machine-readable error code.
Message per body field at fault, keyed by the field’s name.
object
Human-readable error message.
Stable code for the order rule a request broke.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED", "reason": "CLIENT_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