简体   繁体   中英

Shopify API Search Parameters

I'm trying to get all of my customers that don't accept marketing but nothing seems to be working that I'm trying.

ShopifyAPI::Customer.find(:all, :params => { accepts_marketing: false})

I'm using the shopify_api Ruby gem.

The search endpoint is a little different than the usual. As you point out, your issue has nothing to do with Rails. Instead, just provide the endpoint with a little more information and you'll be fine. Try this:

ShopifyAPI::Customer.all( from: :search, params: {q: "accepts_marketing:true"})

You can search on customer email, whatever you need when you specify the endpoint as search on the Customer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM