---
title: "segment"
description: "根据id查询细分详情"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/queries/segment'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/queries/segment.md'
---
# segment

根据id查询细分详情

- **Required Scopes:** `read_customers`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`Segment`

## Required Permissions

* `read_customers`

接口访问需要令牌，具体如何获取令牌请参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md)

## Arguments

* `id`

  [ID!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  按id查找细分

## Returns

* `creationDate`

  [Date!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  创建时间

* `id`

  [ID!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  全局id

* `lastEditDate`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  最新编辑时间

* `name`

  [String!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  细分名称

* `query`

  [String!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  查询条件值

## Code Example

```graphql
 {
	segment(id ) 
		 {
			# Segment fields
		}
}
```

## Examples

### 查看细分详情

根据ID查询详情

**Request:**

```json
query {
  segment(id: "gid://shopline/Segment/GROUP6263607983794035520") {
    id
    name
    query
    creationDate
    lastEditDate
  }
}

```

**Response:**

```json
{
  "data": {
    "data": {
      "segment": {
        "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",
        "lastEditDate": "2023-12-29T12:31:29.295Z",
        "name": "gql-opean-api-New-3"
      }
    }
  }
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

