Orders
Reserve an order
Moves the order to reserved: checks the stock of each line, deducts it and creates the delivery and return tasks.
orders:writeResult
generated from the schema
It takes no body. If there is not enough stock it responds 409 insufficient_stock, and errors[] carries one entry per short item or space (path is items or spaces, with itemId, requested, available and shortfall). A serial number already assigned to another order, an order that is not a draft (prepared_partially, prepared, picked_up_partially, picked_up, returned_partially, returned, checked_in_partially, checked_in or cancelled: the problem names its status), a sale line without source warehouse or another write on the order in progress respond 409 conflict. In every case nothing is reserved. 404 if the order does not exist, belongs to another account or is archived. Reserving an order that is already reserved is not an error: it changes nothing and responds 200 with meta. 0 (or the delivery and return tasks it had to restore, if some were missing). meta. says how many tasks were born, because your schedule changes with this call. It is undone with /unreserve. 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.
Sample prompts
Reserve the draft order I just created.
The same operation by REST
This tool runs POST /api/v1/orders/{orderId}/reserve.
Related pages
Link to this section: Related pagesOrders
Reserve an order
Moves the order to
reserved: checks the stock of each line, deducts it and creates the delivery and return tasks.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?