---
title: "companyLocation"
description: "Company location information query"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/b-2-b/queries/company-location'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/b-2-b/queries/company-location.md'
---
# companyLocation

Company location information query

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

## Type Signature

`CompanyLocation`

## Arguments

* `id`

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

  Company location ID

## Returns

* `billingAddress`

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

  Billing address

* `buyerExperienceConfiguration`

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

  Company location checkout configuration

* `company`

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

  Company information

* `createdAt`

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

  Creation time

* `id`

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

  Location id

* `name`

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

  Location name

* `orderCount`

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

  Order quantity

* `roleAssignments`

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

  Role assignment of company contacts under the company location

* `shippingAddress`

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

  Shipping address

* `taxExemptions`

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

  Customer's tax-free list

* `taxRegistrationId`

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

  The tax registration ID for the company location.

* `totalSpent`

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

  Order amount

* `updatedAt`

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

  Update time

## Code Example

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

## Examples

### Query company location information

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

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

