Set an invoice's order
curl --request POST \ --url https://example.com/api/v1/invoices/example/order \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "none" }'Sets the order of an invoice of any origin, issued here or recorded as external: kind is existing (add it to an order of its company), new (open a new order it sells, starting on the invoice date; needs orders.create) or none (no order: removes it from the order it is in, which keeps its hours, and settles a To be confirmed order). Every kind clears To be confirmed and is recorded on the order’s change log. An invoice already in an order is refused for existing and new (409 INVOICE_SELLS_ANOTHER_ORDER): remove it first with none. A cancelled invoice cannot be added. Requires invoices.manage and orders.edit. A refusal carries a reason.
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
object
Prefix to save on a company that has none, so the order code can be generated. Needs clients.edit. A company without a prefix gets one asked for (422 CLIENT_PREFIX_REQUIRED) when the caller can edit companies; otherwise the order is saved without a code.
End date (YYYY-MM-DD). Required for a Sprint, ignored where the type has none.
Order name. Left out, it is generated from the type and the dates.
The workspace order type to open. Only Subscription, Hour block, Sprint and Tokens types can be opened from an invoice, and only the ones that can open orders today. Left out, the type the first line whose service names one carries; when no service does, the order is refused (422 ORDER_TYPE_REQUIRED).
What a Subscription does with its overage at renewal. Carry over when left out.
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).
Renewal interval of a Subscription. Monthly when left out.
Renew every this many intervals.
Hours the order holds. Left out for a type counted in hours, the order is refused. The order is priced at the company rate unless these hours differ from what the invoice’s net amount buys at that rate; then the order keeps the price the invoice agreed (net amount divided by hours).
Tokens the order holds. Required for a Tokens type.
object
Hours of an extra block the invoice adds to an active Hour block or Sprint. Leave it out when the order already counts the invoice’s hours, as an imported invoice’s order does; refused (422 ORDER_NOT_ATTACHABLE) for any other order.
Any order of the invoice’s company the member reaches, whatever its status. The order’s hours do not change unless hours is sent.
Exact end of the billing period, sent with periodStart.
Exact start of the billing period a recurring order’s invoice pays, with periodEnd (see GET /orders/{id}/period-summary). Left out, the invoice keeps its own period, else takes the one its issue date falls in; a period that is not one of the order’s is refused (422 INVALID_PERIOD). Ignored for an order that does not recur.
Responses
Section titled “Responses”The invoice with its order.
object
An invoice. Monetary amounts are numbers; dates are ISO 8601 strings.
object
Commission duration rule: ALWAYS, NEVER or FIRST_N_MONTHS.
The user of the invoice’s company it is addressed to (a contact id from GET /clients/{id}/contacts); it prints above the company’s name. Null addresses nobody.
ISO 4217 currency code.
Discount percentage (0-100); null when no discount applies.
Link to the document the originating system produced.
Source estimate when the invoice was converted from one.
The number the originating system gave it. For an EXTERNAL invoice this is also its number; null for SYSTEM.
Which system issued an EXTERNAL invoice, e.g. SPP or QuickBooks. Null for SYSTEM.
The import source (e.g. SPP) that wrote this invoice as one of the workspace’s own. Null for an invoice issued in Chelsea. An imported invoice keeps the notes it was sent with: the workspace’s note on every invoice is not printed on it.
True when the invoice bills a cycle of a client subscription (it has a subscriptionId).
The order this invoice sells or renews, when it has one.
SYSTEM for an invoice this workspace issued, EXTERNAL for one issued elsewhere and recorded here. An EXTERNAL invoice is never emailed, rendered to PDF, charged, published or made recurring.
Whether payment reminders are paused for this invoice alone. A paused company pauses all of its invoices regardless of this flag.
Invoice status: DRAFT, SENT, VIEWED, OVERDUE, PAID or CANCELLED.
Tax rate as a percentage (0-100); null when the invoice has no tax rate.
Example generated
{ "data": { "amountPaid": 1, "clientId": "example", "commissionDurationMonths": 1, "commissionDurationRule": "example", "contactId": "example", "createdAt": "2026-04-15T12:00:00Z", "currency": "example", "discount": 1, "discountAmount": 1, "documentUrl": "example", "dueDate": "2026-04-15T12:00:00Z", "estimateId": "example", "externalNumber": "example", "externalSource": "example", "id": "example", "importedFrom": "example", "isRecurring": true, "issueDate": "2026-04-15T12:00:00Z", "notes": "example", "number": "example", "orderId": "example", "orderPendingAt": "2026-04-15T12:00:00Z", "origin": "example", "paidAt": "2026-04-15T12:00:00Z", "paymentRemindersPaused": true, "paymentRemindersPausedAt": "2026-04-15T12:00:00Z", "periodEnd": "2026-04-15T12:00:00Z", "periodStart": "2026-04-15T12:00:00Z", "poNumber": "example", "sentAt": "2026-04-15T12:00:00Z", "status": "example", "subject": "example", "subtotal": 1, "taxAmount": 1, "taxRate": 1, "total": 1, "updatedAt": "2026-04-15T12:00:00Z" }}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 invoices.manage or orders.edit, or orders.create for kind: new (reason ORDER_CREATE_FORBIDDEN), or clients.edit for a clientPrefix (CLIENT_PREFIX_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" }}The invoice (INVOICE_NOT_FOUND) or the order (ORDER_NOT_FOUND) is out of the caller’s reach, or the Orders module is off for the workspace (MODULE_DISABLED).
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 invoice is already in an order (INVOICE_SELLS_ANOTHER_ORDER): remove it with kind: none first; or the clientPrefix is taken (ALREADY_EXISTS).
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 request breaks a rule. reason is one of ORDER_CLIENT_MISMATCH, INVOICE_NOT_LINKABLE (cancelled invoice), INVALID_PERIOD, ORDER_NOT_ATTACHABLE (hours for an order that is not an active Hour block or Sprint), HOURS_REQUIRED, ORDER_TYPE_NOT_ALLOWED, ORDER_TYPE_REQUIRED, or an order-opening reason (INVALID_ORDER_TYPE, INVALID_ORDER_FIELDS, RATE_REQUIRED, PRICE_REQUIRED, CLIENT_PREFIX_REQUIRED, PROJECT_NOT_FOUND); fieldErrors names the fields at fault.
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