getCustomers

suspend fun getCustomers(page: Int? = null, perPage: Int? = null): Pair<CustomersResponses.ListCustomersResponse?, NetworkingError?>

Retrieves a paginated list of customers.

Return

A pair containing a CustomersResponses.ListCustomersResponse on success, or a NetworkingError on failure.

Parameters

page

The page number to retrieve. Defaults to the API's first page when null.

perPage

The number of customers per page. Defaults to the API's default page size when null.


fun getCustomers(page: Int? = null, perPage: Int? = null, completionHandler: (CustomersResponses.ListCustomersResponse?, NetworkingError?) -> Unit)

Retrieves a paginated list of customers and delivers the result to a callback.

Parameters

page

The page number to retrieve. Defaults to the API's first page when null.

perPage

The number of customers per page. Defaults to the API's default page size when null.

completionHandler

Invoked with a CustomersResponses.ListCustomersResponse on success, or a NetworkingError on failure.