Skip to content

Get Basket

Get all items in the authenticated user's shopping basket.

Endpoint

GET /v1/products/basket/

Authentication

Required (User role)

Query Parameters

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

Response

Success (200 OK)

[
  {
    "id": 1,
    "product": {
      "id": 10,
      "product_id": 5,
      "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,
      "discount_percent": 10.0,
      "discount_price": 26.99,
      "currency_name": "AZN",
      "attributes": [
        {
          "id": 1,
          "attribute_id": 1,
          "attribute_name": "Color",
          "attribute_name_az": "Rəng",
          "attribute_name_en": "Color",
          "attribute_name_es": "Color",
          "attribute_name_de": "Farbe",
          "attribute_type": "select",
          "value": "Red",
          "value_az": "Qırmızı",
          "value_en": "Red",
          "value_es": "Rojo",
          "value_de": "Rot",
          "is_filter": true,
          "is_view": true
        }
      ],
      "images": [
        {
          "id": 1,
          "path": "https://...",
          "order": 1
        }
      ],
      "is_wish": false,
      "created": "2025-01-15T10:30:00Z"
    },
    "quantity": 2
  }
]

Empty Basket

[]

Example Request

curl -X GET "https://api.luxmart.site/v1/products/basket/?currency_id=1" \
  -H "Authorization: Token your_access_token"

Notes

  • Returns all items in the user's basket
  • Product information includes full variant details
  • 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)
  • is_wish indicates if the product is in the user's wishlist
  • Basket items are user-specific
  • 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