Orders

Reserve an order

Moves the order to reserved: checks the stock of each line, deducts it and creates the delivery and return tasks.

Tool
filmo_orders_reserve
Access: Write

Result

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "filmo_orders_reserve",
    "arguments": {
      "orderId": "orde_8f2a1c"
    }
  }
}

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.tasksCreated 0 (or the delivery and return tasks it had to restore, if some were missing). meta.tasksCreated 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

orderIdstringRequired

Order identifier.

Limits: min length 1

idempotencyKeystring

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

ifMatchstring

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
idstring

Unique order identifier.

orderNumberstring

Human-readable order number.

externalReferencestring | null

External reference of the order (for example, from the customer system); null if not recorded.

statusstring

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

startDatestring<date-time>

Start of the rental period in ISO 8601 with offset.

endDatestring<date-time>

End of the rental period in ISO 8601 with offset.

rentalDaysnumber | null

Number of billable rental days; null if not calculated.

projectIdstring | null

Identifier of the project the order belongs to; null if not linked.

projectNamestring | null

Name of the project the order belongs to; null if not linked.

contactobject | null

Compact reference to the order contact; null if none.

Show child attributes
contact.idstring

Unique contact identifier.

contact.namestring

Contact name.

itemsCountinteger

Number of items in the order.

subTotalPricestring

Subtotal before discounts and taxes, as a decimal string "1234.50" (ROUND_HALF_UP).

Limits: pattern ^-?\d+\.\d{2}$

discountTotalstring | null

Total discounts as a decimal string "1234.50" (ROUND_HALF_UP); null if there is no discount.

Limits: pattern ^-?\d+\.\d{2}$

insuranceTotalstring

Insurance total as a decimal string "1234.50" (ROUND_HALF_UP).

Limits: pattern ^-?\d+\.\d{2}$

depositTotalstring

Deposit total as a decimal string "1234.50" (ROUND_HALF_UP).

Limits: pattern ^-?\d+\.\d{2}$

taxesPricestring

Tax total as a decimal string "1234.50" (ROUND_HALF_UP).

Limits: pattern ^-?\d+\.\d{2}$

netPricestring

Taxable base (net before taxes) as a decimal string "1234.50" (ROUND_HALF_UP).

Limits: pattern ^-?\d+\.\d{2}$

grossPricestring

Total including taxes, as a decimal string "1234.50" (ROUND_HALF_UP).

Limits: pattern ^-?\d+\.\d{2}$

tagsobject[]

Tags attached to the order, with their identifier and name.

Show child attributes
tags.idstring

Unique identifier of the tag.

tags.namestring

Tag name.

customFieldsobject<string, any>

Custom field values by custom field identifier; the definitions are in /api/v1/custom-fields.

sourcestring | null

Source the order was created from (for example web, mobile, admin); null if not recorded.

createdAtstring<date-time>

Creation date in ISO 8601 with offset.

updatedAtstring<date-time>

Last update date in ISO 8601 with offset.

billingAddressobject | null

Billing address of the order; null if none.

Show child attributes
billingAddress.labelstring | null

Descriptive label of the address; null if not recorded.

billingAddress.addressLine1string | null

First address line; null if not recorded.

billingAddress.addressLine2string | null

Second address line; null if not recorded.

billingAddress.citystring | null

City; null if not recorded.

billingAddress.provincestring | null

Province or region; null if not recorded.

billingAddress.postcodestring | null

Postal code; null if not recorded.

billingAddress.countrystring | null

Country; null if not recorded.

shippingAddressobject | null

Shipping address of the order; null if none.

Show child attributes
shippingAddress.labelstring | null

Descriptive label of the address; null if not recorded.

shippingAddress.addressLine1string | null

First address line; null if not recorded.

shippingAddress.addressLine2string | null

Second address line; null if not recorded.

shippingAddress.citystring | null

City; null if not recorded.

shippingAddress.provincestring | null

Province or region; null if not recorded.

shippingAddress.postcodestring | null

Postal code; null if not recorded.

shippingAddress.countrystring | null

Country; null if not recorded.

contactPersonobject | null

Contact person linked to the order; null if none.

Show child attributes
contactPerson.idstring

Unique contact identifier.

contactPerson.namestring

Contact name.

quotesobject[]

Informational references to quotes generated from the order.

Show child attributes
quotes.idstring

Unique identifier of the referenced document.

quotes.numberstring | null

Document number; null until it is numbered.

quotes.statusstring | null

Document status at the time the reference was written; null if not recorded. Informational: it may be out of date.

invoicesobject[]

Informational references to invoices generated from the order.

Show child attributes
invoices.idstring

Unique identifier of the referenced document.

invoices.numberstring | null

Document number; null until it is numbered.

invoices.statusstring | null

Document status at the time the reference was written; null if not recorded. Informational: it may be out of date.

proformasobject[]

Informational references to proformas generated from the order.

Show child attributes
proformas.idstring

Unique identifier of the referenced document.

proformas.numberstring | null

Document number; null until it is numbered.

proformas.statusstring | null

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].text; 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.

  • Orders

    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: true and the problem in the first text block. Branch on its code.