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

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

Creates an address for a Company account. Use [Bulk Create Addresses](#bulk-create-addresses) to create multiple addresses in a single request.

## Considerations

In addition to the minimum-required fields presented in the request body example, you may need to supply a `stateName` or a `stateCode` if the address is in a [designated country](/developer/api-reference/rest/b2b/management/addresses/get-addresses-states-state-name-code).

If you have set one or more address extra fields as mandatory, you must include the `extraFields` object in the request body. If an extra field is configured to accept only unique values, each `fieldValue` must be distinct for a successful request.

You can create Company addresses without assigning them as billing or shipping addresses. However, Company users cannot use addresses at checkout without a billing or shipping designation.

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

## 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 an object.

- `firstName` (string, required) — The first name on the address.
- `lastName` (string, required) — The last name on the address.
- `addressLine1` (string, required) — The first line of the address.
- `city` (string, required) — The city on the address.
- `stateName` (string, required) — The full name of the state or province on the address. This must correspond to `stateCode` in the request if the state or province is [required for the country](#get-a-state).
- `countryName` (string, required) — The full name of the country on the address. Use [Get a Country](#get-a-country) to retrieve valid country names.
- `companyId` (integer, required) — The unique numeric ID of the Company account.
- `phoneNumber` (string, optional) — The phone number on the address.
- `zipCode` (string, optional) — The postal code on the address.
- `addressLine2` (string, optional) — The second line of the address.
- `stateCode` (string, optional) — The two-letter ISO code for the state or province on the address. Omit this field when adding state or province information for an [unsupported country](#get-a-state).
- `countryCode` (string, optional) — The two-letter ISO code for the country on the address. Use [Get a Country](#get-a-country) to retrieve valid country codes.
- `isBilling` (boolean, optional) — Indicates whether the address is a billing address.
- `isShipping` (boolean, optional) — Indicates whether the address is a shipping 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.
- `label` (string, optional) — The label used on the storefront to identify the address.
- `externalId` (string, optional) — An external ID assigned to the address in a third-party system, such as an ERP.
- `extraFields` (list of AddressesPostRequestBodyContentApplicationJsonSchemaExtraFieldsItems, optional) — Enter extra field information for the address.

## Response

### 200

OK

- `code` (integer, required, default: 200)
- `data` (ResponsePostputData, required)
- `meta` (ResponsePostputMeta, required)

## Errors

### 422 Unprocessable Entity Error

Unprocessable Content This error occurs if you exclude a required field from the request body. See the error message in the response to identify the required field.

- `code` (double, required)
- `data` (AddressesPostResponsesContentApplicationJsonSchemaData, required)
- `meta` (AddressesPostResponsesContentApplicationJsonSchemaMeta, required)

## Types

### AddressesPostRequestBodyContentApplicationJsonSchemaExtraFieldsItems

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

### ResponsePostputData

- `addressId` (integer, required) — The unique numeric ID of the Company account.

### ResponsePostputMeta

- `message` (string, required, default: SUCCESS)

### AddressesPostResponsesContentApplicationJsonSchemaData

- `errMsg` (AddressesPostResponsesContentApplicationJsonSchemaDataErrMsg, optional) — Lists the required fields that were missing from the request.

### AddressesPostResponsesContentApplicationJsonSchemaMeta

- `message` (string, required)

### AddressesPostResponsesContentApplicationJsonSchemaDataErrMsg

Lists the required fields that were missing from the request.

## Examples

### Minimum-required fields

**Request**

```json
{
  "firstName": "Marie",
  "lastName": "Curie",
  "addressLine1": "512 Bluebonnet Lane",
  "city": "Austin",
  "stateName": "Texas",
  "countryName": "United States",
  "companyId": 364336
}
```

**Response**

```json
{
  "code": 200,
  "data": {
    "addressId": 123456
  },
  "meta": {
    "message": "SUCCESS"
  }
}
```

**SDK Code**

```python Minimum-required fields
import requests

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

payload = {
    "firstName": "Marie",
    "lastName": "Curie",
    "addressLine1": "512 Bluebonnet Lane",
    "city": "Austin",
    "stateName": "Texas",
    "countryName": "United States",
    "companyId": 364336
}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Minimum-required fields
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/addresses';
const options = {
  method: 'POST',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"firstName":"Marie","lastName":"Curie","addressLine1":"512 Bluebonnet Lane","city":"Austin","stateName":"Texas","countryName":"United States","companyId":364336}'
};

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

```go Minimum-required fields
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336\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 Minimum-required fields
require 'uri'
require 'net/http'

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

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  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336\n}"

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

```java Minimum-required fields
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/addresses")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336\n}")
  .asString();
```

```php Minimum-required fields
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v3/io/addresses', [
  'body' => '{
  "firstName": "Marie",
  "lastName": "Curie",
  "addressLine1": "512 Bluebonnet Lane",
  "city": "Austin",
  "stateName": "Texas",
  "countryName": "United States",
  "companyId": 364336
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp Minimum-required fields
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v3/io/addresses");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Minimum-required fields
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "firstName": "Marie",
  "lastName": "Curie",
  "addressLine1": "512 Bluebonnet Lane",
  "city": "Austin",
  "stateName": "Texas",
  "countryName": "United States",
  "companyId": 364336
] as [String : Any]

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

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

### All fields

**Request**

```json
{
  "firstName": "Marie",
  "lastName": "Curie",
  "addressLine1": "512 Bluebonnet Lane",
  "city": "Austin",
  "stateName": "Texas",
  "countryName": "United States",
  "companyId": 364336,
  "phoneNumber": "512-200-1234",
  "zipCode": "78704",
  "stateCode": "TX",
  "countryCode": "US",
  "isBilling": false,
  "isShipping": true,
  "isDefaultBilling": false,
  "isDefaultShipping": false,
  "label": "Austin Warehouse",
  "externalId": "123456",
  "extraFields": [
    {
      "fieldName": "Tax Provider Tax Code",
      "fieldValue": "G"
    }
  ],
  "addressline2": "Building 1"
}
```

**Response**

```json
{
  "code": 200,
  "data": {
    "addressId": 123456
  },
  "meta": {
    "message": "SUCCESS"
  }
}
```

**SDK Code**

```python All fields
import requests

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

payload = {
    "firstName": "Marie",
    "lastName": "Curie",
    "addressLine1": "512 Bluebonnet Lane",
    "city": "Austin",
    "stateName": "Texas",
    "countryName": "United States",
    "companyId": 364336,
    "phoneNumber": "512-200-1234",
    "zipCode": "78704",
    "stateCode": "TX",
    "countryCode": "US",
    "isBilling": False,
    "isShipping": True,
    "isDefaultBilling": False,
    "isDefaultShipping": False,
    "label": "Austin Warehouse",
    "externalId": "123456",
    "extraFields": [
        {
            "fieldName": "Tax Provider Tax Code",
            "fieldValue": "G"
        }
    ],
    "addressline2": "Building 1"
}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript All fields
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/addresses';
const options = {
  method: 'POST',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"firstName":"Marie","lastName":"Curie","addressLine1":"512 Bluebonnet Lane","city":"Austin","stateName":"Texas","countryName":"United States","companyId":364336,"phoneNumber":"512-200-1234","zipCode":"78704","stateCode":"TX","countryCode":"US","isBilling":false,"isShipping":true,"isDefaultBilling":false,"isDefaultShipping":false,"label":"Austin Warehouse","externalId":"123456","extraFields":[{"fieldName":"Tax Provider Tax Code","fieldValue":"G"}],"addressline2":"Building 1"}'
};

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

```go All fields
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336,\n  \"phoneNumber\": \"512-200-1234\",\n  \"zipCode\": \"78704\",\n  \"stateCode\": \"TX\",\n  \"countryCode\": \"US\",\n  \"isBilling\": false,\n  \"isShipping\": true,\n  \"isDefaultBilling\": false,\n  \"isDefaultShipping\": false,\n  \"label\": \"Austin Warehouse\",\n  \"externalId\": \"123456\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Tax Provider Tax Code\",\n      \"fieldValue\": \"G\"\n    }\n  ],\n  \"addressline2\": \"Building 1\"\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 All fields
require 'uri'
require 'net/http'

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

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  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336,\n  \"phoneNumber\": \"512-200-1234\",\n  \"zipCode\": \"78704\",\n  \"stateCode\": \"TX\",\n  \"countryCode\": \"US\",\n  \"isBilling\": false,\n  \"isShipping\": true,\n  \"isDefaultBilling\": false,\n  \"isDefaultShipping\": false,\n  \"label\": \"Austin Warehouse\",\n  \"externalId\": \"123456\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Tax Provider Tax Code\",\n      \"fieldValue\": \"G\"\n    }\n  ],\n  \"addressline2\": \"Building 1\"\n}"

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

```java All fields
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/addresses")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336,\n  \"phoneNumber\": \"512-200-1234\",\n  \"zipCode\": \"78704\",\n  \"stateCode\": \"TX\",\n  \"countryCode\": \"US\",\n  \"isBilling\": false,\n  \"isShipping\": true,\n  \"isDefaultBilling\": false,\n  \"isDefaultShipping\": false,\n  \"label\": \"Austin Warehouse\",\n  \"externalId\": \"123456\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Tax Provider Tax Code\",\n      \"fieldValue\": \"G\"\n    }\n  ],\n  \"addressline2\": \"Building 1\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v3/io/addresses', [
  'body' => '{
  "firstName": "Marie",
  "lastName": "Curie",
  "addressLine1": "512 Bluebonnet Lane",
  "city": "Austin",
  "stateName": "Texas",
  "countryName": "United States",
  "companyId": 364336,
  "phoneNumber": "512-200-1234",
  "zipCode": "78704",
  "stateCode": "TX",
  "countryCode": "US",
  "isBilling": false,
  "isShipping": true,
  "isDefaultBilling": false,
  "isDefaultShipping": false,
  "label": "Austin Warehouse",
  "externalId": "123456",
  "extraFields": [
    {
      "fieldName": "Tax Provider Tax Code",
      "fieldValue": "G"
    }
  ],
  "addressline2": "Building 1"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp All fields
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v3/io/addresses");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"firstName\": \"Marie\",\n  \"lastName\": \"Curie\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"city\": \"Austin\",\n  \"stateName\": \"Texas\",\n  \"countryName\": \"United States\",\n  \"companyId\": 364336,\n  \"phoneNumber\": \"512-200-1234\",\n  \"zipCode\": \"78704\",\n  \"stateCode\": \"TX\",\n  \"countryCode\": \"US\",\n  \"isBilling\": false,\n  \"isShipping\": true,\n  \"isDefaultBilling\": false,\n  \"isDefaultShipping\": false,\n  \"label\": \"Austin Warehouse\",\n  \"externalId\": \"123456\",\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Tax Provider Tax Code\",\n      \"fieldValue\": \"G\"\n    }\n  ],\n  \"addressline2\": \"Building 1\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift All fields
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "firstName": "Marie",
  "lastName": "Curie",
  "addressLine1": "512 Bluebonnet Lane",
  "city": "Austin",
  "stateName": "Texas",
  "countryName": "United States",
  "companyId": 364336,
  "phoneNumber": "512-200-1234",
  "zipCode": "78704",
  "stateCode": "TX",
  "countryCode": "US",
  "isBilling": false,
  "isShipping": true,
  "isDefaultBilling": false,
  "isDefaultShipping": false,
  "label": "Austin Warehouse",
  "externalId": "123456",
  "extraFields": [
    [
      "fieldName": "Tax Provider Tax Code",
      "fieldValue": "G"
    ]
  ],
  "addressline2": "Building 1"
] as [String : Any]

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

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