Create a supplier order
dolibarr_supplier_order_createCreates a draft supplier purchase order with line items, defaulting product prices to the supplier's price. Use it to prepare supplier orders before validating or sending them.
Instructions
Creates a draft purchase order with its lines. Product lines without unit_price use the supplier's price for that product. The standard API cannot edit the lines of an existing supplier order: get the lines right here, or delete the draft and create it again. Validate, approve and send it with dolibarr_supplier_order_action.
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": {
"thirdparty_id": "<thirdparty_id>",
"lines": "<lines>"
},
"name": "dolibarr_supplier_order_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Order date; default today. | |
| lines | Yes | ||
| note_public | No | Note visible to the third party (printed on documents). | |
| note_private | No | Internal note. | |
| ref_supplier | No | The supplier's reference for this order. | |
| custom_fields | No | Custom fields by code, e.g. {"region": "north"}. Get codes and allowed values from dolibarr_custom_field_list. | |
| delivery_date | No | Expected delivery date. | |
| thirdparty_id | Yes | Supplier id. |