---
title: Manage client company locations
description: >-
  Learn how the companyLocation object fits into building apps that support
  Shopify merchants selling business-to-business (B2B).
source_url:
  html: 'https://shopify.dev/docs/apps/build/b2b/manage-client-company-locations'
  md: 'https://shopify.dev/docs/apps/build/b2b/manage-client-company-locations.md'
api_name: admin
---

# Manage client company locations

When a Shopify merchant conducts business-to-business (B2B) transactions, they sell their goods and services directly to other companies. You can use the GraphQL Admin API to create [companies](https://shopify.dev/docs/api/admin-graphql/latest/objects/company) that represent those business customers and contain information about them.

A company can be associated with one or more [company locations](https://shopify.dev/docs/api/admin-graphql/latest/objects/companylocation). Each company location contains information that can be used to change how orders are calculated and charged for a specific company context. For example, a company might have multinational branches that need to follow different billing and taxation rules.

This tutorial shows you how to add a location to a company and make updates to the location information.

***

## What you'll learn

In this tutorial, you'll learn how to do the following tasks:

* [Add a company location to a company](#step-1-add-a-company-location-to-a-company)
* [Set up tax exemptions for a company location](#step-2-set-up-tax-exemptions-for-a-company-location)
* [Associate payment terms with a company location](#step-3-associate-payment-terms-with-a-company-location)

***

## Requirements

* You've [created a company](https://shopify.dev/docs/apps/build/b2b/start-building#step-1-create-a-company).
* You're familiar with the concept of [company locations](https://shopify.dev/docs/apps/build/b2b#how-it-works).

***

## Step 1: Add a company location to a company

You can use the [`companyLocationCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/companyLocationCreate) mutation to create and add a company location to a company:

## POST https://{shop}.myshopify.com/api/{api\_version}/graphql.json

## GraphQL mutation

```graphql
mutation {
  companyLocationCreate(companyId: "gid://shopify/Company/1", input: { name: "Second location"}) {
    companyLocation {
      id
      name
    }
    userErrors { field message }
  }
}
```

## JSON response

```json
{
  "data": {
    "companyLocationCreate": {
      "companyLocation": {
        "id": "gid://shopify/CompanyLocation/2",
        "name": "Second location"
      },
      "userErrors": []
    }
  }
}
```

***

## Step 2: Set up tax exemptions for a company location

If a company is exempt from sales tax at a location, then you should set up their tax exemption before they process any orders at that location.

Use the [`companyLocationTaxSettingsUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/companyLocationTaxSettingsUpdate) mutation to override the relevant taxes on the company's account.

The following example sets multiple tax exemptions on one company location. For details on all possible tax exemptions, reference the [`TaxExemption`](https://shopify.dev/docs/api/admin-graphql/latest/enums/TaxExemption) documentation.

## POST https://{shop}.myshopify.com/api/{api\_version}/graphql.json

## GraphQL mutation

```graphql
mutation {
  companyLocationTaxSettingsUpdate(companyLocationId: "gid://shopify/CompanyLocation/1", exemptionsToAssign: [CA_BC_RESELLER_EXEMPTION, CA_STATUS_CARD_EXEMPTION] ) {
    companyLocation {
      id
      taxSettings {
        taxExemptions
      }
    }
    userErrors { field message }
  }
}
```

## JSON response

```json
{
  "data": {
    "companyLocationTaxSettingsUpdate": {
      "companyLocation": {
        "id": "gid://shopify/CompanyLocation/1",
        "taxSettings": {
          "taxExemptions": [
            "CA_BC_RESELLER_EXEMPTION",
            "CA_STATUS_CARD_EXEMPTION"
          ]
        }
      }
    }
  }
}
```

***

## Step 3: Associate payment terms with a company location

Payment terms determine when a company needs to pay for an order. This could be in advance of the order, at the time of order, or within a given amount of time that the merchant decides upon with the company.

To attach payment terms to a company, pass the [`buyerExperienceConfiguration`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/companyLocationUpdate#field-companylocationupdateinput-buyerexperienceconfiguration) input including a `paymentTermsTemplateId` to the [`companyLocationUpdate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/companyLocationUpdate) mutation.

Refer to the [`paymentTermsCreate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/paymentTermsCreate) mutation documentation for information on creating payment terms.

The following example assigns payment terms with the ID `gid://shopify/PaymentTermsTemplate/2` to a company location:

## POST https://{shop}.myshopify.com/api/{api\_version}/graphql.json

## GraphQL mutation

```graphql
mutation {
  companyLocationUpdate(companyLocationId: "gid://shopify/CompanyLocation/22", input: {buyerExperienceConfiguration: {paymentTermsTemplateId: "gid://shopify/PaymentTermsTemplate/2"}}) {
    companyLocation {
      id
      buyerExperienceConfiguration {
        paymentTermsTemplate {
          id
          description
        }
      }
    }
  }
}
```

## JSON response

```json
{
  "data": {
    "companyLocationUpdate": {
      "companyLocation": {
        "id": "gid://shopify/CompanyLocation/22",
        "buyerExperienceConfiguration": {
          "paymentTermsTemplate": {
            "id": "gid://shopify/PaymentTermsTemplate/2",
            "description": "Within 7 days"
          }
        }
      }
    }
  }
}
```

***

## Next steps

* Learn how to [associate a price list and publication to a B2B catalog](https://shopify.dev/docs/apps/build/b2b/manage-catalogs) to determine the available products and prices for customers ordering for a specific B2B company location.
* Learn how to [manage draft orders for B2B clients](https://shopify.dev/docs/apps/build/b2b/draft-orders) by calculating and sending invoices.

***
