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

Partially update a city

Updates one or more fields of a city. Only the fields included in the request body are changed; everything left out keeps its current value.

If both country and name are included and their combination already exists in another city, the request is rejected with 406 Not Acceptable.

patch
/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 partial update request. Only the fields included are changed.

is_activebooleanOptional

Whether the city is active.

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.

postcodestring · max: 255 · nullableOptional

The post/zip code associated with the city.

translationsobject · nullableOptional

Translated field values keyed by language code.

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: {}
patch/cities/{id}/
PATCH /api/v1/remote/1/cities/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "is_active": false
}
{
  "pk": 3,
  "is_active": true,
  "name": "Istanbul",
  "country": 1,
  "priority": 1,
  "postcode": null,
  "translations": {
    "tr": {
      "name": "İstanbul"
    }
  }
}

Last updated

Was this helpful?