In this link, you can easily find the topic Retrieve a list of all smart collections for a certain product_id
# Session is activated via Authentication
test_session = ShopifyAPI::Context.active_session
ShopifyAPI::SmartCollection.all(
session: test_session,
product_id: "632910392",
)