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

# Convert BigCommerce Customer Group into Company

POST https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/{customerGroupId}/companies
Content-Type: application/json

Creates a Company account that is automatically assigned to a BigCommerce customer group. You cannot create a Company from a customer group that already has an assigned Company account.

Note that this endpoint **is not supported** if your store:

* Has Multi-Storefront enabled
* Is using Independent Companies behavior

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.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/management/company/companies/post-companies-conversion-customer-groups

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

- `customerGroupId` (string, required) — The BigCommerce customer group ID associated with the Company account.

### Body (application/json)

This endpoint expects an object.

- `companyName` (string, required) — The name of the business associated with the Company account.
- `companyPhone` (string, required) — The primary phone number for the Company account.
- `companyEmail` (string, required) — The primary email address for the Company account.
- `country` (string, required) — The country of the primary address for the Company account. This must be either the full name or the ISO2 country code.
- `adminEmail` (string, required) — The email address of the Company account administrator. If an existing BigCommerce customer account uses this email address, it is automatically linked to the administrator’s Company user account.
- `adminPhoneNumber` (string, required) — The phone number of the Company account administrator.
- `catalogId` (string, optional) — The ID of the price list assigned to the Company account. This field is read-only for stores using [Independent Companies Behavior](/developer/api-reference/rest/b2b/management/company/companies#independent-vs-dependent-companies-behavior). If your store uses legacy Dependent Companies behavior **and** it does not have Multi-Storefront enabled, this field is **required** for creating new Company accounts. If your store has Multi-Storefront enabled, use the `priceListAssign` array instead.
- `acceptCreationEmail` (boolean, optional, default: false) — Indicates whether or not the administrator receives a welcome email when the Company account is created. `true`: Sends the welcome email to the admin user `false`: Does not send the email
- `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.
- `zipCode` (string, optional) — The postal code of the primary address for the Company account.
- `adminFirstName` (string, optional) — The first name of the Company account administrator.
- `adminLastName` (string, optional) — The last name of the Company account administrator.
- `extraFields` (list of CustomerGroupsCustomerGroupIdCompaniesPostRequestBodyContentApplicationJsonSchemaExtraFieldsItems, optional)
- `userExtraFields` (list of CustomerGroupsCustomerGroupIdCompaniesPostRequestBodyContentApplicationJsonSchemaUserExtraFieldsItems, optional)

## Response

### 200

OK

- `code` (integer, optional)
- `data` (CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaMeta, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `code` (double, optional)
- `data` (CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaMeta, optional)

### 404 Not Found Error

Not Found

- `code` (double, optional)
- `data` (CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### CustomerGroupsCustomerGroupIdCompaniesPostRequestBodyContentApplicationJsonSchemaExtraFieldsItems

- `fieldName` (string, required) — Field name that config in you store
- `fieldValue` (string, required) — Value of the extra field.

### CustomerGroupsCustomerGroupIdCompaniesPostRequestBodyContentApplicationJsonSchemaUserExtraFieldsItems

- `fieldName` (string, required) — Field name that config in you store
- `fieldValue` (string, required) — Value of the extra field.

### CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaData

### CustomerGroupsCustomerGroupIdCompaniesPostResponsesContentApplicationJsonSchemaMeta

- `message` (string, optional)

## Examples

**Request**

```json
{
  "companyName": "string",
  "companyPhone": "string",
  "companyEmail": "string",
  "country": "string",
  "adminEmail": "string",
  "adminPhoneNumber": "string",
  "catalogId": "0",
  "acceptCreationEmail": false,
  "addressLine1": "string",
  "addressLine2": "string",
  "city": "string",
  "state": "string",
  "zipCode": "string",
  "adminFirstName": "string",
  "adminLastName": "string",
  "extraFields": [
    {
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "description": "String"
}
```

**Response**

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

**SDK Code**

```python Convert customer group into a company
import requests

url = "https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/123/companies"

payload = {
    "companyName": "string",
    "companyPhone": "string",
    "companyEmail": "string",
    "country": "string",
    "adminEmail": "string",
    "adminPhoneNumber": "string",
    "catalogId": "0",
    "acceptCreationEmail": False,
    "addressLine1": "string",
    "addressLine2": "string",
    "city": "string",
    "state": "string",
    "zipCode": "string",
    "adminFirstName": "string",
    "adminLastName": "string",
    "extraFields": [
        {
            "fieldName": "string",
            "fieldValue": "string"
        }
    ],
    "description": "String"
}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Convert customer group into a company
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/123/companies';
const options = {
  method: 'POST',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"companyName":"string","companyPhone":"string","companyEmail":"string","country":"string","adminEmail":"string","adminPhoneNumber":"string","catalogId":"0","acceptCreationEmail":false,"addressLine1":"string","addressLine2":"string","city":"string","state":"string","zipCode":"string","adminFirstName":"string","adminLastName":"string","extraFields":[{"fieldName":"string","fieldValue":"string"}],"description":"String"}'
};

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

```go Convert customer group into a company
package main

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

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/123/companies"

	payload := strings.NewReader("{\n  \"companyName\": \"string\",\n  \"companyPhone\": \"string\",\n  \"companyEmail\": \"string\",\n  \"country\": \"string\",\n  \"adminEmail\": \"string\",\n  \"adminPhoneNumber\": \"string\",\n  \"catalogId\": \"0\",\n  \"acceptCreationEmail\": false,\n  \"addressLine1\": \"string\",\n  \"addressLine2\": \"string\",\n  \"city\": \"string\",\n  \"state\": \"string\",\n  \"zipCode\": \"string\",\n  \"adminFirstName\": \"string\",\n  \"adminLastName\": \"string\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"string\",\n      \"fieldValue\": \"string\"\n    }\n  ],\n  \"description\": \"String\"\n}")

	req, _ := http.NewRequest("POST", 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 Convert customer group into a company
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"companyName\": \"string\",\n  \"companyPhone\": \"string\",\n  \"companyEmail\": \"string\",\n  \"country\": \"string\",\n  \"adminEmail\": \"string\",\n  \"adminPhoneNumber\": \"string\",\n  \"catalogId\": \"0\",\n  \"acceptCreationEmail\": false,\n  \"addressLine1\": \"string\",\n  \"addressLine2\": \"string\",\n  \"city\": \"string\",\n  \"state\": \"string\",\n  \"zipCode\": \"string\",\n  \"adminFirstName\": \"string\",\n  \"adminLastName\": \"string\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"string\",\n      \"fieldValue\": \"string\"\n    }\n  ],\n  \"description\": \"String\"\n}"

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

```java Convert customer group into a company
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/123/companies")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"companyName\": \"string\",\n  \"companyPhone\": \"string\",\n  \"companyEmail\": \"string\",\n  \"country\": \"string\",\n  \"adminEmail\": \"string\",\n  \"adminPhoneNumber\": \"string\",\n  \"catalogId\": \"0\",\n  \"acceptCreationEmail\": false,\n  \"addressLine1\": \"string\",\n  \"addressLine2\": \"string\",\n  \"city\": \"string\",\n  \"state\": \"string\",\n  \"zipCode\": \"string\",\n  \"adminFirstName\": \"string\",\n  \"adminLastName\": \"string\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"string\",\n      \"fieldValue\": \"string\"\n    }\n  ],\n  \"description\": \"String\"\n}")
  .asString();
```

```php Convert customer group into a company
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/123/companies', [
  'body' => '{
  "companyName": "string",
  "companyPhone": "string",
  "companyEmail": "string",
  "country": "string",
  "adminEmail": "string",
  "adminPhoneNumber": "string",
  "catalogId": "0",
  "acceptCreationEmail": false,
  "addressLine1": "string",
  "addressLine2": "string",
  "city": "string",
  "state": "string",
  "zipCode": "string",
  "adminFirstName": "string",
  "adminLastName": "string",
  "extraFields": [
    {
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "description": "String"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Convert customer group into a company
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/123/companies");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"companyName\": \"string\",\n  \"companyPhone\": \"string\",\n  \"companyEmail\": \"string\",\n  \"country\": \"string\",\n  \"adminEmail\": \"string\",\n  \"adminPhoneNumber\": \"string\",\n  \"catalogId\": \"0\",\n  \"acceptCreationEmail\": false,\n  \"addressLine1\": \"string\",\n  \"addressLine2\": \"string\",\n  \"city\": \"string\",\n  \"state\": \"string\",\n  \"zipCode\": \"string\",\n  \"adminFirstName\": \"string\",\n  \"adminLastName\": \"string\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"string\",\n      \"fieldValue\": \"string\"\n    }\n  ],\n  \"description\": \"String\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Convert customer group into a company
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "companyName": "string",
  "companyPhone": "string",
  "companyEmail": "string",
  "country": "string",
  "adminEmail": "string",
  "adminPhoneNumber": "string",
  "catalogId": "0",
  "acceptCreationEmail": false,
  "addressLine1": "string",
  "addressLine2": "string",
  "city": "string",
  "state": "string",
  "zipCode": "string",
  "adminFirstName": "string",
  "adminLastName": "string",
  "extraFields": [
    [
      "fieldName": "string",
      "fieldValue": "string"
    ]
  ],
  "description": "String"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v3/io/customer-groups/123/companies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```