Record a purchase order
inventory_purchase_orderAfter order_execute confirms a supplier order, record the matching DRAFT purchase order in your own system so the books match. Always a draft: a person confirms it there. Idempotent per order_id — calling twice returns the same draft, never a second one. Needs both inventory and checkout permission. Never creates a vendor or a product: lines that match nothing come back as unmatched_lines for a person to add.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent_id": "<agent_id>",
"order_id": "<order_id>"
},
"name": "inventory_purchase_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent id; needs both inventory and checkout permission | |
| order_id | Yes | Conduit order id of a supplier order already placed with order_execute | |
| connection_id | No | Which connected system, when the org has several | |
| session_token | No | Session token from agent_authenticate — required whenever agent_id is passed |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | ||
| next | No | ||
| unit | No | ||
| draft | No | ||
| error | No | ||
| total | No | ||
| detail | No | ||
| vendor | No | ||
| currency | No | ||
| order_id | No | ||
| quantity | No | ||
| replayed | No | ||
| external_name | No | ||
| supplier_order | No | ||
| unmatched_lines | No |