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

# Search Addresses with Multiple Filters

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

Returns one or more Company addresses based on the filter parameters. You can use this to make refined searches, such as locating a particular address by its label or viewing all addresses in a specific country.

Equivalent Storefront GraphQL API Query: `addresses`. 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/post-companies-company-id-addresses-searches

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

### Body (application/json)

This endpoint expects an object.

- `filters` (CompaniesCompanyIdAddressesSearchesPostRequestBodyContentApplicationJsonSchemaFilters, optional)
- `offset` (double, optional) — Pagination offset for the results.
- `limit` (double, optional) — Pagination limit for the results.
- `q` (string, optional) — The search string for the request. Its value determines the results returned by the request.

## Response

### 200

OK

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

## Types

### CompaniesCompanyIdAddressesSearchesPostRequestBodyContentApplicationJsonSchemaFilters

- `firstName` (string, optional) — The first name of the address.
- `lastName` (string, optional) — The last name of the address.
- `city` (string, optional) — City of the address.
- `phoneNumber` (string, optional) — The phone number associated with the address.
- `zipCode` (string, optional) — Zip or Postal Code of the address.
- `label` (string, optional) — The label used on the storefront to identify the address.
- `address` (string, optional)
- `state` (string, optional) — State of the address.
- `country` (string, optional) — Country of the address.
- `addressType` (CompaniesCompanyIdAddressesSearchesPostRequestBodyContentApplicationJsonSchemaFiltersAddressType, optional)

### CompaniesCompanyIdAddressesSearchesPostResponsesContentApplicationJsonSchemaData

- `list` (list of CompaniesCompanyIdAddressesSearchesPostResponsesContentApplicationJsonSchemaDataListItems, optional)
- `defaultAddressIds` (CompaniesCompanyIdAddressesSearchesPostResponsesContentApplicationJsonSchemaDataDefaultAddressIds, optional)
- `pagination` (responsePagination, optional)

### CompaniesCompanyIdAddressesSearchesPostRequestBodyContentApplicationJsonSchemaFiltersAddressType

- `isBilling` (string, optional) — Indicates whether the address can be used as a billing address.
- `isShipping` (string, optional) — Indicates whether the address can be used as a shipping address.

### CompaniesCompanyIdAddressesSearchesPostResponsesContentApplicationJsonSchemaDataListItems

Extra Field Values

- `addressId` (string, optional) — The unique ID of the address.
- `isDefaultShipping` (string, optional) — Indicates whether the address is the default shipping address for the Company account.
- `isDefaultBilling` (string, optional) — Indicates whether the address is the default billing address for the Company account.
- `firstName` (string, optional) — The first name of the address.
- `lastName` (string, optional) — The last name of the address.
- `city` (string, optional) — City of the address.
- `phoneNumber` (string, optional) — The phone number associated with the address.
- `zipCode` (string, optional) — Zip or Postal Code of the address.
- `label` (string, optional) — The label used on the storefront to identify the address.
- `isShipping` (string, optional) — Indicates whether the address can be used as a shipping address.
- `isBilling` (string, optional) — Indicates whether the address can be used as a billing address.
- `addressLine1` (string, optional) — The first line of the address
- `addressLine2` (string, optional) — The second line of the address
- `state` (stateObject, optional) — State of the address as an object with both the name and the two-character code.
- `country` (countryObject, optional) — Country of the address as an object with both the name and the two-character code.
- `extraFields` (list of CompaniesCompanyIdAddressesSearchesPostResponsesContentApplicationJsonSchemaDataListItemsExtraFieldsItems, optional)

### CompaniesCompanyIdAddressesSearchesPostResponsesContentApplicationJsonSchemaDataDefaultAddressIds

- `shippingAddressId` (string, optional)
- `billingAddressId` (string, optional)

### responsePagination

- `totalCount` (double, optional) — The total number of items matching the query.
- `offset` (double, optional) — The starting offset for the current page of the response.
- `limit` (double, optional) — The maximum number of items allowed per page of the response.

### stateObject

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

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

### countryObject

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

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

### CompaniesCompanyIdAddressesSearchesPostResponsesContentApplicationJsonSchemaDataListItemsExtraFieldsItems

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

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "message": "Success",
  "code": 200,
  "data": {
    "list": [
      {
        "addressId": "27",
        "isDefaultShipping": "0",
        "isDefaultBilling": "0",
        "firstName": "Marie",
        "lastName": "Curie",
        "city": "Austin",
        "phoneNumber": "8001234567",
        "zipCode": "78726",
        "label": "Austin Warehouse",
        "isShipping": "1",
        "isBilling": "0",
        "addressLine1": "512 Bluebonnet Lane",
        "addressLine2": "Building 2",
        "state": {
          "stateName": "Texas",
          "stateCode": "TX"
        },
        "country": {
          "countryName": "United States",
          "countryCode": "US"
        },
        "extraFields": [
          {
            "fieldName": "Company Tax Code",
            "fieldValue": "Code G"
          }
        ]
      }
    ],
    "defaultAddressIds": {
      "shippingAddressId": "17",
      "billingAddressId": "76"
    },
    "pagination": {
      "totalCount": 175,
      "offset": 0,
      "limit": 10
    }
  }
}
```

**SDK Code**

```python Search Addresses
import requests

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

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Search Addresses
const url = 'https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', '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 Search Addresses
package main

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

func main() {

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

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

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

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

```java Search Addresses
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Search Addresses
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Search Addresses
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "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/companies/123/addresses/searches")! 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()
```