Orders

Return order lines

Marks the returning material as returned: which line, how many units and in what condition.

Tool
filmo_orders_line_items_return
Access: Destructive

Result

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "filmo_orders_line_items_return",
    "arguments": {
      "items": [
        {
          "lineItemId": "line_8f2a1c",
          "checkInQuantity": 1,
          "returnCondition": "good"
        }
      ],
      "idempotencyKey": "<a UUID you generate>"
    }
  }
}

generated from the schema

Send your own idempotencyKey

A retry without the same key duplicates the effect. Send your own idempotencyKey (a UUID) and resend the same one if you retry.

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/requiresUserInteraction"], which clients that honor it use to ask a person before every call.

It hangs off the resource and not off an order because an unload crosses orders, which is what this call resolves at once. Send Idempotency-Key: returning the same line twice would put the material into the pool twice, and each line goes at most once per request (add up its quantities). It is a batch: atomic is true by default, so a line that cannot be returned rejects the whole batch with 409 and one issue per failing line, touching nothing; with atomic: false each order is processed on its own and the response is 207 with one result per element, where the failed ones were not returned and the rest HAVE been. On success the response is 200 with one result per element, in request order.

Arguments

itemsobject[]Required

Lines being returned. At least one, at most 500, each line at most once.

Limits: min 1 items, max 500 items

Show child attributes
items.lineItemIdstringRequired

Order line being returned.

Limits: min length 1

items.checkInQuantitynumberRequired

Units being returned, at least one. It can be a partial return.

Limits: min 1

items.returnConditionstringRequired

Physical condition the material comes back in: good, damaged, lost, needs_repair or incident.

Available options: good, damaged, lost, needs_repair, incident

checkedInAtstring<date-time>

Effective date of the return, in ISO 8601 with offset. Defaults to now.

atomicbooleandefault:true

All or nothing (default true): if any line cannot be returned, none is, and the response is 409 with one issue per line. With false, each order is processed on its own, the response is 207 and every element carries its own status.

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

Result

On success the result carries structuredContent with data and meta. These are the attributes of data.

Show the attributes of data
indexinteger

Position of the element in the request array.

idstring

Identifier of the element as it was sent.

statusstring

returned or failed.

Available options: returned, failed

errorobject | null

Why it failed; null when returned.

Show child attributes
error.codestring

Stable error code of the element, from the same catalog as errors[].

error.messagestring

Localized reason.

An error is a result with isError: true and the problem in content[0].text; there is no structuredContent. See Errors.

The same operation by REST

This tool runs POST /api/v1/orders/line-items/returns.

  • Orders

    Return order lines

    Marks the returning material as returned: which line, how many units and in what condition.

  • 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.