Modify invoice
Edits the provided fields for the invoice with the given id. Any fields that are not provided are left unchanged.
Transitioning isDraft between true and false will create or delete the underlying invoice transactions as needed.
Modifying an invoice
Only the fields provided in the request body are updated. Any field that is omitted is left unchanged.Posting and unposting
Transitioning theisDraft flag drives the underlying transactions:
true→false— posts the invoice and creates the transactions on the invoice’sopeningDate.false→true— unposts the invoice and removes the transactions.false→false— recalculates and updates the existing transactions to reflect the new values.
Authorizations
API token for authentication. Obtain from your Infinity account settings.
Path Parameters
The id of the specific invoice.
Body
The fields to update.
Request body for modifying a customer invoice. All fields are optional; omitted fields are left unchanged.
The id of the invoice template to render the document with. When omitted while creating an invoice or estimate, the organisation's default template is used. Use the invoice templates endpoint to list the available templates.
The opening date (issue date) of the document in YYYY-MM-DD format. For invoices, this is also the date used for the posted accounting transactions.
The ordered list of positions on the document. At least one position is required, and discount positions must specify exactly one of percentage or amount.
A standard billable line item with a quantity, single amount, and contra account. Most invoice and estimate positions are of this type.
- ProductPosition
- DiscountPosition
- TextPosition
- SubtotalPosition
The id of the contact this document is addressed to. Required unless customRecipientText is provided.
An ad-hoc recipient text used when no contact is associated with the document.
2000An optional reference for this document in an external system.
128Optional document title displayed on the rendered output.
128Payment terms for this document in days from the opening date. Defaults to 30 on create.
0 <= x <= 365Text rendered above the positions.
2000Text rendered below the positions.
2000Whether position amounts are entered gross (including VAT) or net (excluding VAT).
gross, net The language used to render the document.
de, en, fr, it The columns to render in the positions table. If not provided the template default is used.
A column that can be shown on the rendered invoice or estimate.
quantity, unit, articleNumber, name, date, vatDebt, vatRate, singleAmount, totalAmount, discountRate, positionNumber, customTextColumn1, customTextColumn2, customTextColumn3 For foreign-currency documents: the 3-character ISO 4217 currency code the document is denominated in. Must be a currency code that is enabled in the organisation. When set without exchangeRate, the organisation's stored exchange rate for that currency is used.
3For foreign-currency documents: the conversion rate from the original currency to the primary accounting currency, expressed as 1 originalCurrency = X primaryCurrency. Optional when originalCurrency is set; if omitted, defaults to the organisation's stored exchange rate for that currency. Cannot be set without originalCurrency.
Transitioning from true to false posts the invoice and creates transactions. Transitioning from false to true unposts them.
Response
Changes saved successfully.
The full representation of a customer invoice.