---
title: "companyLocation"
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-location'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/b-2-b/queries/company-location.md'
---
# companyLocation

公司地点信息查询

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`CompanyLocation`

## Arguments

* `id`

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

  公司地点 ID

## Returns

* `billingAddress`

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

  账单地址

* `buyerExperienceConfiguration`

  [BuyerExperienceConfiguration](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/buyer-experience-configuration.md)

  公司地点结账设置

* `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)

  创建时间

* `id`

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

  地点id

* `name`

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

  地点名称

* `orderCount`

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

  订单数量

* `roleAssignments`

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

  公司地点下公司联系人的角色分配内容

* `shippingAddress`

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

  收货地址

* `taxExemptions`

  [[FreeAreas]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/free-areas.md)

  客户的免税列表

* `taxRegistrationId`

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

  公司所在地的税务登记ID

* `totalSpent`

  [MoneyV2](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/money-v2.md)

  订单金额

* `updatedAt`

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

  更新时间

## Code Example

```graphql
 {
	companyLocation(id ) 
		 {
			# CompanyLocation fields
		}
}
```

## Examples

### 查询公司地点信息

根据公司地点id查询地点信息

**Request:**

```json
{
  companyLocation(id:"gid://shopline/CompanyLocation/6245049488106857931") {
      id
      name
      orderCount
      totalSpent {
          amount
          currencyCode
      }
      taxRegistrationId
      taxExemptions{
            countryCode
            provinceGCodeList
      }
      billingAddress {
          address1
          address2
          countryCode
          country
          createdAt
          id
          zip
          city
          province
      }
      shippingAddress {
          address1
          address2
          countryCode
          country
          createdAt
          id
          zip
          city
          province
      }
      company {
        id
        name
        mainContact{
            id
            createdAt
            customer {
                id
                displayName
                email
                firstName
                lastName
                locale
                phone
                createdAt
                updatedAt
                state
            }
          }
        }
    roleAssignments(first:"10") {
      pageInfo{
        startCursor
        endCursor
        hasPreviousPage
        hasNextPage
      }
      nodes{
        id
        role {
          id
          name
        }
        createdAt
        companyId
        locationId
        companyContactId
      }
      edges{
        cursor
        node {
          id
        }
      }
    }
  }
}

```

**Response:**

```json
{
  "data": {
    "data": {
      "companyLocation": {
        "id": "gid://shopline/CompanyLocation/6245049488106857931",
        "name": "location 6",
        "roleAssignments": {
          "edges": [
            {
              "node": {
                "id": "gid://shopline/CompanyContactRoleAssignment/6620008043806991631"
              },
              "cursor": "-"
            },
            {
              "cursor": "-",
              "node": {
                "id": "gid://shopline/CompanyContactRoleAssignment/6682541485471572843"
              }
            }
          ],
          "nodes": [
            {
              "locationId": "gid://shopline/CompanyLocation/6620008035519046926",
              "role": {
                "id": "gid://shopline/CompanyContactRole/164499664320702",
                "name": "BUYER"
              },
              "companyContactId": "gid://shopline/CompanyContact/4603149669",
              "companyId": "gid://shopline/Company/6620008035519046925",
              "createdAt": "2024-08-29T06:02:16.908Z",
              "id": "gid://shopline/CompanyContactRoleAssignment/6620008043806991631"
            },
            {
              "id": "gid://shopline/CompanyContactRoleAssignment/6682541485471572843",
              "locationId": "gid://shopline/CompanyLocation/6620008035519046926",
              "role": {
                "id": "gid://shopline/CompanyContactRole/164499664320701",
                "name": "ADMIN"
              },
              "companyContactId": "gid://shopline/CompanyContact/4603165148",
              "companyId": "gid://shopline/Company/6620008035519046925",
              "createdAt": "2024-10-11T09:23:40.485Z"
            }
          ],
          "pageInfo": {
            "hasPreviousPage": false,
            "startCursor": "AF52536A1951B28A30AAE8825A2B69B9",
            "endCursor": "E002CE0E792FBA4E98672D39851FDFD6",
            "hasNextPage": false
          }
        },
        "taxRegistrationId": "909999999999",
        "totalSpent": {
          "currencyCode": "USD",
          "amount": "0"
        },
        "billingAddress": {
          "address2": "Apartment 2",
          "city": "Louisville",
          "createdAt": "2023-12-14T13:54:25.706Z",
          "id": "6245049493408458190",
          "zip": "40202",
          "address1": "Chestnut Street 92",
          "country": "United States",
          "countryCode": "US",
          "province": "Kentucky"
        },
        "company": {
          "mainContact": {
            "createdAt": "2023-11-10T06:05:54.407Z",
            "customer": {
              "createdAt": "2023-11-10T06:05:54.407Z",
              "displayName": "shopapp02 app1",
              "email": "664051982@qq.com",
              "id": "gid://shopline/Customer/4217297874",
              "lastName": "app1",
              "locale": null,
              "firstName": "shopapp02",
              "phone": null,
              "state": "ENABLED",
              "updatedAt": "2023-12-15T03:30:58.400Z"
            },
            "id": "gid://shopline/CompanyContact/gid://shopline/CompanyContact/4217297874"
          },
          "name": "test2",
          "id": "gid://shopline/Company/6245049488106857930"
        },
        "orderCount": 0,
        "shippingAddress": {
          "country": "United States",
          "countryCode": "US",
          "province": "Kentucky",
          "zip": "40202",
          "city": "Louisville",
          "createdAt": "2023-12-14T13:54:25.706Z",
          "id": "6245049493408458190",
          "address1": "Chestnut Street 92",
          "address2": "Apartment 2"
        },
        "taxExemptions": [
          {
            "countryCode": "US",
            "provinceGCodeList": [
              "AL",
              "AK"
            ]
          }
        ]
      }
    }
  }
}
```

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

