Create a sales order
dolibarr_order_createCreates a draft customer order with its lines, ready for later editing or validation. Use it to start a new order for a customer before confirming it.
Instructions
Creates a draft customer order and adds its lines. A draft can be edited or deleted; validate it with dolibarr_order_action. To turn a signed proposal into an order use dolibarr_order_create_from_proposal instead.
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>"
},
"name": "dolibarr_order_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Order date; default today. | |
| lines | No | Lines to add to the new draft. | |
| note_public | No | Note visible to the third party (printed on documents). | |
| note_private | No | Internal note. | |
| ref_customer | No | The customer's own reference (their PO number). | |
| custom_fields | No | Custom fields by code, e.g. {"region": "north"}. Get codes and allowed values from dolibarr_custom_field_list. | |
| delivery_date | No | Date as YYYY-MM-DD. | |
| thirdparty_id | Yes | Customer id. |