Orders
Cancel an order
Cancels the order and releases what it had reserved: frees the stock, cancels the logistics tasks —preparation, shipping and pickup— and marks the linked documents.
orders:writeorders:write- 120/min
- Server annotation: Destructive
- Requires human confirmation
- Not reversible
Result
generated from the schema
Not reversible
This tool cannot be undone.
Requires human confirmation
Put this tool on your client's “ask before running” list. The annotations are hints that the server declares, not guarantees: do not decide the approval from destructiveHint alone. The server flags this tool with _meta["anthropic, which clients that honor it use to ask a person before every call.
meta. says how many tasks were cancelled, because your schedule changes with this call. It is NOT reversible from the API: to have it back you have to duplicate it (/unreserve on a cancelled order responds 409 conflict, it does not return it to draft). An order already checked in (checked_in) cannot be cancelled (409 conflict, naming its status); one already cancelled is returned as it is. 404 if the order does not exist, belongs to another account or is archived. Returns the full order, the same projection as its GET.
Arguments
Order identifier.
Limits: min length 1
Idempotency key chosen by the client (a UUID is recommended). Repeating the same key with the same arguments within 24 h returns the stored response without executing again; with different arguments it responds 422. It is the safe way to retry after a network failure.
Limits: min length 1, max length 255
Optimistic locking: the meta.etag you got from the detail read of this resource (or "*"). If the resource changed since, the call fails with 412 precondition_failed before writing anything; read it again and retry. Omit it to write unconditionally.
Limits: min length 1
Result
On success the result carries structuredContent with data and meta. These are the attributes of data.
Show the attributes of data
Unique order identifier.
Human-readable order number.
External reference of the order (for example, from the customer system); null if not recorded.
Raw order status as stored in the database (12 values): draft, reserved, prepared_partially, prepared, picked_up_partially, picked_up, returned_partially, returned, checked_in_partially, checked_in, archived or cancelled. archived is part of the stored set but an archived order is not visible to the API, so you will not observe it.
Available options: draft, reserved, prepared_partially, prepared, picked_up_partially, picked_up, returned_partially, returned, checked_in_partially, checked_in, archived, cancelled
Start of the rental period in ISO 8601 with offset.
End of the rental period in ISO 8601 with offset.
Number of billable rental days; null if not calculated.
Identifier of the project the order belongs to; null if not linked.
Name of the project the order belongs to; null if not linked.
Compact reference to the order contact; null if none.
Show child attributesHide child attributes
Unique contact identifier.
Contact name.
Number of items in the order.
Subtotal before discounts and taxes, as a decimal string "1234.50" (ROUND_HALF_UP).
Limits: pattern ^-?\d+\.\d{2}$
Total discounts as a decimal string "1234.50" (ROUND_HALF_UP); null if there is no discount.
Limits: pattern ^-?\d+\.\d{2}$
Insurance total as a decimal string "1234.50" (ROUND_HALF_UP).
Limits: pattern ^-?\d+\.\d{2}$
Deposit total as a decimal string "1234.50" (ROUND_HALF_UP).
Limits: pattern ^-?\d+\.\d{2}$
Tax total as a decimal string "1234.50" (ROUND_HALF_UP).
Limits: pattern ^-?\d+\.\d{2}$
Taxable base (net before taxes) as a decimal string "1234.50" (ROUND_HALF_UP).
Limits: pattern ^-?\d+\.\d{2}$
Total including taxes, as a decimal string "1234.50" (ROUND_HALF_UP).
Limits: pattern ^-?\d+\.\d{2}$
Custom field values by custom field identifier; the definitions are in /api.
Source the order was created from (for example web, mobile, admin); null if not recorded.
Creation date in ISO 8601 with offset.
Last update date in ISO 8601 with offset.
Billing address of the order; null if none.
Show child attributesHide child attributes
Descriptive label of the address; null if not recorded.
First address line; null if not recorded.
Second address line; null if not recorded.
City; null if not recorded.
Province or region; null if not recorded.
Postal code; null if not recorded.
Country; null if not recorded.
Shipping address of the order; null if none.
Show child attributesHide child attributes
Descriptive label of the address; null if not recorded.
First address line; null if not recorded.
Second address line; null if not recorded.
City; null if not recorded.
Province or region; null if not recorded.
Postal code; null if not recorded.
Country; null if not recorded.
Contact person linked to the order; null if none.
Show child attributesHide child attributes
Unique contact identifier.
Contact name.
Informational references to quotes generated from the order.
Show child attributesHide child attributes
Unique identifier of the referenced document.
Document number; null until it is numbered.
Document status at the time the reference was written; null if not recorded. Informational: it may be out of date.
Informational references to invoices generated from the order.
Show child attributesHide child attributes
Unique identifier of the referenced document.
Document number; null until it is numbered.
Document status at the time the reference was written; null if not recorded. Informational: it may be out of date.
Informational references to proformas generated from the order.
Show child attributesHide child attributes
Unique identifier of the referenced document.
Document number; null until it is numbered.
Document status at the time the reference was written; null if not recorded. Informational: it may be out of date.
An error is a result with isError: true and the problem in content[0].; there is no structuredContent. See Errors.
The same operation by REST
This tool runs POST /api/v1/orders/{orderId}/cancel.
Related pages
Link to this section: Related pagesOrders
Cancel an order
Cancels the order and releases what it had reserved: frees the stock, cancels the logistics tasks —preparation, shipping and pickup— and marks the linked documents.
Guides
Safe writes
An assistant that can write can also write the wrong thing. Decide which tools need a person, retry without duplicating, and know what a write sets in motion.
Guides
Errors
A tool error is a result with
isError: trueand the problem in the first text block. Branch on itscode.
Was this page helpful?