bigcommerce-api-php
bigcommerce-api-php copied to clipboard
getCustomers filter throws "field 'id' is not supported by this resource"
I am trying to get the customer information with the address in 1 call/
The client.php getCustomer function only allows $id value. I thought about using the getCustomers function which allows filters:
/** * The list of customers. * * @param array $filter * @return array */ public static function getCustomers($filter = array()) { $filter = Filter::create($filter); return self::getCollection('/customers' . $filter->toQuery(), 'Customer'); }
When I call the function with an array with the id and the include addresses I get errors. I can't pass even the id in the filter:
"The field 'id' is not supported by this resource."
I tried setting the key in the array as 'id' and 'id:in', as shown in the query parameters in:
https://developer.bigcommerce.com/api-reference/customer-subscribers/v3-customers-api/customers/customersget
In the example of the documentation I can get the customer information and the addresses in 1 call using v3. I checked the customer v2 schema and I can't find any filter option.
How do I use the filter option in the function if it seems it is unavailable? Am I using the right function or is it unavailable through the php client?
Thank you.
Hey @Reshkill , This API client only supports our v2 API, which would require 2 separate calls to get the customer by ID and then their address. We're hoping to support v3 in the PHP client in the near future.
@karen-white what is the roadmap for for v3 support, because the v3 branch does not look active.
@0dp (1 year later..) Apparently it is not a priority. Sigh. Last release was 2+ years ago.. Isn't this the official API? Shopify has made tons of updates this year! Our company should have gone with Shopify..