> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Update Company

PUT https://api-b2b.bigcommerce.com/api/v3/io/companies/{companyId}
Content-Type: application/json

Updates a Company’s attributes.

If you have configured required information fields in your store’s Extra Fields settings for Company accounts or Company users, you must include the field’s name and value in the `extraFields` array of the request body. For more information on extra fields, see [B2B Edition Settings](https://support.bigcommerce.com/s/article/B2B-Edition-Settings) in the Help Center.

### Independent vs. Dependent Companies Behavior

This endpoint applies the same rules to the `customerGroupId` field as [Create a Company](#create-a-company), based on the Company behavior used in your store. Additionally, the `priceListAssign` field is not compatible with Independent Companies behavior because a Company’s price list is configured from its assigned customer group.

If your store is using Dependent Companies behavior, use the `priceListAssign` field to assign a price list to the Company account.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/management/company/companies/put-companies-company-id

## Authentication

- `X-Auth-Token` header (required) — | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts). | For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).
- `X-Store-Hash` header (required) — | Header | Argument | Description | |:-------|:---------|:------------| | `X-Store-Hash` | `store_hash` | The unique store hash associated with a BigCommerce store that has B2B Edition enabled. |

## Request

### Path parameters

- `companyId` (integer, required) — Unique numeric ID of the Company account.

### Body (application/json)

This endpoint expects an object.

- `companyName` (string, optional) — The name of the business associated with the Company account.
- `companyEmail` (string, optional) — The primary email address for the Company account.
- `companyPhone` (string, optional) — The primary phone number for the Company account.
- `customerGroupId` (integer, optional) — The ID of the BigCommerce customer group assigned to the Company account. This field can be static or configurable depending on whether or not your store uses Independent Companies behavior. See [Independent Companies Behavior](/developer/api-reference/rest/b2b/management/company/companies#independent-vs-dependent-companies-behavior) for more information.
- `addressLine1` (string, optional) — The first line of the primary address for the Company account.
- `addressLine2` (string, optional) — The second line of the primary address for the Company account.
- `city` (string, optional) — The city of the primary address for the Company account.
- `state` (string, optional) — The state of the primary address for the Company account, if applicable. This must be the full name and not an abbreviation.
- `country` (string, optional) — The country of the primary address for the Company account. This must be either the full name or the ISO2 country code.
- `zipCode` (string, optional) — The postal code of the primary address for the Company account.
- `uuid` (string, optional) — An external ID assigned to the Company account in a third-party system, such as an ERP. Leave this field blank if you do not have an external system.
- `priceListAssign` (list of PriceListAssignRequestItems, optional) — Use this array to assign a price list to a Company account if your store uses legacy Dependent Companies behavior *and* it has Multi-Storefront enabled. Use catalogId to assign price lists if you have not enabled Multi-Storefront. This field is read-only for stores using Independent Companies behavior. See [Independent Companies Behavior](/developer/api-reference/rest/b2b/management/company/companies#independent-vs-dependent-companies-behavior) for more information.
- `extraFields` (list of CompaniesCompanyIdPutRequestBodyContentApplicationJsonSchemaExtraFieldsItems, optional) — To use customized extra fields with field names you need to first add company extra fields in Settings > Extra fields inside B2B edition. e.g., If you want to create a new company with an extra integer field named licenseNO, you can use this structure \[\{'fieldName': 'LicenseNO', 'fieldValue': 10342340323}] in the request body.

## Response

### 200

OK

- `code` (double, optional)
- `meta` (CompaniesCompanyIdPutResponsesContentApplicationJsonSchemaMeta, optional)
- `data` (CompaniesCompanyIdPutResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 404 Not Found Error

Not Found

- `code` (double, optional)
- `data` (CompaniesCompanyIdPutResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CompaniesCompanyIdPutResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### PriceListAssignRequestItems

- `channelId` (integer, optional) — The ID of the storefront channel where the price list is applied to the Company. Use 1 for your store’s default storefront channel.
- `priceListId` (integer, optional) — The ID of the price list assigned to the Company account.

### CompaniesCompanyIdPutRequestBodyContentApplicationJsonSchemaExtraFieldsItems

- `fieldName` (string, optional) — The name of the Company extra field.
- `fieldValue` (string, optional) — The value of the Company extra field.

### CompaniesCompanyIdPutResponsesContentApplicationJsonSchemaMeta

- `message` (string, optional)

### CompaniesCompanyIdPutResponsesContentApplicationJsonSchemaData

## Examples

**Request**

```json
{
  "companyName": "Great Buys Inc",
  "companyEmail": "admin@greatbuys.com"
}
```

**Response**

```json
{
  "code": 200,
  "meta": {
    "message": "SUCCESS"
  },
  "data": {
    "companyId": 12
  }
}
```

**SDK Code**

```python Update a company
import requests

url = "https://api-b2b.bigcommerce.com/api/v3/io/companies/123456"

payload = {
    "companyName": "Great Buys Inc",
    "companyEmail": "admin@greatbuys.com"
}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update a company
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/companies/123456';
const options = {
  method: 'PUT',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"companyName":"Great Buys Inc","companyEmail":"admin@greatbuys.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update a company
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v3/io/companies/123456"

	payload := strings.NewReader("{\n  \"companyName\": \"Great Buys Inc\",\n  \"companyEmail\": \"admin@greatbuys.com\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update a company
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v3/io/companies/123456")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"companyName\": \"Great Buys Inc\",\n  \"companyEmail\": \"admin@greatbuys.com\"\n}"

response = http.request(request)
puts response.read_body
```

```java Update a company
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api-b2b.bigcommerce.com/api/v3/io/companies/123456")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"companyName\": \"Great Buys Inc\",\n  \"companyEmail\": \"admin@greatbuys.com\"\n}")
  .asString();
```

```php Update a company
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v3/io/companies/123456', [
  'body' => '{
  "companyName": "Great Buys Inc",
  "companyEmail": "admin@greatbuys.com"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Update a company
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v3/io/companies/123456");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"companyName\": \"Great Buys Inc\",\n  \"companyEmail\": \"admin@greatbuys.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update a company
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "companyName": "Great Buys Inc",
  "companyEmail": "admin@greatbuys.com"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v3/io/companies/123456")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```