invoices
This query fetches a collection of invoices where the invoice date falls within the requested range. The query can be further refined through the use of QueryOptions to only fetch invoices that were created or modified (or both) within specified dates. Use filters.metadata to filter by stored customerMetadata entries. Optional filters.invoiceNumbers allows filtering by invoice numbers. Use filters.submittedToHealthcode to return only invoices submitted to Healthcode (or only those not submitted). Use filters.healthcodeStatus to match or exclude specific Healthcode statuses, for example healthcodeStatus: { in: [Validated, AwaitingCollection] } or healthcodeStatus: { notIn: [AwaitingCorrection, Cancelled] }. Use filters.accountId, filters.paidOrOutstanding, filters.status, and filters.type for exact-match filters on billed account, payment state, lifecycle status, and invoice type. Invoice.outstanding is returned on each invoice and is not a filter. Prefer cursorPagination for large result sets (for example sync/export); deep offset pages remain expensive even with indexes. Existing pagination: { page, pageSize } behaviour is unchanged. Do not provide pagination and cursorPagination together.
invoices(
dateRange: DateRange
pagination: Pagination
cursorPagination: CursorPagination
options: QueryOptions
filters: InvoicesQueryFilters
): InvoiceData
Arguments
invoices.dateRange ● DateRange input
invoices.pagination ● Pagination input
invoices.cursorPagination ● CursorPagination input
Cursor-based pagination alternative to pagination. Mutually exclusive with pagination. Use the last invoice's id as cursor for the next page. Results are always ordered by _id ascending for NEXT (and descending then reversed for PREVIOUS).
invoices.options ● QueryOptions input
invoices.filters ● InvoicesQueryFilters input
Type
InvoiceData object
A collection of invoices and the associated pagination information. With offset pagination, pageInfo is a standard PageInfo. With cursorPagination, pageInfo uses the PageInfoForCursorPagination shape (pageSize and hasMore only; page is unset).