segment
Retrieves a customer Segment by ID. Segments are dynamic groups of customers that meet specific criteria defined through ShopifyQL queries.
Use segments for targeted marketing campaigns, analyzing customer behavior, or creating personalized experiences. Each segment includes its name, creation date, and the query that defines which Customer objects belong to it.
Anchor to Possible returnsPossible returns
- Anchor to SegmentSegment•Segment
A group of customers that meet specific criteria defined through ShopifyQL query conditions. Common use cases for segments include customer analytics, targeted marketing campaigns, and automated discount eligibility.
The segment's
queryfield contains ShopifyQL conditions that determine membership, such as purchase history, location, or engagement patterns. Tracks when the segment was created withand when it was last modified with.- Anchor to creationDatecreation•Date
Date Time! non-null The date and time when the segment was added to the store.
- •ID!non-null
A globally-unique ID.
- Anchor to lastEditDatelast•Date
Edit Date Time! non-null The date and time when the segment was last updated.
- Anchor to namename•String!non-null
The name of the segment.
- Anchor to queryquery•String!non-null
A precise definition of the segment. The definition is composed of a combination of conditions on facts about customers.