Adobe Commerce only. Learn more
customerSegments query
This query is part of the Storefront Compatibility Package. It will be added to Adobe Commerce 2.4.8-beta4.
The customerSegments
query returns information about the customer segments associated with the current customer or guest.
Customer segments allow merchants to dynamically display content and promotions to specific customers, based on various properties. Examples include customer address, order history, and shopping cart contents.
Syntax
Copied to your clipboard{customerSegments(cartId: String!): [CustomerSegment!]}
Reference
The customerSegments
reference provides detailed information about the types and fields defined in this query.
-->
Example usage
The following call returns segments currently applied to the visitor.
Request:
Copied to your clipboard{customerSegments(cartId: "kw6mLEvl6vjjPNsjtJqwpamv5o0iT1bc") {namedescriptionapply_to}}
Response:
Copied to your clipboard{"customerSegments": [{"name": "Guests","description": "All shoppers who are not logged in","apply_to": "VISITOR"}]}