Preview merging orders into this one
curl --request GET \ --url 'https://example.com/api/v1/orders/example/merge-preview?sourceIds=example' \ --header 'Authorization: Bearer <token>'Reports what merging sourceIds into order {id} would move (time entries, invoices and their lines, balance entries, overage allocations, projects, members, activity types, tickets, resources, estimate lines, reminders, messages, change log), what collapses into the kept order’s own rows, the ledger movement that adds each source’s bought hours, the kept order’s budget afterwards and every reason the merge would be refused, without writing anything. Every order must be of the same company and in the caller’s reach. A source with a subscription, an order waiting for its purchase to be paid, orders that differ in billability or budget unit, orders budgeted in tokens, an archived kept order, a source with an audited period and any date the merge would move into or out of locked time are refused. Requires the orders.edit and orders.delete permissions, since the source orders are deleted.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Resource identifier (CUID2).
Resource identifier (CUID2).
Query Parameters
Section titled “Query Parameters”The orders merged into this one and then deleted, at most 9. All must belong to the same company. Comma-separated order ids.
Whether each source’s purchased hours enter the kept order’s ledger. Turn a source off when it repeats the same purchase: its time, invoices and everything else still move. A source left out adds its hours. Comma-separated <sourceId>:false or <sourceId>:true pairs.
Responses
Section titled “Responses”The merge preview.
object
object
Every reason the merge would be refused. The merge runs only when it is empty.
object
object
object
Negative when the order is over budget.
The hours the order was bought with.
object
The kept order’s budget once merged.
object
Negative when the order is over budget.
The kept order’s aliases once merged: the merged orders’ codes, aliases and imported ids, so imports and searches still find them.
object
Whether its purchased hours are added.
Rows of the merged order that collapse into the kept order’s own (projects, members, activity types by name) or end with it (budget alerts, notice dismissals, unlocked audit periods, a second intake or estimate link, carries between the merged orders, which are voided).
object
Rows that move to the kept order, per relation.
object
The ledger movement that adds the merged order’s bought hours to the kept order: an extra block tied to the invoice that sold it, or an adjustment. Null for an order bought with no hours.
object
object
object
Negative when the order is over budget.
The hours the order was bought with.
Example
{ "data": { "sources": [ { "movement": { "kind": "ADJUSTMENT" } } ] }}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" }}The kept order or a source order is not found in reach.
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" }}No source, too many orders, the kept order named as a source, or a refusal listed above.
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