include cost of sales on invoices
A customer of ours need to pull Invoices via the Xero API and are particularly interested in the COGS value of sales in order to calculate a Gross Profit value.
Unfortunately, that value does not appear in the Invoices endpoint.
I ran some tests where i posted a sale, then posted a purchase with items with a higher purchase price, then edit the sale and increase the quantity.
I then checked journals and i could see a reversal jounral for the COGS that used the old COGS value, and a reposting using the new COGS value.
This implies the data is somewhere in Xero. The issue is that Journals cannot be used is that the COGS journal does not include the SOURCE id, nor can it be linked back to the correct lines (it would be a single total for the whole transaction).
It would be useful to update the API to include this data on the Invoiced endpoint.
John Allen commented
It would be VERY helpful if there was at least a unique identifier that connects the 'sale' lines from the invoice journal to the 'cost' lines. Or am I missing something?