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

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

Updates the details of a billing or shipping address, if address book management is enabled for your storefront.

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

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

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

### Path parameters

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

### Body (application/json)

This endpoint expects an object.

- `firstName` (string, required) — The first name of the address.
- `isShipping` (string, required) — Indicates whether the address can be used as a shipping address.
- `isBilling` (string, required) — Indicates whether the address can be used as a billing address.
- `phoneNumber` (string, required) — The phone number associated with the address.
- `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.
- `country` (countryObject, required) — Country of the address as an object with both the name and the two-character code.
- `addressId` (string, required) — The unique ID of the address.
- `lastName` (string, required) — The last name of the address.
- `isDefaultShipping` (string, required) — Indicates whether the address is the default shipping address for the Company account.
- `isDefaultBilling` (string, required) — Indicates whether the address is the default billing address for the Company account.
- `label` (string, required) — The label used on the storefront to identify the address.
- `state` (stateObject, optional) — State of the address, as an object with the state name and its two-character code. Required when the address `country` is one of the countries listed in [Get State](/developer/api-reference/rest/b2b/management/addresses/get-addresses-states-state-name-code). Optional otherwise. An empty string for `stateName` or `stateCode` is treated as missing, not as "not provided", so it is rejected the same as omitting the field for a country that requires a state.
- `extraFields` (list of CompaniesCompanyIdAddressesAddressIdPutRequestBodyContentApplicationJsonSchemaExtraFieldsItems, optional)

## Response

### 200

OK

- `message` (string, optional)
- `code` (double, optional, default: 200)
- `data` (CompaniesCompanyIdAddressesAddressIdPutResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 400 Bad Request Error

Bad Request This error occurs when the request body fails validation. For example, it occurs when the address `country` is one of the countries listed in [Get State](/developer/api-reference/rest/b2b/management/addresses/get-addresses-states-state-name-code) but `stateName` or `stateCode` is missing, empty, or invalid.

- `code` (integer, required) — The application-level error code for the response.
- `message` (string, required) — A message describing the error.
- `data` (CompaniesCompanyIdAddressesAddressIdPutResponsesContentApplicationJsonSchemaData, required)

## Types

### countryObject

Country of the address as an object with both the name and the two-character code.

- `countryName` (string, optional)
- `countryCode` (string, optional)

### stateObject

State of the address as an object with both the name and the two-character code.

- `stateName` (string, optional)
- `stateCode` (string, optional)

### CompaniesCompanyIdAddressesAddressIdPutRequestBodyContentApplicationJsonSchemaExtraFieldsItems

- `fieldName` (string, required) — Field name that config in you store
- `fieldValue` (string, required) — Value of the extra field.

### CompaniesCompanyIdAddressesAddressIdPutResponsesContentApplicationJsonSchemaData

- `errMsg` (string, optional) — Details of the validation failure.

## Examples

**Request**

```json
{
  "firstName": "Marie",
  "isShipping": "1",
  "isBilling": "0",
  "phoneNumber": "8001234567",
  "addressLine1": "512 Bluebonnet Lane",
  "addressLine2": "Building 2",
  "city": "Austin",
  "zipCode": "78726",
  "country": {
    "countryName": "United States",
    "countryCode": "US"
  },
  "addressId": "27",
  "lastName": "Curie",
  "isDefaultShipping": "0",
  "isDefaultBilling": "0",
  "label": "Austin Warehouse",
  "state": {
    "stateName": "Texas",
    "stateCode": "TX"
  },
  "extraFields": [
    {
      "fieldName": "Company Tax Code",
      "fieldValue": "Code G"
    }
  ]
}
```

**Response**

```json
{
  "message": "string",
  "code": 200,
  "data": {
    "addressId": "27"
  }
}
```

**SDK Code**

```python Create an Address
import requests

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

