getInvoices

suspend fun getInvoices(page: Int? = null, perPage: Int? = null, customer: String? = null, account: String? = null, status: InvoiceStatus? = null): Pair<InvoiceResponses.ListInvoicesResponse?, NetworkingError?>

Retrieves a paginated list of invoices, optionally filtered by customer, account, or status.

Return

A pair containing a InvoiceResponses.ListInvoicesResponse on success, or a NetworkingError on failure.

Parameters

page

The page number to retrieve. Defaults to the first page when null.

perPage

The number of invoices per page. Uses the API default when null.

customer

The customer ID to filter results by. Returns invoices for all customers when null.

account

The account ID to filter results by. Returns invoices for all accounts when null.

status

The InvoiceStatus to filter results by. Returns invoices of all statuses when null.


fun getInvoices(page: Int? = null, perPage: Int? = null, customer: String? = null, account: String? = null, status: InvoiceStatus? = null, completionHandler: (InvoiceResponses.ListInvoicesResponse?, NetworkingError?) -> Unit)

Retrieves a paginated list of invoices and delivers the result via a callback.

Parameters

page

The page number to retrieve. Defaults to the first page when null.

perPage

The number of invoices per page. Uses the API default when null.

customer

The customer ID to filter results by. Returns invoices for all customers when null.

account

The account ID to filter results by. Returns invoices for all accounts when null.

status

The InvoiceStatus to filter results by. Returns invoices of all statuses when null.

completionHandler

Invoked on completion with a InvoiceResponses.ListInvoicesResponse on success, or a NetworkingError on failure.