bigcommerce-api-php icon indicating copy to clipboard operation
bigcommerce-api-php copied to clipboard

getCustomers filter throws "field 'id' is not supported by this resource"

Open CosmePantin opened this issue 5 years ago • 3 comments

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.

CosmePantin avatar Aug 20 '19 00:08 CosmePantin

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 avatar Aug 20 '19 15:08 karen-white

@karen-white what is the roadmap for for v3 support, because the v3 branch does not look active.

0dp avatar Oct 31 '19 13:10 0dp

@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..

THPAdmin avatar Oct 23 '20 19:10 THPAdmin