Update invoice by ID
PUT/invoices/{invoiceId}
Updates an existing invoice identified by invoiceId.
Audit event:
- invoice.update
Privilege:
-
finance-invoices.manage
-
Updating vatInPrice can trigger recalculation of invoice items (price totals / vat-in-price values)
-
Updating vatPercent affects how new items are calculated for manual invoices (existing items may remain with older VAT percent)
-
If invDueDate is not provided, invDueDateDays (days to add on invoicing date) is used
-
Updating supplier invoice totals can affect related clearing data
Errors:
- INVOICE_NOTFOUND - Invoice not found
- SUPPLIER_INV_NEETING_MEMBER_UPD_NOT_ALLOWED - Supplier invoice is a member of netting statement and update is not allowed
- INVOICE_TYPE_NOTFOUND - Invoice type not found
- CUSTOMER_NOTFOUND - Customer not found
- INSTANCE_OWNER_NOTFOUND - Instance owner data not found
- BIZ_PARTNER_COUNTRY_AND_INVOICE_COUNTRY_MISMATCH - Invoice country and biz partner country should be the same
- MISSING_TAX_DATA - Tax rates for invoice issuer country not configured
- INVOICE_ITEM_NOTFOUND - Invoice item not found
- INVOICE_CLEARING_NOTFOUND - Invoice clearing not found
- INVOICE_CLEARING_RECORD_NOTFOUND - Invoice clearing record not found
- INVOICE_TYPE_NOT_SUPPORTED - Action not supported for invoice type
- INVALID-DATA - Input data validation failed
- NOT_PLATFORM_OWNER - Not authorized - not platform owner
- NOT_AUTHORIZED - Not authorized
- NOT_AUTHENTICATED - Not authenticated
- INT_APP_ERROR - Unexpected internal error
Error items:
- invalid value - original invType is not allowed to change
- invalid value - old and new invoice types and document classes do not match
- invalid value - invoice with given ID not found
- invalid value - update can only be made if customer invoice is in draft status
- invalid value - VatPercent must be greater then 0 and less then 100
- invalid value - customer country can not be 0
- invalid value - lang must be char(2)
- invalid value - Currency can be changed only if there are no invoice items
- invalid value - Curency must be valid code number
- invalid value - VatInPrice must be 0 or 1
- invalid value - VatInTotal must be 0 or 1
- invalid value - invoice date and delivery date must be equal
- invalid value - invoice date invalid
- invalid value - delivery date invalid
- invalid value - invoicing date invalid
- invalid value - invoice type not found
- invalid value - delivery status value can be : 'none','waiting','sending','sent','error' or 'misc'
- invalid value - invoice due date invalid
- invalid value - InvoiceDueDateDays must be greater then 0
- invalid value - invoice due date can not be before invoice date
- invalid value - invoice due date can not be before invoice delivery date
- invalid value - invoice period start date invalid
- invalid value - invoice period end date invalid
- invalid value - reminder status value can be one of: 'enabled','disabled','open','closed' or 'misc'
- invalid value - invoice Total can not be less than paid amount
- invalid value - update can only be made if supplier invoice is in 'draft'
- invalid value - update can only be made if note is in draft status
- invalid value - supplierInvNumber can not be longer than 100 characters
- invalid value - Amounts can not be changed on partly paid invoice
- invalid value - amountNoVat can not be more than 99999999.9999
- invalid value - amountVat can not be more than 99999999.9999
- invalid value - total can not be more than 99999999.9999
- invalid value - Currency can not be changed on partly paid invoice
- invalid value - unknown currency code
- invalid value - supplier invoice due date can not be before invoice date
- invalid value - amountNo Vat must be positive value
- invalid value - amount Vat must be positive value
- invalid value - amount Vat can not be more than 99999999.9999
- invalid value - amount Vat must be greater or equal than amount no vat
- invalid value - QuantityMode must be between 0 and 3
- invalid value - Only 'ITEM-xxx' type has quantity_mode > 0
- invalid value - MeasureUnit must be between 0 and 5
- invalid value - Price must be greater then 0
- invalid value - TotalVat can not be more than 99999999.9999
- invalid value - TotalNoVat can not be more than 99999999.9999
- invalid value - status should be in (active, deleted)
Request
Responses
- 200
- 400
- 401
- 404
- 409
- 500
Invoice updated successfully
Bad Request - Validation failed or request body invalid
Not Authorized - Missing required privileges
Not found - invoice or related entity not found
Conflict - update not allowed due to current invoice/business state
Internal Server Error