Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

put
/cities/{id}/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Path parameters
idintegerRequired

The unique identifier of the city.

Body

The body of a city create or full update request.

is_activebooleanOptional

Whether the city is active. Defaults to true when omitted on create.

namestring · max: 128Required

The display name of the city.

countryintegerRequired

The identifier of the country this city belongs to.

priorityinteger · nullableOptional

The sort priority of the city. Optional.

postcodestring · max: 255 · nullableOptional

The post/zip code associated with the city. Optional.

translationsobject · nullableOptional

Translated field values keyed by language code. Example: {"tr": {"name": "İstanbul"}}.

Default: {}
Responses
200

The updated city.

application/json

A city record.

pkintegerRead-onlyOptional

The unique identifier of the city.

is_activebooleanOptional

Whether the city is active. Inactive cities are excluded from storefront address lookups.

namestring · max: 128Optional

The display name of the city.

countryintegerOptional

The identifier of the country this city belongs to.

priorityinteger · nullableOptional

The sort priority of the city. Lower values appear first; null sorts after all numbered priorities.

postcodestring · max: 255 · nullableOptional

The post/zip code associated with the city.

translationsobject · nullableOptional

A mapping of language codes to translated field values. Example: {"tr": {"name": "İstanbul"}}.

Default: {}
put/cities/{id}/
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?