Hi there.
Is there any way to check whether the current customer belongs to a specific customer segment during the checkout process?
I can query customerSegmentMembership via the Admin GraphQL API on the backend, but checkout doesn’t seem to expose customer segment data.
Is there any supported approach or recommended workaround for this?
Hi @ron_weasley
I believe the best approach would be to use metafields with your app, as these would be accessible during checkout.
For example, use customerSegmentMembership to check if a customer belongs to certain segment and then write the result into a customer metafield. Then you could use that metafield to drive behavior in checkout, by having your Checkout UI extension call your app’s backend, which:
- Looks up the customer by ID
- Reads the metafield
- Returns a simple flag (isVip: true/false, etc.) to the extension
Would that flow work for you?