invoke

suspend operator fun invoke(fields: List<OrderProperty> = OrderProperty.entries, filters: OrderFilters? = null, logicalOperator: ApiLogicalOperator = ApiLogicalOperator.AND, orderSort: OrderOrderSort? = null, page: Int = 1, pageQuantity: Int = DEFAULT_RECORD_QUANTITY_PER_PAGE, searchType: ApiSearchType = ApiSearchType.EXACT, sessionToken: String? = null): ResultS1SDK<DataSet<Order>, ErrorS1SDK>

Gets Order models from the API for a specific page. You can specify extra filters to apply on the search.

Return

ResultS1SDK<DataSet<Order>, ErrorS1SDK>.

Parameters

fields

List<OrderProperty> the fields of the orders to request to the API. By default, it will be all the fields. Note: Less fields means less data to request to the API and it will be faster. On the other hand, more fields means more data to request to the API and it will be slower. We encourage to request just the fields that you need. Note that it is important to always request at least the OrderProperty.ID field because the API will always return the orders by their id. If this field is not requested, the process will fail and it will return an error. Note that the API will return the same Order model regardless of the fields requested. The properties that are not requested will have the default value configured on the model.

filters

OrderFilters the filters to apply on the search. If null, no filters will be applied.

logicalOperator

ApiLogicalOperator the logical operator to join the filters. By default, it will be ApiLogicalOperator.AND.

orderSort

OrderOrderSort the order to sort the orders. If null, no sorting will be applied.

page

Int the page to be returned. By default, it will be 1.

pageQuantity

Int the number of orders to be returned on each page. By default, it will be DEFAULT_RECORD_QUANTITY_PER_PAGE.

searchType

ApiSearchType the search type to use on the filters. By default, it will be ApiSearchType.EXACT.

sessionToken

String an specific session token for consuming the API. Only is required when you have an specific custom session handling with a valid session token for this request or you did not set the initial SDK setup. If null, you must have to set the initial SDK setup for handling automatically the session behind the scenes.