Correct a balance entry
curl --request PATCH \ --url https://example.com/api/v1/orders/example/balance-entries/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "effectiveAt": "example", "hours": 1, "invoiceId": "example", "kind": "EXTRA_BLOCK", "linkedOrderId": "example", "note": "example" }'Changes only the fields sent: kind, hours, effectiveAt, note, invoiceId and linkedOrderId. A credit, extra block, return or adjustment takes every field, and a kind change is limited to those four with the new kind’s sign rule. An overage forgiveness takes hours, effective date and note. Each half of an overage carried between orders (carry set) takes only a note, which is applied to both halves and audited on both orders; it is refused with 422 unless the caller can reach both orders. invoiceId links the entry to another issued invoice of the order’s client, or unlinks it with null. A deduction, a legacy release that holds an invoice and a voided entry cannot be edited, and the entry must belong to the order in the path. A body with no field is rejected with 400. Every change is audited with its previous and new value. Requires orders.edit and orders.unlock_audit (held by owners and admins), plus invoices.view when invoiceId is a string.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Order identifier (CUID2).
Order identifier (CUID2).
Balance entry identifier (CUID2).
Balance entry identifier (CUID2).
Request Body
Section titled “Request Body”Only the fields sent change. A deduction, a legacy release and a voided entry cannot be edited; each half of a carried overage accepts only a note.
object
ISO 8601 date the movement takes effect. A bare YYYY-MM-DD day is midnight in the workspace timezone.
Signed hours; the kind’s sign rule applies.
Moves the entry to another manual kind; the new kind’s sign rule applies.
Null or empty clears the note.
Responses
Section titled “Responses”The corrected entry.
object
A dated, signed movement on an order’s hour budget. Entries are voided, never deleted.
object
Set on the two halves of an overage carried between orders; voiding one half voids the other.
object
in: overage carried into this order from order; out: this order’s overage carried into order.
object
Signed hours; grants are positive, returns negative.
CREDIT, EXTRA_BLOCK, RETURN, OVERAGE_FORGIVENESS, ADJUSTMENT, or OVERAGE_DEDUCTION (only created via POST /orders/{id}/overage-deductions or POST /orders/{id}/overage-carries).
Sent by a write that 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.
Why the entry was voided; set on every void made through Chelsea or API.
Example
{ "data": { "carry": { "direction": "in" } }}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 entry cannot be edited, a correction breaks its kind’s rules, or the invoice is not linkable.
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