Create a draft invoice
curl --request POST \ --url https://example.com/api/v1/invoices \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "clientId": "example", "commissionDurationMonths": 1, "commissionDurationRule": "ALWAYS", "contactId": "example", "currency": "USD", "discount": 1, "dueDate": "example", "issueDate": "example", "lineItems": [ { "description": "example", "discountPercent": 1, "exception": true, "kindId": "example", "note": "example", "orderId": "example", "periodEnd": "2026-04-15", "periodStart": "2026-04-15", "pricingOptionId": "example", "quantity": 1, "rate": 1, "revenueAccountId": "example", "serviceId": "example", "teamId": "example" } ], "notes": "example", "order": { "kind": "pending" }, "poNumber": "example", "subject": "example", "taxRate": 1 }'Creates a DRAFT invoice for a client, addressed to contactId or, left out, to the company’s primary user. taxRate and discount are percentages (0-100). Optional lineItems (at most 100) are created with the invoice in one transaction: a line may name a serviceId (and a pricingOptionId package) to take its description, quantity and rate from the service, and may set a discountPercent, note, a periodStart/periodEnd service period, a revenueAccountId and a teamId. An invoice takes line discounts or an invoice-wide discount, never both: sending both refuses the request with 409 DISCOUNT_CONFLICT. A line naming a service, package, order, line kind, revenue account or team outside the workspace refuses the whole request and nothing is created. order is required while the Orders module is on: kind: pending leaves it To be confirmed and notifies the members who can settle it, none says it has no order, new opens a new order that starts on the invoice date, takes the invoice as its source and gets a generated code, and existing adds the invoice to an active Hour block or Sprint (an extra block of hours; a Sprint also takes 0 hours, as an installment that adds none) or to the current period of an active Subscription, in the same transaction. The order must be of the invoice’s company, and lineItems may be left out. A refused order leaves no invoice behind and answers with a reason. Requires the invoices.create permission, plus orders.create for kind: new or orders.edit and reach to the order for kind: existing. The company must be one the caller reaches: one they are assigned to, or any with clients.view_all or invoices.view_all.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
Discount on the whole invoice as a percentage (0-100). Refused with 409 DISCOUNT_CONFLICT while any line carries a discountPercent: an invoice takes one kind of discount or the other. Sending it with lines that carry a discountPercent refuses the whole request.
Due date (YYYY-MM-DD), resolved at workspace-local midnight. Left out, it is counted from the issue day in the workspace calendar: the invoice settings’ firstInvoiceDueDays for the company’s first invoice (none of its invoices sent, viewed, paid or overdue, and no other invoice but a cancelled one, drafts included, issued that day or before), else the company’s own payment terms, else the workspace’s paymentTermsDays. A date sent that departs from that rule is kept as sent, and the answer carries dueDateNotice.
Issue date (YYYY-MM-DD), resolved at workspace-local midnight.
Lines to create with the invoice, in one transaction: the invoice and every line are saved, or none, up to 100 lines. A line naming an unknown service, package, revenue account or team refuses the whole request.
object
Line description. Required for a Custom line; with serviceId it is ignored while the workspace locks the description, unless exception is true.
Send true to change a field the workspace locks on a service line (see lockedLineFields in the invoice settings): the change is then applied, the field is recorded as edited by hand and the audit entry carries it. Without it, changing a locked field is refused with 409 FIELD_LOCKED. A locked description is left as the service set it. Custom lines are never locked.
A note the client sees under the line description.
Quantity. Required for a Custom line; with serviceId it defaults from the service.
Unit rate. Required for a Custom line; with serviceId it defaults to the company rate in force on the issue date, else the service base hourly rate.
The service this line is built from. The description is then set from the service name (plus the package label); a description sent is ignored while the workspace locks the description, unless exception is true. Null or omitted makes a Custom line, whose every field is yours.
The order of the invoice, required while the Orders module is on and refused while it is off. kind is pending (To be confirmed: accounting assigns the order later, and the members holding invoices.manage and orders.edit are notified), none (no order), new (open a new order this invoice sells: it starts on the invoice date, takes the invoice as its source and gets a generated code; needs orders.create) or existing (add the invoice to an open order of the company, the payment of its current period for a Subscription; needs orders.edit and reach to the order). A new or existing order runs in the same transaction as the invoice and its lines, so a refused order leaves no invoice behind, and lineItems may be left out.
object
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 the extra block the invoice adds to an Hour block or a Sprint, required for both: more than 0 for an Hour block, while 0 adds the invoice to a Sprint as an installment that adds no hours. Ignored for a Subscription, whose hours do not change.
An active Hour block, Sprint or Subscription of the invoice’s company that the member reaches.
Responses
Section titled “Responses”The created invoice, with its lines when the request sent lineItems, and dueDateNotice when the dueDate sent departs from the company’s terms.
object
The created DRAFT invoice. When the request carried lineItems, the totals include them and lineItems lists them.
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.
Present only when the request sent a dueDate that is not the day the company’s terms give for the issue day: the date was kept as sent, and this says what the terms give.
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 lines created with the invoice. Present only when the request sent lineItems.
A single line on an invoice. serviceId, service, revenueAccountId, revenueAccount, teamId, team, classSource and editedFields are staff-only: Customer MCP tokens, the portal, the public link and the PDF never carry them. Those surfaces carry listRate only when it is above rate.
object
Quantity times rate less discountPercent, rounded to the cent. The invoice subtotal is the sum of these net amounts.
Percentage taken off quantity times rate on this line; null for none. Never set on an invoice with an invoice-wide discount.
The locked fields of a service line (account, class, period, description) that were changed by hand with exception: true. Empty for a line nobody changed and for a Custom line. Staff only.
Invoice line item kind; null for free-form items.
The service’s standard hourly rate when the line was created. A client document shows it struck through only when it is above rate; null for a line with no standard rate.
A note the client sees under the description.
Zero-based sort position on the invoice.
Revenue account of the line. Staff only; null while unset.
The service the line was built from; null for a Custom line.
The team whose accounting class the line carries. Staff only; null while unset.
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
{ "data": { "lineItems": [ { "classSource": "RESOLVED" } ] }}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.create, or lacks orders.create / orders.edit for the order sent (reason ORDER_CREATE_FORBIDDEN or ORDER_EDIT_FORBIDDEN), or lacks 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" }}A line names a service, package, order, line kind, revenue account or team that does not exist, or kind: existing names an order the caller does not reach (ORDER_NOT_FOUND) or the order type does not exist (ORDER_TYPE_NOT_FOUND), or the request sends an order while 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 clientPrefix is already taken by another company (code ALREADY_EXISTS), or discount was sent with lines that carry a discountPercent (DISCOUNT_CONFLICT).
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 client does not belong to the active workspace or is out of the caller’s reach, issueDate or dueDate is not a YYYY-MM-DD date (VALIDATION_ERROR), contactId is not a user of that company, order is missing while the Orders module is on (VALIDATION_ERROR), or the order breaks a rule. reason is one of ORDER_CLIENT_MISMATCH, ORDER_NOT_ATTACHABLE, ORDER_TYPE_NOT_ALLOWED, ORDER_TYPE_REQUIRED, HOURS_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. When the workspace numbers invoices per company (invoiceNumberingMode COMPANY in the invoice settings), a company with no prefix cannot be numbered: the request is refused with reason COMPANY_PREFIX_REQUIRED, the message names the company and nothing is created.
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