List Invoices

To list invoices call the invoices()->get() method.

Xero docs for listing invoices - https://developer.xero.com/documentation/api/invoices#get

The optional parameters are $page and $where. $page defaults to 1 which means being back on the first page, for additional pages enter higher page numbers until there are no pages left to return. The API does not offer a count to determine how many pages there are.

Xero::invoices()->get(int $page = 1, string $where = null)

$where allows for filter options to be passed, the most common filters have been optimised to ensure performance across organisations of all sizes. We recommend you restrict your filtering to the following optimised parameters.

Filter by status:

Xero::contacts()->get(1, 'Status="AUTHORISED"')

Filter by contact id:

Xero::contacts()->get(1, 'Contact.ContactID=guid("96988e67-ecf9-466d-bfbf-0afa1725a649")')

Filter by contact number

Xero::contacts()->get(1, 'Contact.ContactNumber="ID001"')

Filter by reference

Xero::contacts()->get(1, 'Reference="INV-0001"')

Filter by date

Xero::contacts()->get(1, 'Date=DateTime(2020, 01, 01)')

Filter by type

Xero::contacts()->get(1, 'Type="ACCREC"')

Support my work by donating with PayPal.

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2009 - 2021 DC Blog. All code MIT license. All rights reserved.