Update a city
Fully updates a city.
name and country are both required. If the new combination of country and name already exists in another city, the request is rejected with 406 Not Acceptable.
The translations field is optional. Omitting it or sending {} keeps the existing translations unchanged.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
The unique identifier of the city.
The body of a city create or full update request.
Whether the city is active. Defaults to true when omitted on create.
The display name of the city.
The identifier of the country this city belongs to.
The sort priority of the city. Optional.
The post/zip code associated with the city. Optional.
Translated field values keyed by language code. Example: {"tr": {"name": "İstanbul"}}.
{}The updated city.
A city record.
The unique identifier of the city.
Whether the city is active. Inactive cities are excluded from storefront address lookups.
The display name of the city.
The identifier of the country this city belongs to.
The sort priority of the city. Lower values appear first; null sorts after all numbered priorities.
The post/zip code associated with the city.
A mapping of language codes to translated field values. Example: {"tr": {"name": "İstanbul"}}.
{}The request contains invalid or missing data.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
The requested city does not exist.
The request is well-formed but conflicts with a business rule — for example, requesting a product-type change that is not allowed (only Simple ↔ Miscellaneous transitions are permitted).
PUT /api/v1/remote/1/cities/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 120
{
"is_active": true,
"name": "Istanbul",
"country": 1,
"priority": 1,
"postcode": null,
"translations": {
"tr": {
"name": "İstanbul"
}
}
}{
"pk": 3,
"is_active": true,
"name": "Istanbul",
"country": 1,
"priority": 1,
"postcode": null,
"translations": {
"tr": {
"name": "İstanbul"
}
}
}Last updated
Was this helpful?

