segments
query
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.
List of stores segment the market
Arguments
Returns the first n elements in the list.
Returns the last n elements in the list.
Whether to reverse the order of the list.
● true: reverse
● false: do not reverse
Default value: false
Sort by specified key value
Query conditions, such as segment name
Returns elements following the specified cursor. The
first argument must also be specified when using this argument.Returns elements preceding the specified cursor. The
last argument must also be specified when using this argument.Return
edges list
node list
Information to aid in pagination.
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
query segments
Code
query {
segments (first: 2, rawQuery: null,after:null,before:null,reverse:true,sortKey:LAST_EDIT_DATE) {
edges {
cursor
node {
id
name
query
creationDate
lastEditDate
}
}
nodes {
id
name
query
creationDate
lastEditDate
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Response
{
"data": {
"segments": {
"edges": [
{
"cursor": "39C77C6A85E202FDAAB6A0D829D4F007",
"node": {
"creationDate": "2022-09-13T11:20:19.745Z",
"id": "gid://shopline/Segment/GROUP5582449353606848831",
"lastEditDate": "2023-12-29T12:29:46.589Z",
"name": "New",
"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-a5418abc200a\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"53f86c31-aebe-4fab-9f20-b9f6f150322c\\\"}\",\"children\":[]}]}}"
}
},
{
"cursor": "AF52536A1951B28A30AAE8825A2B69B9",
"node": {
"name": "Returning",
"query": "{\"conditions\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"2ddd694c-43bf-4e51-8267-e81ae609f748\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"556149a7-de15-4525-83c8-14079adc017d\\\"}\",\"children\":[{\"type\":0,\"blockType\":0,\"metafield\":false,\"key\":\"payOrderCnt\",\"value\":[1],\"operator\":\"GT\"}]}]},\"not\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"65b327aa-e627-4df7-8276-af7649cade78\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"9adf2014-c753-4b68-b247-201f35ba98db\\\"}\",\"children\":[]}]}}",
"creationDate": "2022-09-13T11:20:19.762Z",
"id": "gid://shopline/Segment/GROUP5582449353892061504",
"lastEditDate": "2023-12-29T12:29:46.589Z"
}
}
],
"nodes": [
{
"creationDate": "2022-09-13T11:20:19.745Z",
"id": "gid://shopline/Segment/GROUP5582449353606848831",
"lastEditDate": "2023-12-29T12:29:46.589Z",
"name": "New",
"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-a5418abc200a\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"53f86c31-aebe-4fab-9f20-b9f6f150322c\\\"}\",\"children\":[]}]}}"
},
{
"creationDate": "2022-09-13T11:20:19.762Z",
"id": "gid://shopline/Segment/GROUP5582449353892061504",
"lastEditDate": "2023-12-29T12:29:46.589Z",
"name": "Returning",
"query": "{\"conditions\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"2ddd694c-43bf-4e51-8267-e81ae609f748\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"556149a7-de15-4525-83c8-14079adc017d\\\"}\",\"children\":[{\"type\":0,\"blockType\":0,\"metafield\":false,\"key\":\"payOrderCnt\",\"value\":[1],\"operator\":\"GT\"}]}]},\"not\":{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"65b327aa-e627-4df7-8276-af7649cade78\\\"}\",\"children\":[{\"type\":1,\"blockType\":0,\"metafield\":false,\"relation\":\"and\",\"extInfo\":\"{\\\"id\\\":\\\"9adf2014-c753-4b68-b247-201f35ba98db\\\"}\",\"children\":[]}]}}"
}
],
"pageInfo": {
"endCursor": "AF52536A1951B28A30AAE8825A2B69B9",
"hasNextPage": true,
"hasPreviousPage": false,
"startCursor": "39C77C6A85E202FDAAB6A0D829D4F007"
}
}
}
}
Was this article helpful to you?