Is there a way to get at all of a customer's orders on Shopify? For example:
o = ShopifyAPI::Customer.find(…).orders
At the moment there isn't a way to filter orders by customer through that endpoint.
You will need to get all orders and filter them by their contents, which includes the customer id.
orders.select{ |o| o.customer.id == customer_id }
If this needs to be done quickly, then you may need to store the orders in your database, and keep them in sync with webhooks. There is a Syncing with a Store page on the Shopify Wiki that explains how to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With