Added

Create and edit accounts and locations using city, state and country names

You no longer need to look up a city_id before creating or editing an account or location. You can send the city, state, and country names instead.

Endpoints

  • POST /api/v3/partner/account/create
  • POST /api/v3/partner/account/{brandId}/update
  • POST /api/v3/partner/store/create
  • POST /api/v3/partner/store/{storeId}/update

The same change applies to the /api/v1 versions of these endpoints.

New request fields

FieldExampleNotes
cityAustinThe city name.
stateTX or TexasThe state code or name.
countryUS or United StatesThe two-letter ISO code or the country name.
{
  "name": "Acme Plumbing - North",
  "address": "100 Congress Ave",
  "city": "Austin",
  "state": "TX",
  "country": "US",
  "postal_code": "78701",
  "account_id": 5994
}

How it works

  • Send either city_id or all three of city, state and country. If you send both, city_id is used and the names are ignored.
  • Names are matched without regard to case, accents or extra spaces.
  • If we don't have the city yet, it's added under the matching state.
  • If the state or country doesn't match one we have, you get a 422 on that field and nothing is created.

New response field

Successful responses now include a geo object:

"geo": {
  "city_id": 148996,
  "state_id": 1407,
  "country_id": 233,
  "city_created": false
}

Save geo.city_id and send it on later calls if you prefer. city_created is true when the city was added from your request.

Do you need to change anything? No. Requests that send city_id work exactly as before; the only difference is the extra geo object in the response.

Docs: Create an account · Edit an account · Add a location · Edit a location