order.updateEntry
Change a line of an open order (same as invoice.updateEntry).
Changes a line of an open order. It is the same method as invoice.updateEntry; it is refused once the order is closed.
Examples
Example: with a copy of the synthetic/business-editable example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"order.create","params":{"owner":"5b22073fa4e34411b07c14a77147ce6b"}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": "…"
}
Request:
{"jsonrpc":"2.0","id":2,"method":"order.addEntry","params":{"order":"00ed0000000000000000000000000001","description":"Widgets","quantity":"10","price":"2.50","account":"Income"}}
Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": "…"
}
Request:
{"jsonrpc":"2.0","id":3,"method":"order.updateEntry","params":{"entry":"00ed0000000000000000000000000002","quantity":"12"}}
Response:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"quantity": {
"num": "12",
"denom": "1"
},
"…": "…"
}
}
Command line
red-ale exec --book book.gnucash --script - <<'EOF'
order.create {"owner":"5b22073fa4e34411b07c14a77147ce6b"}
order.addEntry {"order":"00ed0000000000000000000000000001","description":"Widgets","quantity":"10","price":"2.50","account":"Income"}
order.updateEntry {"entry":"00ed0000000000000000000000000002","quantity":"12"}
EOF
It prints:
[
"…",
"…",
{
"quantity": {
"num": "12",
"denom": "1"
},
"…": "…"
}
]
MCP tool call
Tool call:
{"name":"order.create","arguments":{"owner":"5b22073fa4e34411b07c14a77147ce6b"}}
Result:
{
"content": [
{
"type": "text",
"text": "\"…\""
}
]
}
Tool call:
{"name":"order.addEntry","arguments":{"order":"00ed0000000000000000000000000001","description":"Widgets","quantity":"10","price":"2.50","account":"Income"}}
Result:
{
"content": [
{
"type": "text",
"text": "\"…\""
}
]
}
Tool call:
{"name":"order.updateEntry","arguments":{"entry":"00ed0000000000000000000000000002","quantity":"12"}}
Result:
{
"structuredContent": {
"quantity": {
"num": "12",
"denom": "1"
},
"…": "…"
}
}
Effect: write, on the Book.
Params
Params of invoice.updateEntry and order.updateEntry: the fields to change.
entry(Guid, required): The line.date(Date or null): The line's date; stored as noon local time, as GnuCash's register does. Defaults to today.description(string or null): Description.action(string or null): Action: a free unit label such as "Hours".notes(string or null): Notes.quantity(Amount or null): Quantity, as printed on the document; stored negated on a credit note.account(AccountRef or null): The income account (invoices) or expense account (bills, vouchers);nullfor none.price(Amount or null): Unit price. A new line on a job's document defaults to the job's rate.discount(Amount or null): Invoices only: the discount, a percentage or an amount. Defaults to the customer's discount.discountType(AmountTypeWire or null): Invoices only: whether the discount is a percentage or an amount.discountHow(DiscountHowWire or null): Invoices only: when the discount applies relative to tax.taxable(boolean or null): Invoices and bills: the line is taxed. Defaults to true when a tax table applies.taxIncluded(boolean or null): Invoices and bills: the price includes tax. Defaults from the customer's or vendor's setting.taxTable(TaxTableRef or null): Invoices and bills: the tax table, by GUID or name;nullfor none. Defaults to the owner's table when it overrides, else the book's default.billable(boolean or null): Bills and vouchers: the cost is to be invoiced on tobillTo.billTo(Guid or null): Bills and vouchers: the customer or job to invoice the cost to;nullfor none.payment(PaymentWire or null): Vouchers only: cash (the employee paid) or card (the company card paid).
Result
A line. Both sides are shown; the one its document uses is invoice* for customer invoices and bill* for bills and vouchers.
guid(Guid, required): A GUID: 32 hexadecimal digits.date(Timestamp, required): An instant, RFC 3339; written in UTC with a Z suffix.dateEntered(Timestamp, required): An instant, RFC 3339; written in UTC with a Z suffix.description(string, required)action(string, required)notes(string, required)quantity(Amount, required): As stored: negated on a credit note.documentQuantity(Amount, required): As printed on the document.invoice(Guid or null): The customer invoice it is on.bill(Guid or null): The bill or voucher it is on.order(Guid or null): The order it is on.invoiceAccount(Guid or null)invoicePrice(Amount, required): An exact amount. Read from a decimal string ("12.34"), a rational string ("1234/100") or {num, denom} with string members; written as {num, denom}. Never a JSON number.discount(Amount, required): An exact amount. Read from a decimal string ("12.34"), a rational string ("1234/100") or {num, denom} with string members; written as {num, denom}. Never a JSON number.discountType(AmountTypeWire, required): Percentage or fixed amount.discountHow(DiscountHowWire, required): When a discount applies relative to tax.invoiceTaxable(boolean, required)invoiceTaxIncluded(boolean, required)invoiceTaxTable(Guid or null)billAccount(Guid or null)billPrice(Amount, required): An exact amount. Read from a decimal string ("12.34"), a rational string ("1234/100") or {num, denom} with string members; written as {num, denom}. Never a JSON number.billTaxable(boolean, required)billTaxIncluded(boolean, required)billTaxTable(Guid or null)billable(boolean, required)billTo(OwnerInfo or null)payment(PaymentWire, required): How an employee paid an expense.