Skip to content

Get Images By Variant

Get all images for a specific product variant.

Endpoint

GET /v1/products/variant/image/store/get-by/?id={variant_id}&product_id={product_id}

Authentication

Required (Store role)

Query Parameters

Parameter Type Required Description
id integer Yes Variant ID
product_id integer Yes Product ID

Response

Success (200 OK)

{
  "product_variant_images": [
    {
      "id": 1,
      "order_image": 1,
      "path": "https://...",
      "created": "2025-01-15T10:30:00Z"
    },
    {
      "id": 2,
      "order_image": 2,
      "path": "https://...",
      "created": "2025-01-15T10:30:00Z"
    }
  ],
  "product_variant": {
    "id": 1,
    "product_id": 5,
    "product": {...},
    "name_az": "Məhsul Adı",
    "name_en": "Product Name",
    "sku": "SKU-001",
    "stock_quantity": 100,
    "price": 29.99,
    "attributes": [...],
    "images": [...],
    "created": "2025-01-15T10:30:00Z"
  }
}

Error Responses

Product Not Found (404)

{
  "error": "Product not found"
}

Variant Not Found (404)

{
  "error": "Product Variant not found"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/products/variant/image/store/get-by/?id=1&product_id=5" \
  -H "Authorization: Token your_access_token"

Notes

  • Product must belong to the authenticated store
  • Variant must belong to the specified product
  • Only returns non-deleted images
  • Images are ordered by order_image ascending