webfox/laravel-xero-oauth2

getInvoices not shows the getLineItems

Closed this issue · 3 comments

Hi , I am trying to get all Invoices with getInvoices function , but this function not return LineItems for each incoive i get in getInvoices function.
kindly suggest

Hi,
This seems to be an issue for me too. getLineItems() is always an empty array.

Hi @hirani89,

This package only facilitates the oauth connection, as long as you're able to call the API then this will be a question to ask directly on the https://github.com/XeroAPI/xero-php-oauth2 repository.

However reviewing the documentation quickly it states

When you retrieve multiple invoices, only a summary of the contact is returned and no line details are returned – this is to keep the response more compact.

https://developer.xero.com/documentation/api/accounting/invoices#:~:text=When%20you%20retrieve%20multiple%20invoices%2C%20only%20a%20summary%20of%20the%20contact%20is%20returned%20and%20no%20line%20details%20are%20returned%20%E2%80%93%20this%20is%20to%20keep%20the%20response%20more%20compact.

So you'll need to fetch the individual invoices to get the line details.

Hi @hailwood,

Got it. Thanks for pointing it out.