Possible Bug: Customer Saved Search API Returns 0 Records With 'Customer Accepts Marketing' Filter

Highlighted
Excursionist
31 0 5

Hi,

 

I am working with customer saved searches, and I found a possible bug. In the Shopify admin, when creating a saved search that includes 'customer accepts marketing' filter, I can see all the records in a store that fit that criteria.

 

When making a call to a store through the API using the same criteria, I get 0 results back. I have tested removing the 'customer accepts marketing' criteria and I get results back as expected. 

 

Here is my saved search:

 

image.png

 

Here's an example of the GET request I am making (yes I know it's still an older version of the API):

 
/admin/api/2019-04/customer_saved_searches/973840580688/customers.json?page=1&limit=250
 
Here's a dump of the array that contains the response:
 
Array ( [http_status_code] => 200 [http_status_message] => OK [date] => Wed, 11 Mar 2020 01:55:26 GMT [content-type] => application/json; charset=utf-8 [transfer-encoding] => chunked [connection] => keep-alive [set-cookie] => __cfduid=d6e3f1ff5853f721d797704b7fa8507691583891726; expires=Fri, 10-Apr-20 01:55:26 GMT; path=/; domain=.myshopify.com; HttpOnly; SameSite=Lax [x-sorting-hat-podid] => 79 [x-sorting-hat-shopid] => 25601245264 [vary] => Accept-Encoding [referrer-policy] => origin-when-cross-origin [x-frame-options] => DENY [x-shopid] => 25601245264 [x-shardid] => 79 [x-stats-userid] => [x-stats-apiclientid] => 1964250 [x-stats-apipermissionid] => 204043812944 [http_x_shopify_shop_api_call_limit] => 1/40 [x-shopify-shop-api-call-limit] => 1/40 [x-shopify-api-version] => 2019-04 [x-shopify-api-version-warning] => https://shopify.dev/concepts/about-apis/versioning [x-shopify-api-deprecated-reason] => https://help.shopify.com/api/guides/paginated-rest-results [strict-transport-security] => max-age=7889238 [x-shopify-stage] => production [content-security-policy] => default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopify.cn https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=search&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fcustomers&source%5Bsection%5D=admin_api&source%5Buuid%5D=d0dd062e-5245-4cd4-8bb6-f2a993ea53fd [x-content-type-options] => nosniff [x-download-options] => noopen [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block; report=/xss-report?source%5Baction%5D=search&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fcustomers&source%5Bsection%5D=admin_api&source%5Buuid%5D=d0dd062e-5245-4cd4-8bb6-f2a993ea53fd [x-dc] => gcp-us-east1,gcp-us-central1,gcp-us-central1 [nel] => {"report_to":"network-errors","max_age":2592000,"failure_fraction":0.01,"success_fraction":0.0001} [report-to] => {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify"}]} [x-request-id] => d0dd062e-5245-4cd4-8bb6-f2a993ea53fd [cf-cache-status] => DYNAMIC [expect-ct] => max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" [alt-svc] => h3-27=":443"; ma=86400, h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400 [server] => cloudflare [cf-ray] => 5721a7399e0feaaa-IAD )
 
I have tried various combinations of filters in the saved searches that contain or do not contain the 'customer accepts marketing' filter, and all the attempts with 'customer accepts marketing' return 0 records, even though when viewing the saved searches in Shopify, I can see there are customer records for the saved search.
 
Thoughts?
WOTIO App: https://apps.shopify.com/automatic-account-invites
0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 72 130

Hi Brian,

 

I just tested this but I've been unable to replicate. Are you still seeing the issue on your end? Since I can't replicate I suspect this may have been a temporary issue, please try again and if you're still seeing the issue provide the X-Request-ID here and I'll have another look.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Excursionist
31 0 5

Hi JB,

 

I will test this again and get back to you. 

WOTIO App: https://apps.shopify.com/automatic-account-invites
0 Likes