-
Notifications
You must be signed in to change notification settings - Fork 57
Description
We're integrating with Xero using the Accounting API and need to maintain a reliable mapping between our backend InvoiceItem records and the corresponding LineItems in Xero for future updates.
Since LineItemID is only returned after invoice creation, we're looking for a robust strategy to match our local items with those returned by Xero ideally without modifying visible fields like description, and without relying on item_code (as it's already used for referencing Xero inventory items).
Questions:
What is the recommended best practice for associating backend invoice items with the corresponding Xero line items in the response after creation?
1.Is the ordering of line items preserved in the response from Xero's create_invoices() call?
Specifically, if we send line items in a known order, will created_invoice.line_items return them in the same order?
2.Can we safely rely on this order to map local items to Xero line items?
We want to ensure a reliable mapping between local and remote line items particularly to store the Xero LineItemID for update/delete operations later.
Any guidance would be appreciated!