Hi!
I’m trying to update a recurring invoice through the API. I mainly want to update the price of every item, so I tried it like this:
curl -X PUT http://my.test.installation/api/v1/recurring_invoices/xyzIDxyz \
-H 'X-Api-Token: myAPItokenXYZ' \
-H 'X-Requested-With:XMLHttpRequest' \
-H 'Content-Type:application/json' \
-d '{"line_items": [
{"product_key": "Testarticle 1",
"cost": 10.5,
"quantitiy": 1,
"tax_name1": "Umsatzsteuer",
"tax_rate1": 10
}, {
"product_key": "Testarticle 2",
"cost": 21,
"quantitiy": 1,
"tax_name1": "Umsatzsteuer",
"tax_rate1": 20
} ]
}'
I thought all the balances and gross totals and taxes and whatnot would then be calculated automatically, but it doesn’t seem to work. All the other amounts get set to zero when I try this.
What am I missing here? Do I have to calculate all the other amounts in the recurring invoice myself?
(I also tried to set some additional fields like “notes” or “is_amount_discount” but nothing worked)