Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Find a Developer >

Specifying override TaxType on line items when creating new invoice

Started by Matthew Carter -   in Find a Developer

I'm having trouble specifying an override TaxType when creating a new Invoice via API. When I specify a TaxType for my line items, the system uses the one assigned to the account instead. Is this expected behavior?

tax_type TAX001 has a rate of 8.5% in my sandbox. I'm getting 9.25%, which I verified is the one assigned to the account on the line item. I'm trying to override the one assigned to the account.

Here's my api call's params:


"invoice_number"=>"#72",
"type"=>"ACCREC",
"contact"=>"contact_id"=>"...",
"line_items"=>
"line_item_id"=>...,
"tax_type"=>"TAX001",
"description"=>"sasg",
"quantity"=>...,
"unit_amount"=>...,
"tax_amount"=>...,
"account_code"=>"470",
"line_item_id"=>...,
"tax_type"=>"TAX001",
"description"=>"asdfasfd",
"quantity"=>...,
"unit_amount"=>...,
"tax_amount"=>...,
"account_code"=>"460",
"total"=>...,
"sub_total"=>...,
"total_tax"=>...,
"status"=>"AUTHORISED",
"date"=>Sun, 10 Mar 2019,
"due_date"=>Sat, 16 Mar 2019