Author Topic: Create multiple line items  (Read 3875 times)


  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Create multiple line items
« on: February 18, 2018, 08:00:20 PM »
I am using powershell to create an invoice in xero using ChilkatDotNet2.dll.  The Invoice creates successfully but I need to add multiple line items to it. The XML is:

        <Description>3 copies of OS X 10.6 Snow Leopard</Description>
        <Description>Returned Apple Keyboard with Numeric Keypad (faulty)</Description>
        <Tracking />

Adding one line item works using:
$xml.NewChild2("Invoice|LineItems|LineItem|Description","3 copies of OS X 10.6 Snow Leopard")

But if I add a second one it fails:
<Message>The element 'Description' was not recognised. Ensure the element name has the correct case and that there are no duplicate elements of the same name.</Message>

What is the correct syntax to add multiple items that are all under the same element?