create_purchase_document
Create a purchase document with line items in a single API call. Specify document type, supplier, date, and at least one line.
Instructions
Create a purchase document with lines in a single v1 call.
Supplier identity fields (tax number, business name) are denormalized from the supplier record.
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": {
"document_type": "<document_type>",
"supplier_id": "<supplier_id>",
"date": "<date>",
"lines": "<lines>"
},
"name": "create_purchase_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ISO date (YYYY-MM-DD). | |
| lines | Yes | At least one line item. | |
| notes | No | Document notes. | |
| due_date | No | Payment due date (YYYY-MM-DD). | |
| supplier_id | Yes | TOCOnline supplier id. | |
| document_type | Yes | Purchase document type code (e.g. FC). | |
| document_series_id | No | Document series id from /api/commercial_document_series. | |
| external_reference | No | External reference (e.g. supplier invoice number). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||