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

Partially update a district

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

If the resulting combination of city, township, and name already exists in another district, the request is rejected with 406 Not Acceptable.

patch
/districts/{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 district.

Body

The body of a district partial update request. Only the fields included are changed.

is_activebooleanOptional

Whether the district is active.

namestring · max: 128Optional

The official name of the district.

cityintegerOptional

The identifier of the city this district belongs to.

townshipintegerOptional

The identifier of the township this district belongs to.

postcodestring · max: 255 · nullableOptional

The post/zip code of the district.

translationsobject · nullableOptional

Translated field values keyed by language code.

Responses
200

The updated district.

application/json

A district record.

pkintegerRead-onlyOptional

The unique identifier of the district.

is_activebooleanOptional

Whether the district is active. Inactive districts are excluded from storefront address lookups.

namestring · max: 128Optional

The official name of the district.

cityintegerOptional

The identifier of the city this district belongs to.

townshipintegerOptional

The identifier of the township this district belongs to.

postcodestring · max: 255 · nullableOptional

The post/zip code of the district.

translationsobject · nullableOptional

A mapping of language codes to translated field values. Example: {"tr": {"name": "Kadıköy"}}.

Default: {}
patch/districts/{id}/
PATCH /api/v1/remote/1/districts/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "is_active": false
}
{
  "pk": 7,
  "is_active": true,
  "name": "Kadıköy",
  "city": 3,
  "township": 12,
  "postcode": "34710",
  "translations": {
    "tr": {
      "name": "Kadıköy"
    }
  }
}

Last updated

Was this helpful?