Skip to content

Get All Variants (Admin)

Get a paginated list of all product variants across all stores for admin.

Endpoint

GET /v1/products/variant/admin/

Authentication

Required (Admin role)

Query Parameters

Parameter Type Required Description
page integer Yes Page number (starts at 1)
count integer Yes Items per page (max 100)
search string No Search by variant name (case-insensitive)

Response

Success (200 OK)

{
  "count": 500,
  "data": [
    {
      "id": 1,
      "product_id": 5,
      "product": {
        "id": 5,
        "store_id": 3,
        "store": {...},
        "category_id": 2,
        "category": {...},
        "brand_id": 1,
        "brand": {...},
        "currency_id": 1,
        "currency": {...},
        "created": "2025-01-15T10:30:00Z"
      },
      "name_az": "Məhsul Adı",
      "name_en": "Product Name",
      "name_es": "Nombre del Producto",
      "name_de": "Produktname",
      "description_az": "Məhsul Təsviri",
      "description_en": "Product Description",
      "sku": "SKU-001",
      "stock_quantity": 100,
      "price": 29.99,
      "attributes": [...],
      "images": [...],
      "created": "2025-01-15T10:30:00Z"
    }
  ]
}

Error Responses

Unauthorized (401)

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

Pagination Error (400)

{
  "error": "page cannot be zero or minus"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/products/variant/admin/?page=1&count=20&search=laptop" \
  -H "Authorization: Token your_access_token"

Notes

  • Returns all product variants across all stores
  • Only returns non-deleted variants
  • Search matches against variant name (in any language)
  • Results are ordered by ID descending (newest first)
  • Includes full product, store, category, brand, and currency information