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"}}.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
The body of a township create or full update request.
Whether the township is active. Defaults to true when omitted on create.
The display name of the township.
The identifier of the city this township belongs to.
The post/zip code associated with the township. Optional.
Translated field values keyed by language code. Example: {"tr": {"name": "Kadıköy"}}.
{}The created township.
A township record.
The unique identifier of the township.
Whether the township is active. Inactive townships are excluded from storefront address lookups.
The display name of the township.
The identifier of the city this township belongs to.
The post/zip code associated with the township.
A mapping of language codes to translated field values. Example: {"tr": {"name": "Kadıköy"}}.
{}The request contains invalid or missing data.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
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).
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?

