Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Posting "Tax Rate" for line item in Invoice

Started by sukum r -   in API Endpoints

I see "Tax Rate" in Line Items for Invoices. But the API reference for Invoices seems to allow posting of only TaxType and TaxAmount.

So is it possible to post "Tax Rate" for an invoice line item ? If so, what is the element to be used while posting ?
Generally, the Tax codes and rates would be pre-defined in the setup of the organisation. You can call the 'TaxRates' endpoint to get a list of tax names and rates that can be used for the particular organisation that you're currently dealing with.

On this basis, there's no need to specify a tax rate when creating an invoice. Usually, you can just specify the account code to be used, and the default tax rate (and percentage) on that account will be automatically used in the invoice.

There are instances where you would need to enter a tax amount other than the amounts calculated by Xero. To do this, you can specify a <TaxAmount> element to override the calculated tax amount. For reporting purposes, the correct tax code will still need to be recorded, but the percentage will effectively not be used with a custom tax amount.


Daniel Barratt (Xero Staff)  

Thanks a lot for clearing my doubt. Now I have solved it by calling the 'TaxRates' endpoint and posting the retrieved 'TaxType', into 'TaxType' of invoice line items. I got confused between "Tax Types" in Types and "Tax Rates". It seems both are same with "Tax Rates" being a super set of the Tax Types (cannot be deleted) and user defined tax rates.

sukum r