0

We have a web application that has a Shopping cart and payment processing functionality. We add items to the shopping cart and once the payment is processed successfully, we record the payment transaction in Xero. Following steps are performed to record the transaction in Xero:

  1. Create and Invoice
  2. Add all the items from the shopping cart into the Xero invoice
  3. Invoke the create Xero invoice API
  4. Xero invoice with all the line items is created successfully

Now, I would like to store the Xero invoice line item ID in Shopping cart line item.

  • How do I map the item in shopping cart with the line item in Xero invoice? e.g. the 5th item in shopping corresponds to the 2nd item in Xero invoice.
  • Is there a way to set custom fields while creating Xero invoice line items?
Mithun
  • 7,747
  • 6
  • 52
  • 68
  • To map the cart lines to the invoice lines, wouldn't that be the same? Whenever I send an invoice to Xero, the line items stay in the same order, so the 5th item in "my" invoice is the fifth line in the Xero invoice too. Does your shopping cart software allow multiple separate lines with the same product SKU on it, or does it aggregate the same item into a single line? If the latter, you could just match them on the product SKU. – droopsnoot Nov 19 '20 at 08:31
  • I've had a look at the documentation for the Xero Line Item ( https://developer.xero.com/documentation/api/invoices#LineItems ) and I don't see any custom fields in there. If you really need it, could you append it to the description? – droopsnoot Nov 19 '20 at 08:33

0 Answers0