File delivery order draft
create_delivery_order_draftFiles a delivery-order draft in Taokeh: the paper that goes with goods leaving the business. A delivery order posts nothing and moves no stock; stock moves when it is invoiced. The draft stays pending until a person approves it in Taokeh, which creates a real delivery order. customerId is the id returned by resolve_customer; leave it out for a delivery order with no customer. productRef is the id or exact SKU returned by resolve_product. Lines take the quote's shape (intake_contract(doc_type:'delivery_order')). The server recomputes every line quantity from the tally and the delivery order's total; its figures are the ones the approved delivery order carries. On a company that keeps stock counts, approval checks the goods are on hand and refuses when they are not; the draft then stays pending. needsReview with a short notes line flags doubts for the reviewer; notes is a note to the reviewer, not the delivery order's own notes. A matching pending draft (same reference, date and total) is returned instead of a second one. Line keys are strict: a key not in the schema is refused by name and nothing is filed. Returns the draft id, computedTotal, and review and approval links.
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": {
"doDate": "<doDate>",
"lines": "<lines>"
},
"name": "create_delivery_order_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | ||
| notes | No | Short reviewer note (one or two sentences, in the reviewer's language) naming what to double-check: a smudged total, an uncertain party, a judgment call. Shown on the approval card. Empty when nothing needs flagging. | |
| doDate | Yes | The delivery-order date, YYYY-MM-DD. | |
| reference | No | The delivery-order number printed on the paper, if any. Left out: Taokeh numbers it at approval. | |
| customerId | No | The customer id from resolve_customer. Left out: a delivery order with no customer. | |
| needsReview | No | ||
| printedTotal | No | The total printed on the paper, if any (a cross-check only). |