public function search($query)
{
$criteria = [];
foreach ($query as $term) {
$result = $term->toparam();
if (is_null($result) || empty($result)) {
throw new InvalidArgumentException('Operator must be provided');
}
$criteria[$term->name] = $term->toparam();
}
$path = $this->_config->merchantPath() . '/customers/advanced_search_ids';
$response = $this->_http->post($path, ['search' => $criteria]);
$pager = ['object' => $this, 'method' => 'fetch', 'methodArgs' => [$query]];
return new ResourceCollection($response, $pager);
}