Purchase orders

Receive material from a purchase order

Declares what arrived and in what quantity, line by line.

Tool
filmo_purchase_orders_receive
Access: Destructive

Result

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "filmo_purchase_orders_receive",
    "arguments": {
      "purchaseOrderId": "purc_8f2a1c",
      "lines": [
        {
          "lineId": "line_8f2a1c",
          "receivedQuantity": 1,
          "newStockReceived": 1,
          "notes": "<notes>"
        }
      ],
      "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.

newStockReceived registers NEW inventory, so always send the Idempotency-Key header: without it, a retry duplicates the stock. The order may end up partially received. The line identifier is lineId. Returns the full purchase order, the same projection as its GET. meta.receivedLines says how many lines the call declared as received. A draft or cancelled order responds 409 conflict.

Arguments

purchaseOrderIdstringRequired

Purchase order identifier.

Limits: min length 1

spaceIdstring

Warehouse where the material comes in. Defaults to the warehouse of the account.

linesobject[]Required

Received lines. At least one.

Limits: min 1 items

Show child attributes
lines.lineIdstringRequired

Purchase order line being received.

Limits: min length 1

lines.receivedQuantitynumberRequired

Units received for that line.

Limits: min 0

lines.newStockReceivednumber

Of those received, how many register new inventory.

Limits: min 0

lines.notesstring

Reception notes.

Limits: max length 1000

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 purchase order identifier.

poNumberstring | null

Purchase order number; null while it is a draft.

statusstring

Purchase order status.

Available options: draft, pending, completed, cancelled

typestring

Purchase order type.

Available options: subrental, stock_purchase, resale_purchase, consumable_purchase, technician, transport, repair, consignment

isDraftboolean

true if the purchase order is still a draft.

poDatestring<date-time> | null

Purchase order date in ISO 8601 UTC; null if not set.

supplierIdstring | null

Supplier identifier; null while a draft has no supplier. Resolve it against /api/v1/contacts.

referencestring | null

Free-form reference of the purchase order; null if it has none.

currencystring

Currency of the purchase order, as an ISO 4217 code.

subTotalstring

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

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

discountTotalstring

Discount total, as a decimal string "1234.50".

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

taxesPricestring

Tax total, as a decimal string "1234.50".

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

netPricestring

Taxable base, as a decimal string "1234.50".

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

grossPricestring

Total including taxes, as a decimal string "1234.50".

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

totalPaidstring | null

Amount already paid, as a decimal string "1234.50"; null if no payment has been recorded.

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

orderIdstring | null

Associated rental order; null if it has none.

orderNumberstring | null

Number of that order; null if it has none.

projectIdstring | null

Associated project; null if it has none.

repairTicketIdstring | null

Repair ticket that originated the purchase; null if it does not come from one.

notesstring | null

Purchase order notes; null if it has none.

createdAtstring<date-time>

Creation date in ISO 8601 UTC.

updatedAtstring<date-time>

Last modification date in ISO 8601 UTC.

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/purchase-orders/{purchaseOrderId}/receive.

  • Purchase orders

    Receive material from a purchase order

    Declares what arrived and in what quantity, line by line.

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