payload = {
    "firstName": "Marie",
    "isShipping": "1",
    "isBilling": "0",
    "phoneNumber": "8001234567",
    "addressLine1": "512 Bluebonnet Lane",
    "addressLine2": "Building 2",
    "city": "Austin",
    "zipCode": "78726",
    "country": {
        "countryName": "United States",
        "countryCode": "US"
    },
    "addressId": "27",
    "lastName": "Curie",
    "isDefaultShipping": "0",
    "isDefaultBilling": "0",
    "label": "Austin Warehouse",
    "state": {
        "stateName": "Texas",
        "stateCode": "TX"
    },
    "extraFields": [
        {
            "fieldName": "Company Tax Code",
            "fieldValue": "Code G"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create an Address
const url = 'https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/123';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"firstName":"Marie","isShipping":"1","isBilling":"0","phoneNumber":"8001234567","addressLine1":"512 Bluebonnet Lane","addressLine2":"Building 2","city":"Austin","zipCode":"78726","country":{"countryName":"United States","countryCode":"US"},"addressId":"27","lastName":"Curie","isDefaultShipping":"0","isDefaultBilling":"0","label":"Austin Warehouse","state":{"stateName":"Texas","stateCode":"TX"},"extraFields":[{"fieldName":"Company Tax Code","fieldValue":"Code G"}]}'
};

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

```go Create an Address
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"firstName\": \"Marie\",\n  \"isShipping\": \"1\",\n  \"isBilling\": \"0\",\n  \"phoneNumber\": \"8001234567\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"country\": {\n    \"countryName\": \"United States\",\n    \"countryCode\": \"US\"\n  },\n  \"addressId\": \"27\",\n  \"lastName\": \"Curie\",\n  \"isDefaultShipping\": \"0\",\n  \"isDefaultBilling\": \"0\",\n  \"label\": \"Austin Warehouse\",\n  \"state\": {\n    \"stateName\": \"Texas\",\n    \"stateCode\": \"TX\"\n  },\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Company Tax Code\",\n      \"fieldValue\": \"Code G\"\n    }\n  ]\n}")

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

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

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"firstName\": \"Marie\",\n  \"isShipping\": \"1\",\n  \"isBilling\": \"0\",\n  \"phoneNumber\": \"8001234567\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"country\": {\n    \"countryName\": \"United States\",\n    \"countryCode\": \"US\"\n  },\n  \"addressId\": \"27\",\n  \"lastName\": \"Curie\",\n  \"isDefaultShipping\": \"0\",\n  \"isDefaultBilling\": \"0\",\n  \"label\": \"Austin Warehouse\",\n  \"state\": {\n    \"stateName\": \"Texas\",\n    \"stateCode\": \"TX\"\n  },\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Company Tax Code\",\n      \"fieldValue\": \"Code G\"\n    }\n  ]\n}"

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

```java Create an Address
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/123")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"firstName\": \"Marie\",\n  \"isShipping\": \"1\",\n  \"isBilling\": \"0\",\n  \"phoneNumber\": \"8001234567\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"country\": {\n    \"countryName\": \"United States\",\n    \"countryCode\": \"US\"\n  },\n  \"addressId\": \"27\",\n  \"lastName\": \"Curie\",\n  \"isDefaultShipping\": \"0\",\n  \"isDefaultBilling\": \"0\",\n  \"label\": \"Austin Warehouse\",\n  \"state\": {\n    \"stateName\": \"Texas\",\n    \"stateCode\": \"TX\"\n  },\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Company Tax Code\",\n      \"fieldValue\": \"Code G\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/123', [
  'body' => '{
  "firstName": "Marie",
  "isShipping": "1",
  "isBilling": "0",
  "phoneNumber": "8001234567",
  "addressLine1": "512 Bluebonnet Lane",
  "addressLine2": "Building 2",
  "city": "Austin",
  "zipCode": "78726",
  "country": {
    "countryName": "United States",
    "countryCode": "US"
  },
  "addressId": "27",
  "lastName": "Curie",
  "isDefaultShipping": "0",
  "isDefaultBilling": "0",
  "label": "Austin Warehouse",
  "state": {
    "stateName": "Texas",
    "stateCode": "TX"
  },
  "extraFields": [
    {
      "fieldName": "Company Tax Code",
      "fieldValue": "Code G"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create an Address
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/123");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"firstName\": \"Marie\",\n  \"isShipping\": \"1\",\n  \"isBilling\": \"0\",\n  \"phoneNumber\": \"8001234567\",\n  \"addressLine1\": \"512 Bluebonnet Lane\",\n  \"addressLine2\": \"Building 2\",\n  \"city\": \"Austin\",\n  \"zipCode\": \"78726\",\n  \"country\": {\n    \"countryName\": \"United States\",\n    \"countryCode\": \"US\"\n  },\n  \"addressId\": \"27\",\n  \"lastName\": \"Curie\",\n  \"isDefaultShipping\": \"0\",\n  \"isDefaultBilling\": \"0\",\n  \"label\": \"Austin Warehouse\",\n  \"state\": {\n    \"stateName\": \"Texas\",\n    \"stateCode\": \"TX\"\n  },\n  \"extraFields\": [\n    {\n      \"fieldName\": \"Company Tax Code\",\n      \"fieldValue\": \"Code G\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create an Address
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "firstName": "Marie",
  "isShipping": "1",
  "isBilling": "0",
  "phoneNumber": "8001234567",
  "addressLine1": "512 Bluebonnet Lane",
  "addressLine2": "Building 2",
  "city": "Austin",
  "zipCode": "78726",
  "country": [
    "countryName": "United States",
    "countryCode": "US"
  ],
  "addressId": "27",
  "lastName": "Curie",
  "isDefaultShipping": "0",
  "isDefaultBilling": "0",
  "label": "Austin Warehouse",
  "state": [
    "stateName": "Texas",
    "stateCode": "TX"
  ],
  "extraFields": [
    [
      "fieldName": "Company Tax Code",
      "fieldValue": "Code G"
    ]
  ]
] as [String : Any]

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

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