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

# Create Company

POST https://api-b2b.bigcommerce.com/api/v2/frontend/companies
Content-Type: application/json

Submit a Business Account application on the storefront to create a Company account in the Pending status. This is an anonymous operation which does not require a [storefront authToken](/developer/api-reference/rest/b2b/storefront/authentication) for a particular customer.

Equivalent Storefront GraphQL API Mutation: `companyCreate`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).

> The `registerCompany` mutation in the BigCommerce Storefront GraphQL API also allows you to create a new Company account as a storefront customer. See [Company Account Registration](/developer/docs/b2b-edition/storefront/graphql-storefront-api/overview) to learn more.

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.

### Pending Company Accounts

If your store uses [Independent Companies behavior](https://support.bigcommerce.com/s/article/Companies-and-Customer-Groups), buyers with a pending Company account cannot log in to the B2C version of the Buyer Portal or view previous orders until you have approved or rejected their Company application. Depending on your Company management setting configurations, they may also be restricted from viewing products and placing orders.

When you approve an application, the buyer can log in to the B2B version of the Buyer Portal and view previous orders. Rejecting an application restores their access to the B2C version of the Buyer Portal.

For stores using legacy Dependent Companies behavior, buyers with a pending Company account can still log in to the Buyer Portal and view their orders before you have processed their application.

See [Companies (Help Center)](https://support.bigcommerce.com/s/article/B2B-Edition-User-Guide-Company-and-Customer-Functions) to learn more about the settings and buyer experience for pending Company accounts.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/storefront/company/companies/createcompany-frontend

## Authentication

- `Authorization` header (bearer token, required) — ### Authentication header | Header | Argument | Description | | :-------------- | :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Authorization` | `Bearer {{B2B_JWT_TOKEN}}` | You can obtain this token using the steps described in the [REST Storefront API](/developer/docs/b2b-edition/getting-started/authentication#rest-storefront-api) section\[...] |

## Request

### Body (application/json)

This endpoint expects an object.

- `companyName` (string, required) — The name of the Company associated with the order's buyer.
- `companyPhoneNumber` (string, required) — The primary phone number for the Company account.
- `companyFirstName` (string, required) — The first name of the Company account administrator.
- `companyLastName` (string, required) — The last name of the Company account administrator.
- `customerEmail` (string, required) — The email address of the BigCommerce customer account for the Company account administrator. Must match the email on the customer account identified by `customerId`.
- `customerId` (string, required) — The ID of the BigCommerce customer account for the Company account administrator.
- `storeHash` (string, required) — The unique store hash for the BigCommerce store.
- `companyEmail` (string, required) — The primary email address of the company.
- `addressLine1` (string, required) — The first line of the address
- `addressLine2` (string, required) — The second line of the address
- `city` (string, required) — City of the address.
- `zipCode` (string, required) — Zip or Postal Code of the address.
- `state` (string, required) — State of the address.
- `country` (string, required) — Country of the address.
- `extraFields` (list of FrontendCompaniesPostRequestBodyContentApplicationJsonSchemaExtraFieldsItems, optional)

## Response

### 200

OK

- `code` (double, optional, default: 200)
- `message` (string, optional)
- `data` (FrontendCompaniesPostResponsesContentApplicationJsonSchemaData, optional) — Response data.

## Errors

### 400 Bad Request Error

Bad Request

- `code` (double, optional) — The application-level error code for the response.
- `data` (FrontendCompaniesPostResponsesContentApplicationJsonSchemaData, optional) — Response data.
- `message` (string, optional) — A message describing the error.

## Types

### FrontendCompaniesPostRequestBodyContentApplicationJsonSchemaExtraFieldsItems

- `fieldName` (string, optional) — The name of the extra field.
- `fieldValue` (string, optional) — The value of the extra field as a string, dependent on the `fieldType`.

### FrontendCompaniesPostResponsesContentApplicationJsonSchemaData

Response data.

## Examples

**Request**

```json
{
  "companyName": "Great Buys",
  "companyPhoneNumber": "1234567890",
  "companyFirstName": "Robert",
  "companyLastName": "Robertson",
  "customerEmail": "admin@example.com",
  "customerId": "string",
  "storeHash": "abc123",
  "companyEmail": null,
  "addressLine1": "512 Bluebonnet Lane",
  "addressLine2": "Building 2",
  "city": "Austin",
  "zipCode": "78726",
  "state": "Texas",
  "country": "United States"
}
```

**Response**

```json
{
  "code": 200,
  "message": "string",
  "data": {
    "companyId": 123456
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-b2b.bigcommerce.com/api/v2/frontend/companies"

payload = {
    "companyName": "Great Buys",
    "companyPhoneNumber": "1234567890",
    "companyFirstName": "Robert",
    "companyLastName": "Robertson",
    "customerEmail": "admin@example.com",
    "customerId": "string",
    "storeHash": "abc123",
    "companyEmail": None,
    "addressLine1": "512 Bluebonnet Lane",
    "addressLine2": "Building 2",
    "city": "Austin",
    "zipCode": "78726",
    "state": "Texas",
    "country": "United States"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-b2b.bigcommerce.com/api/v2/frontend/companies';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"companyName":"Great Buys","companyPhoneNumber":"1234567890","companyFirstName":"Robert","companyLastName":"Robertson","customerEmail":"admin@example.com","customerId":"string","storeHash":"abc123","companyEmail":null,"addressLine1":"512 Bluebonnet Lane","addressLine2":"Building 2","city":"Austin","zipCode":"78726","state":"Texas","country":"United States"}'
};

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

```go
package main

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

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v2/frontend/companies"

	payload := strings.NewReader("{\n  \"companyName\": \"Great Buys\",\n  \"companyPhoneNumber\": \"1234567890\",\n  \"companyFirstName\": \"Robert\",\n  \"companyLastName\": \"Robertson\",\n  \"customerEmail\": \"admin@example.com\",\n  \"customerId\": \"string\",\n  \"storeHash\": \"abc123\",\n  \"companyEmail\": null,\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"state\": \"Texas\",\n  \"country\": \"United States\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v2/frontend/companies")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"companyName\": \"Great Buys\",\n  \"companyPhoneNumber\": \"1234567890\",\n  \"companyFirstName\": \"Robert\",\n  \"companyLastName\": \"Robertson\",\n  \"customerEmail\": \"admin@example.com\",\n  \"customerId\": \"string\",\n  \"storeHash\": \"abc123\",\n  \"companyEmail\": null,\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"state\": \"Texas\",\n  \"country\": \"United States\"\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-b2b.bigcommerce.com/api/v2/frontend/companies")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"companyName\": \"Great Buys\",\n  \"companyPhoneNumber\": \"1234567890\",\n  \"companyFirstName\": \"Robert\",\n  \"companyLastName\": \"Robertson\",\n  \"customerEmail\": \"admin@example.com\",\n  \"customerId\": \"string\",\n  \"storeHash\": \"abc123\",\n  \"companyEmail\": null,\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"state\": \"Texas\",\n  \"country\": \"United States\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v2/frontend/companies', [
  'body' => '{
  "companyName": "Great Buys",
  "companyPhoneNumber": "1234567890",
  "companyFirstName": "Robert",
  "companyLastName": "Robertson",
  "customerEmail": "admin@example.com",
  "customerId": "string",
  "storeHash": "abc123",
  "companyEmail": null,
  "addressLine1": "512 Bluebonnet Lane",
  "addressLine2": "Building 2",
  "city": "Austin",
  "zipCode": "78726",
  "state": "Texas",
  "country": "United States"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/frontend/companies");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"companyName\": \"Great Buys\",\n  \"companyPhoneNumber\": \"1234567890\",\n  \"companyFirstName\": \"Robert\",\n  \"companyLastName\": \"Robertson\",\n  \"customerEmail\": \"admin@example.com\",\n  \"customerId\": \"string\",\n  \"storeHash\": \"abc123\",\n  \"companyEmail\": null,\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"state\": \"Texas\",\n  \"country\": \"United States\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "companyName": "Great Buys",
  "companyPhoneNumber": "1234567890",
  "companyFirstName": "Robert",
  "companyLastName": "Robertson",
  "customerEmail": "admin@example.com",
  "customerId": "string",
  "storeHash": "abc123",
  "companyEmail": ,
  "addressLine1": "512 Bluebonnet Lane",
  "addressLine2": "Building 2",
  "city": "Austin",
  "zipCode": "78726",
  "state": "Texas",
  "country": "United States"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v2/frontend/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()
```