Get Company Addresses
Retrieves all active billing and shipping addresses of a company in one response, without pagination.
HTTP Request
- URL:
/address/company/{companyId} - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_COMPANYorREAD_WRITE_COMPANY
Path Parameters
| Parameter | Type | Description |
|---|---|---|
companyId | String | The ID of the company. |
cURL Example
curl --location '<BASE_URL>/address/company/66b9b3b166169eecd60e5ba8' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The addresses were returned successfully.
- 400 Bad Request: The access token is missing or invalid, or the company ID is not valid.
Sample JSON Response
{
"success": true,
"data": [
{
"id": "66b9b3b166169eecd60e5baa",
"company": "66b9b3b166169eecd60e5ba8",
"type": "shipping",
"firstName": "John",
"lastName": "Doe",
"address1": "3700 Old Seward Hwy",
"city": "Anchorage",
"state": { "name": "Alaska", "code": "AK" },
"country": { "name": "United States", "code": "US" },
"zipcode": "99503",
"isDefaultAddress": true,
"status": true,
"metaFields": [],
"createdAt": "2024-08-23T13:27:13.715Z",
"updatedAt": "2024-08-23T13:27:13.715Z"
},
{
"id": "66b9b3b166169eecd60e5ba9",
"company": "66b9b3b166169eecd60e5ba8",
"type": "billing",
"firstName": "John",
"lastName": "Doe",
"address1": "102 East Green Milton Road",
"city": "Elizabeth",
"state": { "name": "New Jersey", "code": "NJ" },
"country": { "name": "United States", "code": "US" },
"zipcode": "07202",
"isDefaultAddress": true,
"status": true,
"metaFields": [],
"createdAt": "2024-08-12T07:03:13.111Z",
"updatedAt": "2024-08-12T07:03:13.111Z"
}
]
}
Response Details
Address Data
Each item in data has the same fields as the address returned by Get Address by ID.
Notes
- Billing and shipping addresses are returned together. Use the
typefield to tell them apart, or use Get Addresses with thecompanyIdandtypefilters. - If the company has no addresses,
datais an empty array.