Create an order
curl --request POST \ --url https://example.com/api/v1/orders \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "clientId": "example", "clientPrefix": "example", "code": "example", "color": "example", "endsAt": "example", "expiryDate": "example", "hourlyRate": 1, "invoiceId": "example", "isInternal": true, "name": "example", "notes": "example", "orderTypeId": "example", "overagePolicy": "CARRY_OVER", "projectId": "example", "recurringInterval": "WEEKLY", "recurringIntervalCount": 1, "startsAt": "example", "totalHours": 1, "totalTokens": 1 }'Creates an order for a client. Send orderTypeId (a type from GET /order-types): its behavior decides the order’s dates, budget, recurrence and overage policy, and the order gets a generated code <company prefix>-<type code>-<n> (like ACME-HOURS-6) and a generated name unless code or name is sent. Only types whose behavior is HOUR_BLOCK, SPRINT, SUBSCRIPTION or NON_BILLABLE can open orders today; each type’s canOpenOrders says whether it can. A company without a prefix needs clientPrefix (saved on the company; needs clients.edit) unless code is sent. The rate comes from the company: its rate on the start date, else the workspace default, reported in rateSource; hourlyRate is an optional override for a price agreed for this order, and a NON_BILLABLE order takes no rate. The client must be one the caller reaches. Order access is direct (OrderMember) or inherited from the client. An order rule failure names the rule in reason; one about specific body fields, a malformed or taken clientPrefix included, lists them in fieldErrors. Requires the orders.create permission.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
Prefix to save on a company that has none (2 to 10 letters or digits); needs the clients.edit permission. A company without a prefix gets one asked for when the caller can edit companies, unless code is sent; otherwise the order is saved without a code.
Overrides the generated code <company prefix>-<type code>-<n>; an order sent with its own code gets no number. Another order of the workspace may not already use it as its code or alias, ignoring case (422 ORDER_CODE_TAKEN).
End date. Required for a Sprint, optional for an Hour block and ignored by the other behaviors.
Optional override of the order’s rate per hour. Without it the order takes the company’s rate on its start date, or the workspace default when the company has none, and reports where it came from in rateSource; with neither, a billable order is refused with RATE_REQUIRED. Read the company’s rate with list-client-rates (needs invoices.view) and set it with set-client-rate (needs invoices.manage); send this only for a price agreed for this order. A NON_BILLABLE order is cost-only: it takes no rate, and an hourlyRate sent for it is not stored.
The invoice that sells the order. A Subscription, Hour block, Sprint or Tokens order needs one (422 INVOICE_REQUIRED without it); Non billable and Time & Materials take none. It must belong to the order’s company, not be cancelled and sell no other order; for an order counted in hours it must also sell hours: a line of a service or package that defines hours, or a line without a service. The caller needs invoices.view and reach to it (403 INVOICE_FORBIDDEN, 404 INVOICE_NOT_FOUND, 422 ORDER_CLIENT_MISMATCH or INVOICE_NOT_LINKABLE, 409 INVOICE_SELLS_ANOTHER_ORDER). The invoice is stored as the order’s source invoice.
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.
Overrides the generated name, which reads <type name> | <start>, <type name> | <start> – <end>, or Subscription | Renews on the 26th.
The workspace order type to open the order on (see GET /order-types); its behavior decides the order’s dates, budget, recurrence and overage policy. Only types whose behavior is HOUR_BLOCK, SPRINT, SUBSCRIPTION or NON_BILLABLE can open orders today; each type’s canOpenOrders says whether it can. Another type, or one outside the workspace, is refused.
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. Only a Subscription chooses it (CARRY_OVER or RESET); the other behaviors fix it.
The company’s project the order is linked to as its PRIMARY project, whose tasks’ time counts against it. Left out, the company’s only unarchived project when it has exactly one, else none; null links none. Another company’s or an archived project is refused (422 PROJECT_NOT_FOUND).
How often a Subscription renews (default MONTHLY).
Periods between renewals, 1 to 12. Defaults to 1.
Start date. It defaults to today, and a Subscription renews on its day.
Hours the order sells, or per period on a recurring one. Required for an hours budget (Subscription, Hour block, Sprint, Non billable).
Tokens of a Tokens order; ignored by every other behavior.
Responses
Section titled “Responses”The created 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" }}The caller lacks orders.create, or sent clientPrefix without clients.edit (CLIENT_PREFIX_FORBIDDEN).
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" }}ORDER_TYPE_NOT_FOUND (no active order type with that id in the workspace) or CLIENT_NOT_FOUND (the client does not exist, or is outside the workspace or the caller’s reach: one answer for both).
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" }}clientPrefix is already used by another company (fieldErrors.clientPrefix).
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" }}INVALID_ORDER_TYPE (the type’s behavior cannot open orders yet), INVALID_ORDER_FIELDS (a field the behavior needs is missing or wrong, see fieldErrors), ORDER_CODE_TAKEN (code is already another order’s code or alias in the workspace, ignoring case; fieldErrors.code names that order), CLIENT_PREFIX_REQUIRED (the company has no prefix and the caller can edit companies), a malformed clientPrefix, RATE_REQUIRED (a billable order with no company rate, no workspace default and no hourlyRate, see fieldErrors.hourlyRate), OVERAGE_POLICY_CONFLICT or PROJECT_NOT_FOUND (projectId is not an unarchived project of the order’s company).
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