Requires read_customers access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Determine whether the customer belongs to this segment
Arguments
segmentIds ● [ID]
Segment id collection
customerId ● ID
Customer ID
Return
memberships ● [SegmentMembership]
Query the group membership status results of a specified customer
More
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Determine whether the customer belongs to this segment
query {
customerSegmentMembership(customerId:"gid://shopline/Customer/4217496594", segmentIds:["gid://shopline/Segment/GROUP6263607983794035520","gid://shopline/Segment/GROUP6260749493660558176","gid://shopline/Segment/GROUP5582449354143719745"]) {
memberships {
isMember
segmentId
}
}
}
Response
{
"data": {
"customerSegmentMembership": {
"memberships": [
{
"isMember": true,
"segmentId": "gid://shopline/Segment/GROUP6260749493660558176"
},
{
"segmentId": "gid://shopline/Segment/GROUP5582449354143719745",
"isMember": false
},
{
"isMember": true,
"segmentId": "gid://shopline/Segment/GROUP6263607983794035520"
}
]
}
}
}
Was this article helpful to you?