Skip to content

Create Country

Create a new country. Requires authentication.

Endpoint

POST /v1/accounts/country/

Authentication

Required

Request Body

Form data (multipart/form-data):

Field Type Required Description
name string Yes Country name

Response

Success (200 OK)

{
  "id": 1,
  "name": "Azerbaijan",
  "created": "2025-01-15T10:30:00Z"
}

Error Responses

Bad Request (400)

{
  "error": "Name is required"
}

Unauthorized (401)

{
  "error": "Missing token on header!"
}

Internal Server Error (500)

{
  "error": "Failed to create country"
}

Example Request

curl -X POST "https://api.luxmart.site/v1/accounts/country/" \
  -H "Authorization: Token your_access_token" \
  -F "name=Azerbaijan"

Notes

  • Country name is required and cannot be empty
  • The created timestamp is automatically set by the system
  • The id is automatically generated