Skip to content

Get Address By ID

Get a specific address by its ID for the authenticated user.

Endpoint

GET /v1/accounts/address/get-by/?id={address_id}

Authentication

Required (User role)

Query Parameters

Parameter Type Required Description
id integer Yes Address ID

Response

Success (200 OK)

{
  "id": 1,
  "user_id": 1,
  "user": {
    "id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "phone": "+994501234567",
    "profile_photo": "",
    "preferred_language": "AZERBAIJANI",
    "role": "1",
    "created": "2025-01-15T10:30:00Z"
  },
  "city_id": 1,
  "city": {
    "id": 1,
    "name": "Baku",
    "country_id": 1,
    "country": {
      "id": 1,
      "name": "Azerbaijan",
      "created": "2025-01-15T10:30:00Z"
    },
    "created": "2025-01-15T10:30:00Z"
  },
  "zip_code": "AZ1000",
  "address": "123 Main Street",
  "phone": "+994501234567",
  "created": "2025-01-15T10:30:00Z"
}

Error Responses

Address Not Found (404)

{
  "error": "Address not found"
}

Missing ID Parameter (400)

{
  "message": "Param not send!"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/accounts/address/get-by/?id=1" \
  -H "Authorization: Token your_access_token"

Notes

  • Only returns addresses belonging to the authenticated user
  • Only returns non-deleted addresses
  • Includes full user, city, and country information