Save a transaction's receipt
set_receiptChanges- 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
Save the receipt behind one transaction — its header (shop, date, card) and its individual items — so one payment counts in every category it actually covered: a general-store receipt is groceries AND household AND pharmacy, and without items all of it would sit in one category. Use it after reading a receipt photo the user gave you. THIS REPLACES THE WHOLE RECEIPT: the items you send are the complete list, and anything previously there is gone — which is also how you redo a receipt from a better photo. SHOW THE USER THE ITEMS AND THE CATEGORIES YOU READ FIRST AND SAVE ONLY AFTER THEY CONFIRM; a wrong category on a line quietly misreports their month. Each item needs a name, an amountMinor (integer minor units of the transaction's currency — a discount line may be NEGATIVE) and a category (name or id, from list_categories); quantity is free text exactly as printed ("x2", "0.62 kg"). The items do NOT have to add up to the payment: whatever they leave over stays in the transaction's own category as "Not itemised", and the answer tells you how much that is, so you can say "the items add up" or "4.40 is not itemised". Items may not add up to MORE than was paid (items_exceed_payment) nor to zero or less. Pass a stable idempotencyKey so a retry does not re-save. This does NOT create the transaction or any category — use log_transaction and create_category first. To change one line use update_receipt_item rather than resending everything.
Parameters
transactionIdid, requiredUUID of the transaction this receipt is for, fromget_transactions_in_range.itemslist of object, requiredThe items, in receipt order. May be empty when the user kept only the header.idempotencyKeytext, requiredStable idempotency key so a retry does not re-save. Mint one UUID per logical save.merchanttext, optionalThe shop as the receipt prints it, e.g. "Carrefour Orhideea". Omit when it does not say.issuedAtIsotext, optionalWhen the receipt was issued, ISO-8601 WITH the user's UTC offset — a till prints the minute in their local time, so stamp it with their offset, e.g. "2026-10-18T13:04:00+03:00"; without one it is refused. Omit when the receipt does not say.cardLast4text, optionalThe last 4 digits the receipt printed for the card, e.g. "4821". Never a full card number — that is refused.