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

# Update A Company Address

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

Updates an address for a company. You can change whether the address is for billing, shipping, or both. You can also update the address to be the default billing or shipping address for the company.

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

## Authentication

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

## Request

### Path parameters

- `addressId` (string, required)
- `companyId` (string, required)

### Headers

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

### Body (application/json)

This endpoint expects an object.

- `addressLine1` (string, optional) — Typically the street address
- `addressLine2` (string, optional) — More detailed information about where to deliver mail, such as a suite or office number
- `city` (string, optional)
- `country` (CompaniesCompanyIdAddressesAddressIdPutRequestBodyContentApplicationJsonSchemaCountry, optional)
- `firstName` (string, optional) — Address first name
- `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
- `lastName` (string, optional) — Address last name
- `phoneNumber` (string, optional) — Address phone number
- `state` (CompaniesCompanyIdAddressesAddressIdPutRequestBodyContentApplicationJsonSchemaState, optional)
- `zipCode` (string, optional)
- `externalId` (string, optional)

## Response

### 200

Response Success

- `code` (double, optional) — Response status code
- `data` (CompaniesCompanyIdAddressesAddressIdPutResponsesContentApplicationJsonSchemaData, optional) — Response data
- `message` (string, optional) — Response message

## Errors

### 400 Bad Request Error

Response Bad Request

- `code` (double, optional) — Response status error code
- `data` (CompaniesCompanyIdAddressesAddressIdPutResponsesContentApplicationJsonSchemaData, optional) — Response error data
- `message` (string, optional) — Response error message

### 404 Not Found Error

Not Found Error

- `code` (double, optional) — Response status code
- `data` (CompaniesCompanyIdAddressesAddressIdPutResponsesContentApplicationJsonSchemaData, optional) — Response data
- `message` (string, optional) — Response message

## Types

### CompaniesCompanyIdAddressesAddressIdPutRequestBodyContentApplicationJsonSchemaCountry

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

### CompaniesCompanyIdAddressesAddressIdPutRequestBodyContentApplicationJsonSchemaState

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

### CompaniesCompanyIdAddressesAddressIdPutResponsesContentApplicationJsonSchemaData

Response data

- `errMsg` (string, optional) — Error message info

## Examples

**Request**

```json
{}
```

**Response**

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

**SDK Code**

```shell Shell

curl --location --request PUT 'https://api-b2b.bigcommerce.com/api/v2/io/companies/23/addresses/4'                         --header 'authToken: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiZjJvc3hqam54aiIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoiYnJ1Y2UuaHVhbmdAc2lsa3NvZnR3YXJlLmNvbSJ9._DQFg-3FgtztdQVCGU5Gxfv8j8V3U9Ssaw7ARxUU6pY'                         --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": "1",
    "isDefaultBilling": "0"
}'

```

```python Python

import requests

url = "https://api-b2b.bigcommerce.com/api/v2/io/companies/23/addresses/4"
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": "1",
    "isDefaultBilling": "0"
}
headers = {
  'authToken': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiZjJvc3hqam54aiIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoiYnJ1Y2UuaHVhbmdAc2lsa3NvZnR3YXJlLmNvbSJ9._DQFg-3FgtztdQVCGU5Gxfv8j8V3U9Ssaw7ARxUU6pY',
  'Content-Type': 'application/json'
}

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

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

```

```javascript JavaScript

var myHeaders = new Headers();
myHeaders.append("authToken", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiZjJvc3hqam54aiIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoiYnJ1Y2UuaHVhbmdAc2lsa3NvZnR3YXJlLmNvbSJ9._DQFg-3FgtztdQVCGU5Gxfv8j8V3U9Ssaw7ARxUU6pY");
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: 'PUT',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

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

```

```go Address_companies_addresses_update_example
package main

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

func main() {

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

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PUT", 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 Address_companies_addresses_update_example
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Put.new(url)
request["authToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

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

HttpResponse<String> response = Unirest.put("https://api-b2b.bigcommerce.com/api/v2/io/companies/companyId/addresses/addressId")
  .header("authToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v2/io/companies/companyId/addresses/addressId', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authToken' => '<apiKey>',
  ],
]);

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

```csharp Address_companies_addresses_update_example
using RestSharp;

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

```swift Address_companies_addresses_update_example
import Foundation

let headers = [
  "authToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] 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/addressId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```