Update Expense
Update an existing expense with new information while preserving data integrity
Documentation Index
Fetch the complete documentation index at: https://docs.contazen.ro/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Update Expense endpoint allows you to modify an existing expense record. You can update any field including supplier, category, amounts, payment status, and other details. The system will automatically recalculate VAT and currency conversions based on your changes.Path Parameters
Request Body
All fields are optional - only include the fields you want to update. Existing values will be preserved for any fields not included in the request.0, 5, 9, 11, 19, 21) or the string "mix" for multi-rate receipts where the caller supplies total VAT manually via amount_vat_manual. See Mix VAT mode on Create for the full shape.>= 0) when vat = "mix", ignored otherwise. The server stores amount_wvat = amount, amount_vat = amount_vat_manual, amount_total = amount + amount_vat_manual.1- Cash2- Bank transfer3- Card4- Check5- Promissory note6- Other7- Compensation
items overwrites all
existing lines for this expense — send the full desired set, not a diff.
Lines you omit are deleted. When items is present the server derives
amount, vat, and vat_breakdown from the lines; the corresponding
header-level fields on the request body are ignored.Omit items entirely to leave the existing lines untouched and update
only the header fields you pass. To convert an itemized expense back to
flat, send an empty items: [] alongside new amount + vat.Per-item shape matches the Create Expense endpoint.
See Expense Lines & VAT Breakdown for rounding rules.{ rate, net, vat_amount, gross } entries
(two or more). On the mix path, the breakdown is also used to synthesize
one persisted line per rate group. Ignored when items is supplied.Response
Returns the updated expense object with all recalculated fields.Automatic Recalculations
When you update certain fields, the system automatically recalculates related values:VAT Recalculation
- Amount changes: VAT amounts are recalculated based on the new amount and VAT percentage
- VAT percentage changes: All VAT-related amounts are recalculated
- with_vat changes: The relationship between total and VAT-exclusive amounts is recalculated
Currency Conversion
- Currency changes: Account amounts are recalculated using current exchange rates
- Exchange rate changes: Account amounts are recalculated with the new rate
Status Updates
- Payment status: The overall expense status is updated based on payment and due date information
Validation Rules
- Modifiability: The expense must not be locked by accounting rules
- Supplier: If changed, must exist and be owned by your firm
- Category: If changed, must be a valid expense category
- Amount: If changed, must be a positive number
- Dates: Must be in YYYY-MM-DD format
- Payment consistency: If marking as paid, payment_type is required
Authorizations
Use your API key (sk_live_xxx or sk_test_xxx)
Path Parameters
Expense CzUid
Body
All fields optional. Sending items REPLACES all existing lines —
send the full desired set, not a diff. Omit items to leave lines
untouched. To convert an itemized expense back to flat, send
items: [] alongside new amount + vat.
0, 1 VAT percentage. Either a numeric value or the string "mix" for
multi-rate receipts. When set to "mix" the request must include
amount_vat_manual.
0, 5, 9, 11, 19, 21 Total VAT amount when vat = "mix". Server stores
amount_wvat = amount, amount_vat = amount_vat_manual,
amount_total = amount + amount_vat_manual.
x >= 00, 1 1 <= x <= 70, 1 Replace all line rows. When present, the server re-derives
amount / vat / vat_breakdown from the lines and ignores
the corresponding header fields on the body. Empty array
([]) clears the lines.
Update the per-rate breakdown for flat-path multi-VAT receipts.
Ignored when items is sent.