Loki Docs
Tools › Transactions › Update one receipt item

Update one receipt item

update_receipt_itemChanges
What it does
Changes or deletes something you had. Your assistant can ask you to confirm first. Safe to retry: the same call twice changes nothing more.
Permission
Transactions, change transactions:write

What your assistant is told

Correct ONE line on a receipt — its name, its price, its quantity, or (most often) the category it counts in. itemId is the item's UUID from get_receipt or set_receipt. This is a SPARSE patch: pass only what changes and every omitted field keeps its value; pass an empty string for quantity to clear it. Recategorising a line is the common edit and is why this tool exists — use it instead of resending the whole receipt with set_receipt, which would replace every item. A price that would push the items above what was actually paid is refused (items_exceed_payment); fix the transaction's amount first if the receipt is right. Returns the whole receipt as it now stands, including the per-category subtotals and the "Not itemised" remainder, so you can tell the user what changed.

Parameters

  • itemIdid, requiredUUID of the receipt item to edit, from get_receipt.
  • nametext, optionalNew product name. Omit to keep it.
  • quantitytext, optionalNew quantity as printed ("x2", "0.62 kg"). Omit to keep it; pass "" to clear it.
  • amountMinorwhole number, optionalNew price in integer minor units. May be negative (a discount line). Omit to keep it.
  • categorytext, optionalNew category NAME or UUID, from list_categories. Omit to keep it.