Update an invoice line item
curl --request PATCH \ --url https://example.com/api/v1/invoices/example/line-items/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "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" }'Updates a line item on an invoice that is still in DRAFT status, including its discount percentage, service, package, note, service period, revenue account and class team. A null clears the field; a discountPercent is refused with 409 DISCOUNT_CONFLICT while the invoice has an invoice-wide discount. The fields the workspace locks on a service line (lockedLineFields in the invoice settings; the description by default) keep what the service filled: changing one answers 409 FIELD_LOCKED unless the body carries exception: true, which applies the change, records the field in editedFields and writes it to the audit entry. Money and content edits are refused once the invoice leaves DRAFT; a body carrying only periodStart, periodEnd (and exception) still applies to an issued invoice, except a CANCELLED one, exactly as the accounting endpoint does. To change only the revenue account and class on an invoice in any status, use PATCH /invoices/{id}/line-items/{lineItemId}/accounting. Requires the invoices.manage permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Resource identifier (CUID2).
Resource identifier (CUID2).
Line item identifier (CUID2).
Line item identifier (CUID2).
Request Body
Section titled “Request Body”object
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.
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.
Example generated
{ "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"}Responses
Section titled “Responses”The updated line item.
object
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.
Example
{ "data": { "classSource": "RESOLVED" }}The body is invalid, or the caller’s role holds invoices.accounting_required and the line would be saved with an amount but without a revenue account (and a class, when the workspace requires one).
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" }}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" }}The invoice or line item does not exist, or the update names a service, package, order, line kind, revenue account or team that does not exist.
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 left DRAFT status while the line was being edited, a period was sent for a CANCELLED invoice, a locked field of the service line was changed without exception: true (FIELD_LOCKED), or a discountPercent was sent while the invoice has an invoice-wide discount (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 invoice is not in DRAFT status and the body changes more than the service period.
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