Skip to content

Get Site Product By ID

Get a specific product with all its variants for public display. Public endpoint.

Endpoint

GET /v1/products/store/site/get-by/?id={variant_id}

Authentication

Not required (public endpoint)

Query Parameters

Parameter Type Required Description
id integer Yes Variant ID
currency_id integer No Currency ID for price conversion

Response

Success (200 OK)

{
  "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"
  },
  "product_variant_list": [
    {
      "id": 1,
      "product_id": 5,
      "name_az": "Məhsul Adı",
      "name_en": "Product Name",
      "sku": "SKU-001",
      "stock_quantity": 100,
      "price": 29.99,
      "discount_percent": 10.0,
      "discount_price": 26.99,
      "currency_name": "AZN",
      "attributes": [
        {
          "id": 1,
          "attribute_id": 1,
          "attribute_name": "Capacity",
          "attribute_name_az": "Tutum",
          "attribute_name_en": "Capacity",
          "attribute_name_es": "Capacidad",
          "attribute_name_de": "Kapazität",
          "attribute_type": "text",
          "value": "360 L",
          "value_az": "360 L",
          "value_en": "360 L",
          "value_es": "360 L",
          "value_de": "360 L",
          "is_filter": true,
          "is_view": true
        }
      ],
      "images": [...],
      "is_wish": false,
      "created": "2025-01-15T10:30:00Z"
    }
  ]
}

Error Responses

Variant Not Found (404)

{
  "error": "Product Variant Not Found"
}

Missing ID Parameter (400)

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

Example Request

curl -X GET "https://api.luxmart.site/v1/products/store/site/get-by/?id=1&currency_id=1"

Notes

  • Returns the product and all its variants
  • Only returns non-deleted variants
  • is_wish indicates if the product is in the user's wishlist (requires authentication header)
  • Price is converted to specified currency if currency_id is provided
  • discount_percent is the discount percentage (0 if no discount)
  • discount_price is the final price after discount (calculated from converted price if currency_id is provided)
  • This is a public endpoint, no authentication required
  • Attribute names and values include translations for all supported languages (attribute_name_az, attribute_name_en, attribute_name_es, attribute_name_de, value_az, value_en, value_es, value_de)
  • Base fields (attribute_name, value) are kept for backward compatibility