Create a purchase order
create_purchase_orderDraft a purchase order to a vendor in these books. A line with no unit_cost takes the item's cost from the price book, and a line with neither is refused — never $0.00. It is created as a draft unless issue: true, which opens it straight away (or sends it for approval when the books require one) so goods can be received against it. Nothing is emailed to the vendor either way. Usually queued for the account holder to approve (read staged). Nothing is paid by this.
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": {
"vendor_id": "<vendor_id>",
"lines": "<lines>"
},
"name": "create_purchase_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memo | No | ||
| issue | No | Open the order now (or send it for approval, if the books require one) instead of saving a draft. Needed before goods can be received. | |
| lines | Yes | ||
| ship_to | No | ||
| entity_id | No | Another entity in the same books (ids from `list_entities`). Leave out to use the entity the person is working in. | |
| tax_total | No | Tax on the order, if known. Default 0. | |
| vendor_id | Yes | From `list_vendors`. | |
| order_date | No | ISO date. Default today. | |
| expected_date | No | ISO date it should arrive. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The created or updated record's id, when the write was applied rather than staged. | |
| note | No | Why the result was truncated, when it was. | |
| staged | No | TRUE means nothing has changed yet — the write is queued in the account holder's Approvals queue in Seayora. Say it is waiting for approval; never report it as done. | |
| draft_id | No | The staged proposal's id, when it was queued rather than performed. | |
| truncated | No | Present and true when the result was too large to return in full. Treat it as a partial answer. | |
| total_available | No | How many rows existed before truncation. |