Added
Create and edit accounts and locations using city, state and country names
about 11 hours ago by Gopal Jha
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/createPOST /api/v3/partner/account/{brandId}/updatePOST /api/v3/partner/store/createPOST /api/v3/partner/store/{storeId}/update
The same change applies to the /api/v1 versions of these endpoints.
New request fields
| Field | Example | Notes |
|---|---|---|
city | Austin | The city name. |
state | TX or Texas | The state code or name. |
country | US or United States | The 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_idor all three ofcity,stateandcountry. If you send both,city_idis 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
422on 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
