Xero account code issues with zero amount line items

The GL mappings in Cloud Depot are configured correctly, and the audit report aligns with the appropriate account codes. However, the zero rated line-items account code in Xero is either missing or incorrectly assigned.

An invoice sent through the API with a line-item value of zero will have its account code automatically removed by the Xero API. However, if you later edit the invoice in Xero, it may default to a different account code. This can create a misleading impression of a mapping issue within Cloud Depot.

 

You can test this behaviour in the Xero web app by following this simple example below.

Step 1.

Create a test draft invoice that includes two line items, ensuring that the second line item has a price of zero and is assigned an account code that differs from your default account code. Then save and close the invoice.

Step 2.

After saving the draft invoice and closing it, when you re-open the invoice, you will notice that the account code for the second line item has reverted to the default account code.

Why does Xero handle zero line items in this way?
This occurs because Xero handles line items with a value of zero differently from standard line items in its financial reporting processes. To verify that this behavior is not a bug, we consulted with the Xero API team, who confirmed that this is consistent with the functionality observed in the Xero web interface.

Below is the response from the Xero API Team

This is just following what happened in the Xero web interface.
If you created an invoice directly in the Xero web interface and one of the line items will have a zero amount, the account info will be removed once the invoice is approved.