Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > SDKs >

how to get the invoice line item tracking category?

Started by Ravi Kumar -   in SDKs

Hi,

I'm trying to get the invoice line item's tracking category info, but the date comes back empty.

Here is the code where I'm retrieving an invoice by its id, here I can see all the line items for the invoice, but not the line time tracking category.

public async Task<IList<Invoice>> GetInvoiceByIDAsync(Guid invoiceID)
{
var token = await GetAccessToken();
var api = new AccountingApi();
var unitdp = 2;
var result = await api.GetInvoiceAsync(token.AccessToken, TenantId(token), invoiceID, unitdp);
return result?._Invoices;
}

Any help would be greatly appreciated.

Thanks
Hi Ravi

The Invoices endpoint requires the summaryOnly parameter to be set to false to retrieve the full contents of invoice line items. Out of the box this is set to true to reduce the payload necessitated by most integrations.

This parameter is available as a method overload of GetInvoiceAsync (in the case of the C# SDK) or GetInvoices (the PHP SDK). In both cases summaryTrue is the final parameter of the method so you'll need to pad out any remaining parameters with corresponding defaults.

Let me know if that works for you.
 

Nick Tingay