Skip to content

Invoice.LineItems is not working in v3 #200

@neeon-li

Description

@neeon-li

I am using v3.0.2.
The Invoice.LineItems is always returning an empty array to me.
But I checked the invoice in Xero, and sure there is some LineItem in each invoice.

const XeroClient = require('xero-node').AccountingAPIClient;
const config = require('./config.json');

(async () => {
  const xero = new XeroClient(config);
  const result = await xero.invoices.get();
  for (const invoice of result.Invoices) {
    console.log(invoice);
    if (invoice.LineItems) {
      for (const LineItem of invoice.LineItems) {
        console.log(LineItem);
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions