> 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 A Company Address

POST https://api-b2b.bigcommerce.com/api/v2/io/companies/{companyId}/addresses
Content-Type: application/json

Creates a new address for a company. You will specify the address fields and the type of address. The address can be billing, shipping, or both. You can also request that this address becomes the new default billing or shipping address for the company.

Reference: https://docs.bigcommerce.com/developer/docs/archive/b2b-edition/v2-api/address/companies-addresses-create

## Authentication

- `authToken` header (required) — API Key authentication via header

## Request

### Path parameters

- `companyId` (string, required)

### Headers

- `authToken` (string, required) — Auth token in header.

### Body (application/json)

This endpoint expects an object.

- `addressLine1` (string, required) — Typically the street address
- `city` (string, required)
- `country` (CompaniesCompanyIdAddressesPostRequestBodyContentApplicationJsonSchemaCountry, required)
- `firstName` (string, required) — Address first name
- `lastName` (string, required) — Address last name
- `state` (CompaniesCompanyIdAddressesPostRequestBodyContentApplicationJsonSchemaState, required)
- `zipCode` (string, required)
- `addressLine2` (string, optional) — More detailed information about where to deliver mail, such as a suite or office number
- `isBilling` (boolean, optional) — Indicates whether the address is a billing address
- `isDefaultBilling` (boolean, optional) — Indicates whether the address is the default billing address
- `isDefaultShipping` (boolean, optional) — Indicates whether the address is the default shipping address
- `isShipping` (boolean, optional) — Indicates whether the address is a shipping address
- `label` (string, optional) — Address label
- `phoneNumber` (string, optional) — Address phone number
- `externalId` (string, optional)

## Response

### 200

Response Success

- `code` (double, optional) — Response status code
- `data` (CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaData, optional) — Response data
- `meta` (CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaMeta, optional)

## Errors

### 422 Unprocessable Entity Error

Response Bad Request

- `code` (double, optional) — Response status error code
- `data` (CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaData, optional) — Response error data
- `meta` (CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### CompaniesCompanyIdAddressesPostRequestBodyContentApplicationJsonSchemaCountry

- `countryCode` (string, optional) — ISO 3166-1 Alpha 2 Country Code
- `countryName` (string, optional) — Human readable country name

### CompaniesCompanyIdAddressesPostRequestBodyContentApplicationJsonSchemaState

- `stateCode` (string, optional) — ISO 3166-2 Alpha 2 Country Subdivision Code
- `stateName` (string, optional) — Human readable state (or other subdivision) name

### CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaData

Response error data

- `errMsg` (list of CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaDataErrMsgItems, optional) — Message about problem with field 'field'

### CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaMeta

- `message` (string, optional) — Response error message

### CompaniesCompanyIdAddressesPostResponsesContentApplicationJsonSchemaDataErrMsgItems

- `[field]` (string, optional) — field error description.

## Examples

**Request**

```json
{
  "addressLine1": "string",
  "city": "string",
  "firstName": "string",
  "lastName": "string",
  "zipCode": "string"
}
```

**Response**

```json
{
  "code": 200,
  "data": {
    "addressId": 12
  },
  "meta": {
    "message": "Success"
  }
}
```

**SDK Code**

```shell Shell

curl --location --request POST 'https://api-b2b.bigcommerce.com/api/v2/io/companies/23/addresses'                         --header 'Content-Type: application/json'                         --data-raw '{
    "label": "12dxqwdsa",
    "firstName": "Bundle",
    "lastName": "Smith",
    "addressLine1": "123 Main Street",
    "addressLine2": "Suite 200",
    "city": "New York",
    "zipCode": "10001",
    "phoneNumber": "555-123-4567",
    "country": {
        "countryName": "United States",
        "countryCode": "US"
    },
    "state": {
        "stateName": "New York",
        "stateCode": "NY"
    },
    "isShipping": "1",
    "isBilling": "1",
    "isDefaultShipping": true,
    "isDefaultBilling": true
}'

```

```python Python

                        import requests

                        url = "https://api-b2b.bigcommerce.com/api/v2/io/companies/23/addresses"

                        payload = "{
    "label": "12dxqwdsa",
    "firstName": "Bundle",
    "lastName": "Smith",
    "addressLine1": "123 Main Street",
    "addressLine2": "Suite 200",
    "city": "New York",
    "zipCode": "10001",
    "phoneNumber": "555-123-4567",
    "country": {
        "countryName": "United States",
        "countryCode": "US"
    },
    "state": {
        "stateName": "New York",
        "stateCode": "NY"
    },
    "isShipping": "1",
    "isBilling": "1",
    "isDefaultShipping": true,
    "isDefaultBilling": true
}"
                        headers = {
                          'Content-Type': 'application/json'
                        }

                        response = requests.request("POST", url, headers=headers, data = payload)

                        print(response.text.encode('utf8'))

```

```javascript JavaScript

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"label":"Home Address","firstName":"Jane","lastName":"Smith","addressLine1":"123 Main Street","addressLine2":"","city":"New York","zipCode":"10001","phoneNumber":"5551234567","country":{"countryName":"United States","countryCode":"US"},"state":{"stateName":"New York","stateCode":"NY"},"isShipping":"1","isBilling":"1","isDefaultShipping":"1","isDefaultBilling":"0"});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api-b2b.bigcommerce.com/api/v2/io/companies/23/addresses", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

```

```go
package main

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

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v2/io/companies/companyId/addresses"

	payload := strings.NewReader("{\n  \"addressLine1\": \"string\",\n  \"city\": \"string\",\n  \"firstName\": \"string\",\n  \"lastName\": \"string\",\n  \"zipCode\": \"string\"\n}")

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

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

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

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

request = Net::HTTP::Post.new(url)
request["authToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"addressLine1\": \"string\",\n  \"city\": \"string\",\n  \"firstName\": \"string\",\n  \"lastName\": \"string\",\n  \"zipCode\": \"string\"\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/io/companies/companyId/addresses")
  .header("authToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"addressLine1\": \"string\",\n  \"city\": \"string\",\n  \"firstName\": \"string\",\n  \"lastName\": \"string\",\n  \"zipCode\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v2/io/companies/companyId/addresses', [
  'body' => '{
  "addressLine1": "string",
  "city": "string",
  "firstName": "string",
  "lastName": "string",
  "zipCode": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authToken' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/io/companies/companyId/addresses");
var request = new RestRequest(Method.POST);
request.AddHeader("authToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"addressLine1\": \"string\",\n  \"city\": \"string\",\n  \"firstName\": \"string\",\n  \"lastName\": \"string\",\n  \"zipCode\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "authToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "addressLine1": "string",
  "city": "string",
  "firstName": "string",
  "lastName": "string",
  "zipCode": "string"
] as [String : Any]

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

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