Edit expense
update_expenseEdit an existing expense (gasto) by id. Only the fields you pass are changed. Gastos are not part of the Verifactu chain, so editing is safe. Use list_expenses to find the id. Returns the updated expense's id, description and total.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| total | No | ||
| category | No | expense category slug (see web app) | |
| subtotal | No | ||
| tax_rate | No | ||
| tax_lines | No | Only for a receipt carrying MORE THAN ONE VAT rate (e.g. a Correos ticket: 21% on postage, exempt on the stamp). One entry per rate. When given, subtotal/tax_amount/tax_rate/total are derived from it, do not compute them yourself. Passing a list REPLACES the existing blocks; an empty list removes them. Leave it out to keep them unchanged. | |
| expense_id | Yes | expense id from list_expenses | |
| tax_amount | No | ||
| description | No | ||
| supplier_id | No | existing supplier id from list_suppliers | |
| invoice_date | No | YYYY-MM-DD | |
| supplier_nif | No | supplier NIF/CIF/VAT as printed on the document | |
| is_deductible | No | false keeps the expense out of the deductible totals entirely | |
| supplier_name | No | supplier (proveedor) name, matched against existing suppliers by NIF or name, created if new | |
| invoice_number | No | ||
| reverse_charge | No | inversión del sujeto pasivo, as stated by the user | |
| supplier_country | No | supplier country, ISO-2 (ES, FR, DE...). Drives Modelo 349 intra-EU acquisitions | |
| deductible_percent | No | porcentaje imputable: share of this expense (0-100) the user allocates to the business, e.g. a shared car or a home office. Enter the FULL receipt amounts in subtotal/tax_amount/total and the percentage here, not pre-reduced amounts; the IVA and income-tax modelos count only that share. Default 100. Use only a percentage the user states, contix never proposes one. | |
| reverse_charge_type | No |