Discussions
How to reduce final invoice by advanced payment invoice?
Hi team,
can you explain how to create an advanced payment invoice and the following final invoice correctly via API?
We are creating an invoice after the customers payment because VAT is due as soon as the payment is received. The product is delivered and invoiced later. Example with type_code=386 and payments_on_account, because payment is already received:
{
"invoice": {
"number": "1",
"date": "2026-03-01",
"contact_id": "1",
"type_code": "386",
"payments_on_account": 605,
"invoice_lines_attributes": [
{
"position": 1,
"quantity": "1",
"price": 500,
"description": "Downpayment in advance",
"unit": 1,
"taxes_attributes": [
{
"name": "VAT",
"category": "S",
"percent": 21
}]
}]
}]
Later a final invoice is created with invoice amount and VAT reduced by the already payed amount.
How can I transmit the already paid amount and probably mention/link the previous invoice in the new one?
In this example the invoice shows the full VAT of 210 euros, but should only show the remaining VAT of 105 euros. Half of the VAT is already invoiced with the advanced invoice 1 previously sent. payments_on_account doesn't help here.
{
"invoice": {
"number": "2",
"date": "2026-03-20",
"contact_id": "1",
"type_code": "380",
"invoice_lines_attributes": [
{
"position": 1,
"quantity": "1",
"price": 1000,
"description": "Product name",
"unit": 1,
"taxes_attributes": [
{
"name": "VAT",
"category": "S",
"percent": 21
}]
}]
}]
Kind regards
Kai