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

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

Edits details of an existing Company address.

There are no required fields for this endpoint, but you must include `isBilling` or `isShipping` to change the value of `isDefaultBilling` or `isDefaultShipping` respectively.

When changing the `countryName`, you must also update the `countryCode`. Updating the `countryCode` by itself will automatically adjust the `countryName`. If you are changing the `countryCode` to a [country that supports states](#get-a-state), you must also include the `stateCode` with a valid two-letter code value for the state.

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

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

### Path parameters

- `addressId` (string, required) — The unique numeric identifier of the Company address.

### Body (application/json)

This endpoint expects an address_REQUEST.

- `firstName` (string, optional) — The first name on the address.
- `lastName` (string, optional) — The last name on the address.
- `phoneNumber` (string, optional) — The phone number on the address.
- `zipCode` (string, optional) — The postal code on the address.
- `addressLine1` (string, optional) — The first line of the address.
- `addressLine2` (string, optional) — The second line of the address.
- `city` (string, optional) — The city on the address.
- `stateName` (string, optional) — 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, optional) — The full name of the country on the address. Use [Get a Country](#get-a-country) to retrieve valid country names.
- `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.
- `companyId` (integer, optional) — The unique numeric ID of the Company account.
- `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 AddressRequestExtraFieldsItems, optional) — Enter extra field information for the address.

## Response

### 200

OK

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

## Errors

### 404 Not Found Error

Not Found This error occurs if you supply an invalid addressId in the request path.

- `code` (double, required, default: 404)
- `data` (ResponseNotFoundData, required)
- `meta` (ResponseNotFoundMeta, required)

### 422 Unprocessable Entity Error

Unprocessable Content This error occurs if you enter invalid information in the request body. It can also occur if you supply the `isDefaultBilling` or `isDefaultShipping` fields without also including `isBilling` and `isShipping` respectively.

- `code` (double, required)
- `data` (AddressesAddressIdPutResponsesContentApplicationJsonSchemaData, required)
- `meta` (AddressesAddressIdPutResponsesContentApplicationJsonSchemaMeta, required)

## Types

### AddressRequestExtraFieldsItems

- `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)

### ResponseNotFoundData

- `errMsg` (string, required, default: Address matching query does not exist.)

### ResponseNotFoundMeta

- `message` (string, required, default: Not Found Error)

### AddressesAddressIdPutResponsesContentApplicationJsonSchemaData

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

### AddressesAddressIdPutResponsesContentApplicationJsonSchemaMeta

- `message` (string, required, default: Processing data contains logical errors)

## Examples

**Request**

```json
{}
```

**Response**

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

**SDK Code**

```python
import requests

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

payload = {}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/addresses/123';
const options = {
  method: 'PUT',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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/v3/io/addresses/123"

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

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

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

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

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

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.put("https://api-b2b.bigcommerce.com/api/v3/io/addresses/123")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v3/io/addresses/123', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

let headers = [
  "X-Auth-Token": "<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/v3/io/addresses/123")! 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()
```