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

Create a township

Creates a new township under a city.

name and city are required. The combination of city and name must be unique at the application layer; a duplicate is rejected with 406 Not Acceptable carrying non_field_errors and error_code fields.

Translations are optional. When supplied, provide them as an object keyed by language code where each value maps field names to translated strings: {"tr": {"name": "Kadıköy"}}.

post
/townships/
Authorizations
AuthorizationstringRequired

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

Body

The body of a township create or full update request.

is_activebooleanOptional

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

namestring · max: 128Required

The display name of the township.

cityintegerRequired

The identifier of the city this township belongs to.

postcodestring · max: 255 · nullableOptional

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

translationsobject · nullableOptional

Translated field values keyed by language code. Example: {"tr": {"name": "Kadıköy"}}.

Default: {}
Responses
201

The created township.

application/json

A township record.

pkintegerRead-onlyOptional

The unique identifier of the township.

is_activebooleanOptional

Whether the township is active. Inactive townships are excluded from storefront address lookups.

namestring · max: 128Optional

The display name of the township.

cityintegerOptional

The identifier of the city this township belongs to.

postcodestring · max: 255 · nullableOptional

The post/zip code associated with the township.

translationsobject · nullableOptional

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

Default: {}
post/townships/
POST /api/v1/remote/1/townships/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 108

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

Last updated

Was this helpful?