data-src=../../includes/commerce-only.md

Update a company address

data-variant=info
data-slots=text
This endpoint is part of the B2B Storefront Compatibility Package and is only available on Adobe Commerce as a Cloud Service. Requests require an admin or integration token whose role includes the Magento_CompanyAddressStorefrontCompatibility::edit ACL resource.

This endpoint updates an existing company address using the saveByAddressId operation of the companyAddressRepositoryV1 service. The company address book must be enabled for the company, or the request fails with 400 Bad Request and the message Company address book is not enabled for this company.

You cannot specify the type field in the company address payload. Passing a type value that differs from the address's current type returns 400 Bad Request.

If company_id is included in the payload, it must match the company that already owns the address, or the request fails with 400 Bad Request and the message The company address does not belong to the specified company.

Clearing the default flag on the currently-default address is not handled here; use Set a company address as default to change which address is default.

Service Name:

companyAddressRepositoryV1

REST Endpoint:

PUT /V1/company-address/:addressId

See Create a company address for the full list of CompanyAddressInterface parameters.

Update a company address

The following example updates the contact and street details of an existing address.

Sample Usage:

PUT <host>/rest/<store_code>/V1/company-address/12

data-slots=heading, code
data-repeat=2
data-languages=JSON, JSON

Payload

{
  "companyAddress": {
    "company_id": 2,
    "nickname": "Updated Nickname",
    "firstname": "Jane",
    "lastname": "Smith",
    "company": "Updated Corp",
    "street": [
      "456 Oak Ave"
    ],
    "city": "Dallas",
    "country_id": "US",
    "region_id": 57,
    "postcode": "75201",
    "telephone": "5559876543"
  }
}

Response

{
  "company_address_id": 12,
  "company_id": 2,
  "type": 1,
  "nickname": "Updated Nickname",
  "firstname": "Jane",
  "lastname": "Smith",
  "company": "Updated Corp",
  "street": [
    "456 Oak Ave"
  ],
  "city": "Dallas",
  "country_id": "US",
  "region_id": 57,
  "region": {
    "region_id": 57,
    "region": "Texas",
    "region_code": "TX"
  },
  "postcode": "75201",
  "telephone": "5559876543",
  "custom_attributes": []
}