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

Create a country

Creates a new country.

name and code are required. The code must be unique across all countries (exact, case-sensitive match); a code that is already in use is rejected with a 400 validation error on the code field.

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": "Türkiye"}}.

post
/countries/
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 country create or full update request.

is_activebooleanOptional

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

namestring · max: 128Required

The display name of the country.

codestring · max: 3Required

The unique country code. Must be unique across all countries.

translationsobject · nullableOptional

Translated field values keyed by language code. Example: {"tr": {"name": "Türkiye"}}.

Default: {}
Responses
201

The created country.

application/json

A country record.

pkintegerRead-onlyOptional

The unique identifier of the country.

is_activebooleanOptional

Whether the country is active. Inactive countries are excluded from storefront address lookups.

namestring · max: 128Optional

The display name of the country.

codestring · max: 3Optional

The unique country code (e.g. ISO 3166-1 alpha-2).

translationsobject · nullableOptional

A mapping of language codes to translated field values. Example: {"tr": {"name": "Türkiye"}, "en": {"name": "Turkey"}}.

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

{
  "is_active": true,
  "name": "Turkey",
  "code": "TR",
  "translations": {
    "tr": {
      "name": "Türkiye"
    }
  }
}
{
  "pk": 1,
  "is_active": true,
  "name": "Turkey",
  "code": "TR",
  "translations": {
    "tr": {
      "name": "Türkiye"
    }
  }
}

Last updated

Was this helpful?