Solved

How to create a Customer Segment with an array of Customer ID's?

Jeff-Blake
Shopify Partner
43 0 9

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?

Accepted Solution (1)

Liam
Shopify Staff
2731 293 744

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

View solution in original post

Reply 1 (1)

Liam
Shopify Staff
2731 293 744

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