Account locations

In addition to the primary location, an account may have any number of additional locations.

Querying for account locations

Use the following endpoints to retrieve information about locations for a specific account:

  • GET /account/v1/accounts/{accountId}/locations
  • GET /account/v1/accounts/{accountId}/locations/{locationId}

Creating account locations

Use the following endpoint to create an AccountLocation for a given account:

  • POST /accounts/{accountId}/locations

Minimum creation criteria

The required information for a location varies based on the locale. For example, for US locations, the minimum amount of information you must specify is:

  • addressLine1
  • city
  • state
  • postalCode

For example, the following request creates a new location for account pc:202.

POST /account/v1/accounts/pc:202/locations

{
  "data": {
    "attributes": {
      "addressLine1": "2870 S. Delaware St.",
      "city": "San Mateo",
      "postalCode": "94403",
      "state": {
        "code": "CA"
      }
    }
  }
  }

For more information on locale-specific requirements, see the Cloud API Developer Guide

Modifying account locations

Use the following endpoint to modify an account location:

  • PATCH /account/v1/accounts/{accountId}/locations/{locationId}

For example, the following request assigns a location name for account location pc:717 on account pc:202.

PATCH /account/v1/accounts/pc:202/contacts/pc:717

{
  "data": {
    "attributes": {
        "locationName": "Employee parking lot"
    }
  }
}

Use the following endpoint to delete an account location:

  • DELETE /account/v1/accounts/{accountId}/locations/{locationId}

For example, the following request deletes account location pc:717 from account pc:202.

DELETE /account/v1/accounts/pc:202/contacts/pc:717

<no request body>