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.
Query segment detail by id
Arguments
id ● ID!non-null
Find segment by id
Return
creationDate ● Date!non-null
Creation time
id ● ID!non-null
Global id
lastEditDate ● Date
Latest editing time
name ● String!non-null
Segment name
query ● String!non-null
Query condition value
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
The Customer Segment.
query {
segment(id: "gid://shopline/Segment/GROUP6263607983794035520") {
id
name
query
creationDate
lastEditDate
}
}
Response
{
"data": {
"segment": {
"lastEditDate": "2023-12-29T12:31:29.295Z",
"name": "gql-opean-api-New-3",
"query": "{\"conditions\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"37a6365b-67bf-4c3e-86c2-f0b086db63db\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"26ba86d5-9658-4b2b-beed-7c27612eb7af\\\"}\",\"children\":[{\"type\":0,\"blockType\":0,\"metafield\":false,\"key\":\"payOrderCnt\",\"value\":[1],\"operator\":\"LT\"}]}]},\"not\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"8efe7f6f-96d4-457b-bccb-a5418abc200b1\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"53f86c31-aebe-4fab-9f20-b9f6f150322b1\\\"}\",\"children\":[]}]}}",
"creationDate": "2023-12-27T09:10:37.943Z",
"id": "gid://shopline/Segment/GROUP6263607983794035520"
}
}
}
Was this article helpful to you?