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

# Bulk Create Companies

POST https://api-b2b.bigcommerce.com/api/v3/io/companies/bulk
Content-Type: application/json

Creates multiple Company accounts at once. You can create up to `10` Companies in a single request.

See [Create a Company](#create-a-company) for recommendations on formatting individual Companies in the array.

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

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

### Body (application/json)

This endpoint expects a list of CompaniesBulkPostRequestBodyContentApplicationJsonSchemaItems.

- `list of CompaniesBulkPostRequestBodyContentApplicationJsonSchemaItems`

## Response

### 200

OK

- `code` (integer, optional)
- `meta` (list of CompaniesBulkPostResponsesContentApplicationJsonSchemaMetaItems, optional)
- `data` (CompaniesBulkPostResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 400 Bad Request Error

Bad Request; creation failed for some Companies

- `code` (double, optional)
- `data` (CompaniesBulkPostResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CompaniesBulkPostResponsesContentApplicationJsonSchemaMeta, optional)

### 409 Conflict Error

The Company was in conflict with another Company. This is the result of duplicate unique values, or missing or invalid `companyEmail`, `phoneNumber` or required `extraFields`.

- `code` (double, optional)
- `data` (CompaniesBulkPostResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CompaniesBulkPostResponsesContentApplicationJsonSchemaMeta, optional)

### 413 Content Too Large Error

Request Entity Too Large. In normal conditions, the bulk create or update method supports 10 entities in one request.

- `code` (integer, optional) — HTTP status code of the response.
- `data` (CompaniesBulkPostResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CompaniesBulkPostResponsesContentApplicationJsonSchemaMeta, optional)

### 422 Unprocessable Entity Error

Company was not valid. This is the result of missing required fields or invalid data. See the response for more details.

- `code` (double, optional)
- `data` (CompaniesBulkPostResponsesContentApplicationJsonSchemaData, optional)
- `meta` (CompaniesBulkPostResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### CompaniesBulkPostRequestBodyContentApplicationJsonSchemaItems

- `companyName` (string, required) — The name of the business associated with the Company account.
- `companyEmail` (string, required) — The primary email address for the Company account.
- `companyPhone` (string, required) — The primary phone number 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.
- `adminFirstName` (string, required) — The first name of the Company account administrator.
- `adminLastName` (string, required) — The last name of the Company account administrator.
- `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.
- `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.
- `zipCode` (string, optional) — The postal code of the primary address for the Company account.
- `adminPhoneNumber` (string, optional) — The phone number of the Company account administrator.
- `userExtraFields` (list of CompaniesBulkPostRequestBodyContentApplicationJsonSchemaItemsUserExtraFieldsItems, optional) — Extra fields to apply to the Company administrator user.
- `acceptWelcomeEmail` (boolean, optional) — If user accepts, the system sends a welcome email.
- `extraFields` (CompaniesBulkPostRequestBodyContentApplicationJsonSchemaItemsExtraFields, optional) — Extra fields you want to add to the company fields.
- `channelIds` (list of integer, optional) — The storefront channel IDs in which buyers can access their Company’s Buyer Portal. Use `1` for your store’s default storefront channel.
- `originChannelId` (integer, optional) — The storefront channel ID designated as the origin for the Company administrator. Use 1 for your store’s default storefront channel.

### CompaniesBulkPostResponsesContentApplicationJsonSchemaMetaItems

- `companyId` (integer, optional) — Unique numeric ID of the Company account. This is a **read-only** field; do not set or modify its value in a `POST` or `PUT` request.

### CompaniesBulkPostResponsesContentApplicationJsonSchemaData

- `errors` (list of CompaniesBulkPostResponsesContentApplicationJsonSchemaDataErrorsItems, optional)

### CompaniesBulkPostResponsesContentApplicationJsonSchemaMeta

- `message` (string, optional)

### CompaniesBulkPostRequestBodyContentApplicationJsonSchemaItemsUserExtraFieldsItems

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

### CompaniesBulkPostRequestBodyContentApplicationJsonSchemaItemsExtraFields

Extra fields you want to add to the company fields.

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

### CompaniesBulkPostResponsesContentApplicationJsonSchemaDataErrorsItems

- `id` (string, optional)
- `_detail` (string, optional)

## Examples

**Request**

```json
[
  {
    "companyName": "string",
    "companyEmail": "admin@greatbuys.com",
    "companyPhone": "8001234567",
    "country": "`United States` or `US`",
    "adminFirstName": "Marie",
    "adminLastName": "Curie",
    "adminEmail": "m.curie@greatbuys.com"
  }
]
```

**Response**

```json
{
  "code": 200,
  "meta": [
    {
      "companyId": 1
    }
  ],
  "data": {
    "id": "string"
  }
}
```

**SDK Code**

```python 200 - SUCCESS
import requests

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

payload = [
    {
        "companyName": "string",
        "companyEmail": "admin@greatbuys.com",
        "companyPhone": "8001234567",
        "country": "`United States` or `US`",
        "adminFirstName": "Marie",
        "adminLastName": "Curie",
        "adminEmail": "m.curie@greatbuys.com"
    }
]
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 200 - SUCCESS
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/companies/bulk';
const options = {
  method: 'POST',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '[{"companyName":"string","companyEmail":"admin@greatbuys.com","companyPhone":"8001234567","country":"`United States` or `US`","adminFirstName":"Marie","adminLastName":"Curie","adminEmail":"m.curie@greatbuys.com"}]'
};

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

```go 200 - SUCCESS
package main

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

func main() {

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

	payload := strings.NewReader("[\n  {\n    \"companyName\": \"string\",\n    \"companyEmail\": \"admin@greatbuys.com\",\n    \"companyPhone\": \"8001234567\",\n    \"country\": \"`United States` or `US`\",\n    \"adminFirstName\": \"Marie\",\n    \"adminLastName\": \"Curie\",\n    \"adminEmail\": \"m.curie@greatbuys.com\"\n  }\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 200 - SUCCESS
require 'uri'
require 'net/http'

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

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  {\n    \"companyName\": \"string\",\n    \"companyEmail\": \"admin@greatbuys.com\",\n    \"companyPhone\": \"8001234567\",\n    \"country\": \"`United States` or `US`\",\n    \"adminFirstName\": \"Marie\",\n    \"adminLastName\": \"Curie\",\n    \"adminEmail\": \"m.curie@greatbuys.com\"\n  }\n]"

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

```java 200 - SUCCESS
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/companies/bulk")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"companyName\": \"string\",\n    \"companyEmail\": \"admin@greatbuys.com\",\n    \"companyPhone\": \"8001234567\",\n    \"country\": \"`United States` or `US`\",\n    \"adminFirstName\": \"Marie\",\n    \"adminLastName\": \"Curie\",\n    \"adminEmail\": \"m.curie@greatbuys.com\"\n  }\n]")
  .asString();
```

```php 200 - SUCCESS
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v3/io/companies/bulk', [
  'body' => '[
  {
    "companyName": "string",
    "companyEmail": "admin@greatbuys.com",
    "companyPhone": "8001234567",
    "country": "`United States` or `US`",
    "adminFirstName": "Marie",
    "adminLastName": "Curie",
    "adminEmail": "m.curie@greatbuys.com"
  }
]',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp 200 - SUCCESS
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v3/io/companies/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"companyName\": \"string\",\n    \"companyEmail\": \"admin@greatbuys.com\",\n    \"companyPhone\": \"8001234567\",\n    \"country\": \"`United States` or `US`\",\n    \"adminFirstName\": \"Marie\",\n    \"adminLastName\": \"Curie\",\n    \"adminEmail\": \"m.curie@greatbuys.com\"\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 200 - SUCCESS
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "companyName": "string",
    "companyEmail": "admin@greatbuys.com",
    "companyPhone": "8001234567",
    "country": "`United States` or `US`",
    "adminFirstName": "Marie",
    "adminLastName": "Curie",
    "adminEmail": "m.curie@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/bulk")! 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()
```