Get City By ID
Get a single city by its ID. Requires authentication.
Endpoint
Authentication
Required
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | City ID |
Response
Success (200 OK)
{
"id": 1,
"name": "Baku",
"country_id": 1,
"country": {
"id": 1,
"name": "Azerbaijan",
"created": "2025-01-15T10:30:00Z"
},
"created": "2025-01-15T10:30:00Z"
}
Error Responses
Not Found (404)
Missing ID Parameter (400)
Unauthorized (401)
Example Request
curl -X GET "https://api.luxmart.site/v1/accounts/city/get-by/?id=1" \
-H "Authorization: Token your_access_token"
Notes
- Only returns non-deleted cities
- Returns the city with its associated country information
- Returns 404 if city is not found or has been deleted