---
title: "companyContact"
description: "公司联系人信息查询"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/b-2-b/queries/company-contact'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/b-2-b/queries/company-contact.md'
---
# companyContact

公司联系人信息查询

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

## 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

* `company`

  [Company](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/b-2-b/objects/company.md)

  公司信息

* `createdAt`

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

  创建时间

* `customer`

  [Customer](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/customer.md)

  客户信息

* `id`

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

  联系人id

* `isMainContact`

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

  是否主要联系人

* `locale`

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

  语言

* `updatedAt`

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

  更新时间

## Examples

### 查询公司联系人信息

根据联系人id查询联系人信息

**Request:**

```json
{
  companyContact(id:"gid://shopline/CompanyContact/4217281771") {
        id
        isMainContact
        company {
            id
            name
        }
        customer {
            id
            email
            phone
            firstName
            lastName
            numberOfOrders
            amountSpent {
                amount
                currencyCode
            }
            addresses {
               countryCodeV2
               address1
               address2
            }
            defaultAddress {
               countryCodeV2
               address1
               address2 
            }
            emailMarketingConsent {
                marketingState
                consentUpdatedAt
            }
        }
        createdAt
        updatedAt
  }
}

```

**Response:**

```json
{
  "data": {
    "data": {
      "companyContact": {
        "company": {
          "id": "6254924101557166237",
          "name": "S*****"
        },
        "createdAt": "2023-11-07T10:13:38.117Z",
        "customer": {
          "amountSpent": null,
          "defaultAddress": null,
          "emailMarketingConsent": {
            "consentUpdatedAt": "2023-11-07T10:13:39Z",
            "marketingState": "SUBSCRIBED"
          },
          "id": "gid://shopline/Customer/4217281771",
          "lastName": "T******",
          "numberOfOrders": null,
          "addresses": [],
          "email": "******@example.com",
          "firstName": "S******",
          "phone": null
        },
        "id": "gid://shopline/CompanyContact/4217281771",
        "isMainContact": true,
        "updatedAt": "2023-12-21T10:34:54.575Z"
      }
    }
  }
}
```

## 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)。

