Discussing APIs and development related to customers, discounts, and order management.
I'm looking to use the `segmentCreate` mutation to create a segment with an array of specific customer ID's. Looking at the syntax (https://shopify.dev/docs/api/shopifyql/segment-query-language-reference) I don't see that as an option. Is there a solution?
Solved! Go to the solution
This is an accepted solution.
Hi Jeff!
To work with segments in Shopify, you can create segments based on conditions using the `segmentCreate` mutation. These conditions can include customer properties, tags, order history, and other criteria. However, the ability to manually add specific customer IDs to a segment is not currently supported - there would need to be a specific property associated with this customer group already.
You could look at some alternative approaches such as creating custom customer tags or metafields to group customers and then querying customers based on those tags or metafields.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi Jeff!
To work with segments in Shopify, you can create segments based on conditions using the `segmentCreate` mutation. These conditions can include customer properties, tags, order history, and other criteria. However, the ability to manually add specific customer IDs to a segment is not currently supported - there would need to be a specific property associated with this customer group already.
You could look at some alternative approaches such as creating custom customer tags or metafields to group customers and then querying customers based on those tags or metafields.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog