# Models

## The CurrencyTypeEnum object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"CurrencyTypeEnum":{"type":"string","description":"Currency type using ISO 4217 currency codes.\n\nSupported currencies:\n* `try` - Turkish Lira (TRY)\n* `eur` - Euro (EUR)\n* `usd` - US Dollar (USD)\n* `gbp` - British Pound Sterling (GBP)\n* `egp` - Egyptian Pound (EGP)\n* `mad` - Moroccan Dirham (MAD)\n* `pln` - Polish Zloty (PLN)\n* `sar` - Saudi Riyal (SAR)\n* `ron` - Romanian Leu (RON)\n* `uah` - Ukrainian Hryvnia (UAH)\n* `czk` - Czech Koruna (CZK)\n* `huf` - Hungarian Forint (HUF)\n* `rub` - Russian Ruble (RUB)\n* `bgn` - Bulgarian Lev (BGN)\n* `iqd` - Iraqi Dinar (IQD)\n* `kwd` - Kuwaiti Dinar (KWD)\n* `bhd` - Bahraini Dinar (BHD)\n* `omr` - Omani Rial (OMR)\n* `qar` - Qatari Riyal (QAR)\n* `aed` - UAE Dirham (AED)\n* `ngn` - Nigerian Naira (NGN)\n* `inr` - Indian Rupee (INR)\n* `lei` - Moldovan Leu (LEI)\n* `kzt` - Kazakhstani Tenge (KZT)\n* `jod` - Jordanian Dinar (JOD)\n* `rsd` - Serbian Dinar (RSD)","enum":["try","eur","usd","gbp","egp","mad","pln","sar","ron","uah","czk","huf","rub","bgn","iqd","kwd","bhd","omr","qar","aed","ngn","inr","lei","kzt","jod","rsd"]}}}}
```

## The BasketStatusEnum object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"BasketStatusEnum":{"type":"string","description":"Current status of the basket in its lifecycle.\n\nStatus definitions:\n* `active` - Basket is currently active and can be modified by the user\n* `inactive` - Basket is inactive and cannot be modified\n* `expired` - Basket has expired due to inactivity or time limits\n* `merged` - Basket has been merged with another basket (e.g., guest to user merge)\n* `frozen` - Basket is temporarily frozen and cannot be modified\n* `submitted` - Basket has been submitted as an order and is now read-only\n\nTypical lifecycle: active → submitted (on checkout) or active → merged (on user login)","enum":["active","inactive","expired","merged","frozen","submitted"]}}}}
```

## The ProductTypeEnum object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"ProductTypeEnum":{"type":"string","description":"Type of product that determines its behavior and structure.\n\nProduct type definitions:\n* `simple` (0) - Standard standalone product with single SKU\n* `bundle` (2) - Bundle product requiring form completion with chapters and attributes\n* `grouped` (3) - Grouped product that contains multiple related products\n* `product_meta` (1) - Meta product used for organizational purposes (not purchasable)\n* `miscellaneous` (4) - Special miscellaneous product (e.g., gift wrap, services)\n* `offer` (5) - Special offer product that may contain promotional items\n* `pre_product` (-1) - Pre-release or pre-order product\n* `pre_miscellaneous` (-2) - Pre-release miscellaneous product\n\n**Important notes:**\n* `product_meta` and `grouped` types cannot be added to basket directly\n* `bundle` type requires form completion with chapter data\n* `miscellaneous` and `offer` types are typically used as sub-items","enum":["-1","0","1","2","3","-2","4","5"]}}}}
```

## The ApplicationResultTypeEnum object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"ApplicationResultTypeEnum":{"type":"string","description":"Type of discount application result that determines what the discount affects.\n\nApplication types:\n* `basket` - Discount applied to basket items (reduces product prices)\n* `shipping` - Discount applied to shipping costs (free or reduced shipping)\n* `post_order` - Discount applied after order completion (cashback, loyalty points)\n* `sample_product` - Free sample product added to basket as promotional item\n\n**Usage in responses:**\n* Basket discounts reduce the total_amount\n* Shipping discounts appear in shipping_discount field on items\n* Sample products appear as separate basket items with special pricing\n* Post-order benefits are tracked separately for future application","enum":["basket","shipping","post_order","sample_product"]}}}}
```

## The ProductDetail object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"ProductDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Product unique identifier"},"sku":{"type":"string","description":"Stock Keeping Unit"},"name":{"type":"string","description":"Product name"},"base_code":{"type":"string","description":"Product base code"},"product_type":{"$ref":"#/components/schemas/ProductTypeEnum"},"productimage_set":{"type":"array","items":{"type":"object","properties":{"image":{"type":"string","description":"Product image URL"}}},"description":"Product images"},"attributes":{"type":"object","description":"Product attributes and metadata"},"is_active":{"type":"boolean","description":"Product active status"},"attribute_set":{"type":"integer","nullable":true,"description":"Attribute set ID"}}},"ProductTypeEnum":{"type":"string","description":"Type of product that determines its behavior and structure.\n\nProduct type definitions:\n* `simple` (0) - Standard standalone product with single SKU\n* `bundle` (2) - Bundle product requiring form completion with chapters and attributes\n* `grouped` (3) - Grouped product that contains multiple related products\n* `product_meta` (1) - Meta product used for organizational purposes (not purchasable)\n* `miscellaneous` (4) - Special miscellaneous product (e.g., gift wrap, services)\n* `offer` (5) - Special offer product that may contain promotional items\n* `pre_product` (-1) - Pre-release or pre-order product\n* `pre_miscellaneous` (-2) - Pre-release miscellaneous product\n\n**Important notes:**\n* `product_meta` and `grouped` types cannot be added to basket directly\n* `bundle` type requires form completion with chapter data\n* `miscellaneous` and `offer` types are typically used as sub-items","enum":["-1","0","1","2","3","-2","4","5"]}}}}
```

## The DataSource object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"DataSource":{"type":"object","properties":{"pk":{"type":"integer","description":"Datasource unique identifier"},"name":{"type":"string","description":"Datasource/seller name"},"erp_code":{"type":"string","nullable":true,"description":"ERP code for the datasource"}}}}}}
```

## The Discount object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"Discount":{"type":"object","properties":{"description":{"type":"string","description":"Description of the discount"},"discount":{"type":"string","description":"Discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"ApplicationResultTypeEnum":{"type":"string","description":"Type of discount application result that determines what the discount affects.\n\nApplication types:\n* `basket` - Discount applied to basket items (reduces product prices)\n* `shipping` - Discount applied to shipping costs (free or reduced shipping)\n* `post_order` - Discount applied after order completion (cashback, loyalty points)\n* `sample_product` - Free sample product added to basket as promotional item\n\n**Usage in responses:**\n* Basket discounts reduce the total_amount\n* Shipping discounts appear in shipping_discount field on items\n* Sample products appear as separate basket items with special pricing\n* Post-order benefits are tracked separately for future application","enum":["basket","shipping","post_order","sample_product"]}}}}
```

## The ShippingDiscount object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"ShippingDiscount":{"type":"object","properties":{"description":{"type":"string","nullable":true,"description":"Shipping discount description"},"discount":{"type":"string","description":"Shipping discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"ApplicationResultTypeEnum":{"type":"string","description":"Type of discount application result that determines what the discount affects.\n\nApplication types:\n* `basket` - Discount applied to basket items (reduces product prices)\n* `shipping` - Discount applied to shipping costs (free or reduced shipping)\n* `post_order` - Discount applied after order completion (cashback, loyalty points)\n* `sample_product` - Free sample product added to basket as promotional item\n\n**Usage in responses:**\n* Basket discounts reduce the total_amount\n* Shipping discounts appear in shipping_discount field on items\n* Sample products appear as separate basket items with special pricing\n* Post-order benefits are tracked separately for future application","enum":["basket","shipping","post_order","sample_product"]}}}}
```

## The BasketItem object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"BasketItem":{"type":"object","properties":{"id":{"type":"integer","description":"Basket item unique identifier"},"product":{"$ref":"#/components/schemas/ProductDetail"},"quantity":{"type":"number","multipleOf":0.01,"description":"Quantity of the product"},"unit_price":{"type":"string","description":"Unit price of the product (before discounts)"},"price":{"type":"string","description":"Current unit price (same as unit_price)"},"retail_price":{"type":"string","description":"Retail price of the product"},"discounted_price":{"type":"string","description":"Unit price after discounts"},"tax_rate":{"type":"string","description":"Tax rate applied (as decimal)"},"currency_type":{"$ref":"#/components/schemas/CurrencyTypeEnum"},"total_amount":{"type":"string","description":"Total amount for this item (quantity × discounted_price)"},"discount_amount":{"type":"string","description":"Total discount amount for this item"},"stock":{"type":"integer","description":"Available stock for this product"},"attributes":{"type":"object","description":"Custom attributes for the basket item (gift notes, etc.)","nullable":true},"attributes_kwargs":{"type":"object","description":"Formatted attributes for display","nullable":true},"shipping_discount":{"$ref":"#/components/schemas/ShippingDiscount"},"offer_badges":{"type":"array","items":{"$ref":"#/components/schemas/Discount"},"description":"List of offer badges applied to this item"},"image":{"type":"string","nullable":true,"description":"Primary image for the item"},"parent":{"type":"integer","nullable":true,"description":"Parent basket item ID (for sub-items)"},"datasource":{"$ref":"#/components/schemas/DataSource"},"extra_product_stock_detailed":{"type":"object","nullable":true,"description":"Extra product stock details (marketplace)"},"extra_product_price_detailed":{"type":"object","nullable":true,"description":"Extra product price details (marketplace)"}}},"ProductDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Product unique identifier"},"sku":{"type":"string","description":"Stock Keeping Unit"},"name":{"type":"string","description":"Product name"},"base_code":{"type":"string","description":"Product base code"},"product_type":{"$ref":"#/components/schemas/ProductTypeEnum"},"productimage_set":{"type":"array","items":{"type":"object","properties":{"image":{"type":"string","description":"Product image URL"}}},"description":"Product images"},"attributes":{"type":"object","description":"Product attributes and metadata"},"is_active":{"type":"boolean","description":"Product active status"},"attribute_set":{"type":"integer","nullable":true,"description":"Attribute set ID"}}},"ProductTypeEnum":{"type":"string","description":"Type of product that determines its behavior and structure.\n\nProduct type definitions:\n* `simple` (0) - Standard standalone product with single SKU\n* `bundle` (2) - Bundle product requiring form completion with chapters and attributes\n* `grouped` (3) - Grouped product that contains multiple related products\n* `product_meta` (1) - Meta product used for organizational purposes (not purchasable)\n* `miscellaneous` (4) - Special miscellaneous product (e.g., gift wrap, services)\n* `offer` (5) - Special offer product that may contain promotional items\n* `pre_product` (-1) - Pre-release or pre-order product\n* `pre_miscellaneous` (-2) - Pre-release miscellaneous product\n\n**Important notes:**\n* `product_meta` and `grouped` types cannot be added to basket directly\n* `bundle` type requires form completion with chapter data\n* `miscellaneous` and `offer` types are typically used as sub-items","enum":["-1","0","1","2","3","-2","4","5"]},"CurrencyTypeEnum":{"type":"string","description":"Currency type using ISO 4217 currency codes.\n\nSupported currencies:\n* `try` - Turkish Lira (TRY)\n* `eur` - Euro (EUR)\n* `usd` - US Dollar (USD)\n* `gbp` - British Pound Sterling (GBP)\n* `egp` - Egyptian Pound (EGP)\n* `mad` - Moroccan Dirham (MAD)\n* `pln` - Polish Zloty (PLN)\n* `sar` - Saudi Riyal (SAR)\n* `ron` - Romanian Leu (RON)\n* `uah` - Ukrainian Hryvnia (UAH)\n* `czk` - Czech Koruna (CZK)\n* `huf` - Hungarian Forint (HUF)\n* `rub` - Russian Ruble (RUB)\n* `bgn` - Bulgarian Lev (BGN)\n* `iqd` - Iraqi Dinar (IQD)\n* `kwd` - Kuwaiti Dinar (KWD)\n* `bhd` - Bahraini Dinar (BHD)\n* `omr` - Omani Rial (OMR)\n* `qar` - Qatari Riyal (QAR)\n* `aed` - UAE Dirham (AED)\n* `ngn` - Nigerian Naira (NGN)\n* `inr` - Indian Rupee (INR)\n* `lei` - Moldovan Leu (LEI)\n* `kzt` - Kazakhstani Tenge (KZT)\n* `jod` - Jordanian Dinar (JOD)\n* `rsd` - Serbian Dinar (RSD)","enum":["try","eur","usd","gbp","egp","mad","pln","sar","ron","uah","czk","huf","rub","bgn","iqd","kwd","bhd","omr","qar","aed","ngn","inr","lei","kzt","jod","rsd"]},"ShippingDiscount":{"type":"object","properties":{"description":{"type":"string","nullable":true,"description":"Shipping discount description"},"discount":{"type":"string","description":"Shipping discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"ApplicationResultTypeEnum":{"type":"string","description":"Type of discount application result that determines what the discount affects.\n\nApplication types:\n* `basket` - Discount applied to basket items (reduces product prices)\n* `shipping` - Discount applied to shipping costs (free or reduced shipping)\n* `post_order` - Discount applied after order completion (cashback, loyalty points)\n* `sample_product` - Free sample product added to basket as promotional item\n\n**Usage in responses:**\n* Basket discounts reduce the total_amount\n* Shipping discounts appear in shipping_discount field on items\n* Sample products appear as separate basket items with special pricing\n* Post-order benefits are tracked separately for future application","enum":["basket","shipping","post_order","sample_product"]},"Discount":{"type":"object","properties":{"description":{"type":"string","description":"Description of the discount"},"discount":{"type":"string","description":"Discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"DataSource":{"type":"object","properties":{"pk":{"type":"integer","description":"Datasource unique identifier"},"name":{"type":"string","description":"Datasource/seller name"},"erp_code":{"type":"string","nullable":true,"description":"ERP code for the datasource"}}}}}}
```

## The UnavailableProduct object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"UnavailableProduct":{"type":"object","properties":{"pk":{"type":"integer","description":"Product ID"},"name":{"type":"string","description":"Product name"},"unavailable_quantity":{"type":"number","description":"Quantity that was removed due to unavailability"}}}}}}
```

## The UpsellDetail object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"UpsellDetail":{"type":"object","properties":{"message":{"type":"string","description":"Upsell message for failed offer"},"params":{"type":"object","description":"Parameters for the upsell message"}}}}}}
```

## The Basket object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"Basket":{"type":"object","properties":{"pk":{"type":"integer","description":"Basket unique identifier"},"namespace":{"type":"string","nullable":true,"description":"Basket namespace for logical separation"},"basketitem_set":{"type":"array","items":{"$ref":"#/components/schemas/BasketItem"},"description":"List of basket items"},"total_quantity":{"type":"integer","description":"Total quantity of all items in basket"},"total_amount":{"type":"string","description":"Total amount after all discounts"},"total_discount_amount":{"type":"string","description":"Total discount amount applied to basket"},"total_product_amount":{"type":"string","description":"Total product amount before discounts"},"discounts":{"type":"array","items":{"$ref":"#/components/schemas/Discount"},"description":"List of applied discounts"},"upsell_details":{"type":"array","items":{"$ref":"#/components/schemas/UpsellDetail"},"description":"Upsell messages for offers that almost qualified"},"voucher_code":{"type":"string","nullable":true,"description":"Applied voucher code"},"created_date":{"type":"string","format":"date-time","description":"Basket creation timestamp"},"modified_date":{"type":"string","format":"date-time","description":"Last modification timestamp"},"segment":{"$ref":"#/components/schemas/Segment"},"unavailable_basket_products":{"type":"array","items":{"$ref":"#/components/schemas/UnavailableProduct"},"description":"Products that were removed due to unavailability"}}},"BasketItem":{"type":"object","properties":{"id":{"type":"integer","description":"Basket item unique identifier"},"product":{"$ref":"#/components/schemas/ProductDetail"},"quantity":{"type":"number","multipleOf":0.01,"description":"Quantity of the product"},"unit_price":{"type":"string","description":"Unit price of the product (before discounts)"},"price":{"type":"string","description":"Current unit price (same as unit_price)"},"retail_price":{"type":"string","description":"Retail price of the product"},"discounted_price":{"type":"string","description":"Unit price after discounts"},"tax_rate":{"type":"string","description":"Tax rate applied (as decimal)"},"currency_type":{"$ref":"#/components/schemas/CurrencyTypeEnum"},"total_amount":{"type":"string","description":"Total amount for this item (quantity × discounted_price)"},"discount_amount":{"type":"string","description":"Total discount amount for this item"},"stock":{"type":"integer","description":"Available stock for this product"},"attributes":{"type":"object","description":"Custom attributes for the basket item (gift notes, etc.)","nullable":true},"attributes_kwargs":{"type":"object","description":"Formatted attributes for display","nullable":true},"shipping_discount":{"$ref":"#/components/schemas/ShippingDiscount"},"offer_badges":{"type":"array","items":{"$ref":"#/components/schemas/Discount"},"description":"List of offer badges applied to this item"},"image":{"type":"string","nullable":true,"description":"Primary image for the item"},"parent":{"type":"integer","nullable":true,"description":"Parent basket item ID (for sub-items)"},"datasource":{"$ref":"#/components/schemas/DataSource"},"extra_product_stock_detailed":{"type":"object","nullable":true,"description":"Extra product stock details (marketplace)"},"extra_product_price_detailed":{"type":"object","nullable":true,"description":"Extra product price details (marketplace)"}}},"ProductDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Product unique identifier"},"sku":{"type":"string","description":"Stock Keeping Unit"},"name":{"type":"string","description":"Product name"},"base_code":{"type":"string","description":"Product base code"},"product_type":{"$ref":"#/components/schemas/ProductTypeEnum"},"productimage_set":{"type":"array","items":{"type":"object","properties":{"image":{"type":"string","description":"Product image URL"}}},"description":"Product images"},"attributes":{"type":"object","description":"Product attributes and metadata"},"is_active":{"type":"boolean","description":"Product active status"},"attribute_set":{"type":"integer","nullable":true,"description":"Attribute set ID"}}},"ProductTypeEnum":{"type":"string","description":"Type of product that determines its behavior and structure.\n\nProduct type definitions:\n* `simple` (0) - Standard standalone product with single SKU\n* `bundle` (2) - Bundle product requiring form completion with chapters and attributes\n* `grouped` (3) - Grouped product that contains multiple related products\n* `product_meta` (1) - Meta product used for organizational purposes (not purchasable)\n* `miscellaneous` (4) - Special miscellaneous product (e.g., gift wrap, services)\n* `offer` (5) - Special offer product that may contain promotional items\n* `pre_product` (-1) - Pre-release or pre-order product\n* `pre_miscellaneous` (-2) - Pre-release miscellaneous product\n\n**Important notes:**\n* `product_meta` and `grouped` types cannot be added to basket directly\n* `bundle` type requires form completion with chapter data\n* `miscellaneous` and `offer` types are typically used as sub-items","enum":["-1","0","1","2","3","-2","4","5"]},"CurrencyTypeEnum":{"type":"string","description":"Currency type using ISO 4217 currency codes.\n\nSupported currencies:\n* `try` - Turkish Lira (TRY)\n* `eur` - Euro (EUR)\n* `usd` - US Dollar (USD)\n* `gbp` - British Pound Sterling (GBP)\n* `egp` - Egyptian Pound (EGP)\n* `mad` - Moroccan Dirham (MAD)\n* `pln` - Polish Zloty (PLN)\n* `sar` - Saudi Riyal (SAR)\n* `ron` - Romanian Leu (RON)\n* `uah` - Ukrainian Hryvnia (UAH)\n* `czk` - Czech Koruna (CZK)\n* `huf` - Hungarian Forint (HUF)\n* `rub` - Russian Ruble (RUB)\n* `bgn` - Bulgarian Lev (BGN)\n* `iqd` - Iraqi Dinar (IQD)\n* `kwd` - Kuwaiti Dinar (KWD)\n* `bhd` - Bahraini Dinar (BHD)\n* `omr` - Omani Rial (OMR)\n* `qar` - Qatari Riyal (QAR)\n* `aed` - UAE Dirham (AED)\n* `ngn` - Nigerian Naira (NGN)\n* `inr` - Indian Rupee (INR)\n* `lei` - Moldovan Leu (LEI)\n* `kzt` - Kazakhstani Tenge (KZT)\n* `jod` - Jordanian Dinar (JOD)\n* `rsd` - Serbian Dinar (RSD)","enum":["try","eur","usd","gbp","egp","mad","pln","sar","ron","uah","czk","huf","rub","bgn","iqd","kwd","bhd","omr","qar","aed","ngn","inr","lei","kzt","jod","rsd"]},"ShippingDiscount":{"type":"object","properties":{"description":{"type":"string","nullable":true,"description":"Shipping discount description"},"discount":{"type":"string","description":"Shipping discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"ApplicationResultTypeEnum":{"type":"string","description":"Type of discount application result that determines what the discount affects.\n\nApplication types:\n* `basket` - Discount applied to basket items (reduces product prices)\n* `shipping` - Discount applied to shipping costs (free or reduced shipping)\n* `post_order` - Discount applied after order completion (cashback, loyalty points)\n* `sample_product` - Free sample product added to basket as promotional item\n\n**Usage in responses:**\n* Basket discounts reduce the total_amount\n* Shipping discounts appear in shipping_discount field on items\n* Sample products appear as separate basket items with special pricing\n* Post-order benefits are tracked separately for future application","enum":["basket","shipping","post_order","sample_product"]},"Discount":{"type":"object","properties":{"description":{"type":"string","description":"Description of the discount"},"discount":{"type":"string","description":"Discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"DataSource":{"type":"object","properties":{"pk":{"type":"integer","description":"Datasource unique identifier"},"name":{"type":"string","description":"Datasource/seller name"},"erp_code":{"type":"string","nullable":true,"description":"ERP code for the datasource"}}},"UpsellDetail":{"type":"object","properties":{"message":{"type":"string","description":"Upsell message for failed offer"},"params":{"type":"object","description":"Parameters for the upsell message"}}},"Segment":{"type":"object","properties":{"pk":{"type":"integer","nullable":true,"description":"Segment primary key"},"price_list":{"type":"integer","nullable":true,"description":"Price list ID for the segment"},"stock_list":{"type":"integer","nullable":true,"description":"Stock list ID for the segment"}}},"UnavailableProduct":{"type":"object","properties":{"pk":{"type":"integer","description":"Product ID"},"name":{"type":"string","description":"Product name"},"unavailable_quantity":{"type":"number","description":"Quantity that was removed due to unavailability"}}}}}}
```

## The BasketResponse object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"BasketResponse":{"type":"object","properties":{"basket":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"type":"object","properties":{"pk":{"type":"integer","description":"Basket unique identifier"},"namespace":{"type":"string","nullable":true,"description":"Basket namespace for logical separation"},"basketitem_set":{"type":"array","items":{"$ref":"#/components/schemas/BasketItem"},"description":"List of basket items"},"total_quantity":{"type":"integer","description":"Total quantity of all items in basket"},"total_amount":{"type":"string","description":"Total amount after all discounts"},"total_discount_amount":{"type":"string","description":"Total discount amount applied to basket"},"total_product_amount":{"type":"string","description":"Total product amount before discounts"},"discounts":{"type":"array","items":{"$ref":"#/components/schemas/Discount"},"description":"List of applied discounts"},"upsell_details":{"type":"array","items":{"$ref":"#/components/schemas/UpsellDetail"},"description":"Upsell messages for offers that almost qualified"},"voucher_code":{"type":"string","nullable":true,"description":"Applied voucher code"},"created_date":{"type":"string","format":"date-time","description":"Basket creation timestamp"},"modified_date":{"type":"string","format":"date-time","description":"Last modification timestamp"},"segment":{"$ref":"#/components/schemas/Segment"},"unavailable_basket_products":{"type":"array","items":{"$ref":"#/components/schemas/UnavailableProduct"},"description":"Products that were removed due to unavailability"}}},"BasketItem":{"type":"object","properties":{"id":{"type":"integer","description":"Basket item unique identifier"},"product":{"$ref":"#/components/schemas/ProductDetail"},"quantity":{"type":"number","multipleOf":0.01,"description":"Quantity of the product"},"unit_price":{"type":"string","description":"Unit price of the product (before discounts)"},"price":{"type":"string","description":"Current unit price (same as unit_price)"},"retail_price":{"type":"string","description":"Retail price of the product"},"discounted_price":{"type":"string","description":"Unit price after discounts"},"tax_rate":{"type":"string","description":"Tax rate applied (as decimal)"},"currency_type":{"$ref":"#/components/schemas/CurrencyTypeEnum"},"total_amount":{"type":"string","description":"Total amount for this item (quantity × discounted_price)"},"discount_amount":{"type":"string","description":"Total discount amount for this item"},"stock":{"type":"integer","description":"Available stock for this product"},"attributes":{"type":"object","description":"Custom attributes for the basket item (gift notes, etc.)","nullable":true},"attributes_kwargs":{"type":"object","description":"Formatted attributes for display","nullable":true},"shipping_discount":{"$ref":"#/components/schemas/ShippingDiscount"},"offer_badges":{"type":"array","items":{"$ref":"#/components/schemas/Discount"},"description":"List of offer badges applied to this item"},"image":{"type":"string","nullable":true,"description":"Primary image for the item"},"parent":{"type":"integer","nullable":true,"description":"Parent basket item ID (for sub-items)"},"datasource":{"$ref":"#/components/schemas/DataSource"},"extra_product_stock_detailed":{"type":"object","nullable":true,"description":"Extra product stock details (marketplace)"},"extra_product_price_detailed":{"type":"object","nullable":true,"description":"Extra product price details (marketplace)"}}},"ProductDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Product unique identifier"},"sku":{"type":"string","description":"Stock Keeping Unit"},"name":{"type":"string","description":"Product name"},"base_code":{"type":"string","description":"Product base code"},"product_type":{"$ref":"#/components/schemas/ProductTypeEnum"},"productimage_set":{"type":"array","items":{"type":"object","properties":{"image":{"type":"string","description":"Product image URL"}}},"description":"Product images"},"attributes":{"type":"object","description":"Product attributes and metadata"},"is_active":{"type":"boolean","description":"Product active status"},"attribute_set":{"type":"integer","nullable":true,"description":"Attribute set ID"}}},"ProductTypeEnum":{"type":"string","description":"Type of product that determines its behavior and structure.\n\nProduct type definitions:\n* `simple` (0) - Standard standalone product with single SKU\n* `bundle` (2) - Bundle product requiring form completion with chapters and attributes\n* `grouped` (3) - Grouped product that contains multiple related products\n* `product_meta` (1) - Meta product used for organizational purposes (not purchasable)\n* `miscellaneous` (4) - Special miscellaneous product (e.g., gift wrap, services)\n* `offer` (5) - Special offer product that may contain promotional items\n* `pre_product` (-1) - Pre-release or pre-order product\n* `pre_miscellaneous` (-2) - Pre-release miscellaneous product\n\n**Important notes:**\n* `product_meta` and `grouped` types cannot be added to basket directly\n* `bundle` type requires form completion with chapter data\n* `miscellaneous` and `offer` types are typically used as sub-items","enum":["-1","0","1","2","3","-2","4","5"]},"CurrencyTypeEnum":{"type":"string","description":"Currency type using ISO 4217 currency codes.\n\nSupported currencies:\n* `try` - Turkish Lira (TRY)\n* `eur` - Euro (EUR)\n* `usd` - US Dollar (USD)\n* `gbp` - British Pound Sterling (GBP)\n* `egp` - Egyptian Pound (EGP)\n* `mad` - Moroccan Dirham (MAD)\n* `pln` - Polish Zloty (PLN)\n* `sar` - Saudi Riyal (SAR)\n* `ron` - Romanian Leu (RON)\n* `uah` - Ukrainian Hryvnia (UAH)\n* `czk` - Czech Koruna (CZK)\n* `huf` - Hungarian Forint (HUF)\n* `rub` - Russian Ruble (RUB)\n* `bgn` - Bulgarian Lev (BGN)\n* `iqd` - Iraqi Dinar (IQD)\n* `kwd` - Kuwaiti Dinar (KWD)\n* `bhd` - Bahraini Dinar (BHD)\n* `omr` - Omani Rial (OMR)\n* `qar` - Qatari Riyal (QAR)\n* `aed` - UAE Dirham (AED)\n* `ngn` - Nigerian Naira (NGN)\n* `inr` - Indian Rupee (INR)\n* `lei` - Moldovan Leu (LEI)\n* `kzt` - Kazakhstani Tenge (KZT)\n* `jod` - Jordanian Dinar (JOD)\n* `rsd` - Serbian Dinar (RSD)","enum":["try","eur","usd","gbp","egp","mad","pln","sar","ron","uah","czk","huf","rub","bgn","iqd","kwd","bhd","omr","qar","aed","ngn","inr","lei","kzt","jod","rsd"]},"ShippingDiscount":{"type":"object","properties":{"description":{"type":"string","nullable":true,"description":"Shipping discount description"},"discount":{"type":"string","description":"Shipping discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"ApplicationResultTypeEnum":{"type":"string","description":"Type of discount application result that determines what the discount affects.\n\nApplication types:\n* `basket` - Discount applied to basket items (reduces product prices)\n* `shipping` - Discount applied to shipping costs (free or reduced shipping)\n* `post_order` - Discount applied after order completion (cashback, loyalty points)\n* `sample_product` - Free sample product added to basket as promotional item\n\n**Usage in responses:**\n* Basket discounts reduce the total_amount\n* Shipping discounts appear in shipping_discount field on items\n* Sample products appear as separate basket items with special pricing\n* Post-order benefits are tracked separately for future application","enum":["basket","shipping","post_order","sample_product"]},"Discount":{"type":"object","properties":{"description":{"type":"string","description":"Description of the discount"},"discount":{"type":"string","description":"Discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"DataSource":{"type":"object","properties":{"pk":{"type":"integer","description":"Datasource unique identifier"},"name":{"type":"string","description":"Datasource/seller name"},"erp_code":{"type":"string","nullable":true,"description":"ERP code for the datasource"}}},"UpsellDetail":{"type":"object","properties":{"message":{"type":"string","description":"Upsell message for failed offer"},"params":{"type":"object","description":"Parameters for the upsell message"}}},"Segment":{"type":"object","properties":{"pk":{"type":"integer","nullable":true,"description":"Segment primary key"},"price_list":{"type":"integer","nullable":true,"description":"Price list ID for the segment"},"stock_list":{"type":"integer","nullable":true,"description":"Stock list ID for the segment"}}},"UnavailableProduct":{"type":"object","properties":{"pk":{"type":"integer","description":"Product ID"},"name":{"type":"string","description":"Product name"},"unavailable_quantity":{"type":"number","description":"Quantity that was removed due to unavailability"}}}}}}
```

## The MiniBasket object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"MiniBasket":{"type":"object","properties":{"pk":{"type":"integer","description":"Basket unique identifier"},"total_quantity":{"type":"integer","description":"Total quantity of items in basket"}}}}}}
```

## The AddProductRequest object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"AddProductRequest":{"type":"object","required":["product","quantity"],"properties":{"product":{"type":"integer","description":"Product ID to add to basket"},"quantity":{"type":"number","multipleOf":0.01,"minimum":0,"description":"Quantity to add (will be added to existing quantity)"},"attributes":{"type":"object","description":"Custom attributes for the basket item (gift notes, form data, etc.)"},"datasource":{"type":"integer","description":"Datasource/seller ID (required for marketplace)"},"sub_items":{"type":"array","items":{"$ref":"#/components/schemas/AddProductRequest"},"description":"Sub-items to add with the main product (extra products)"},"namespace":{"type":"string","description":"Basket namespace to use"}}}}}}
```

## The SetProductRequest object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"SetProductRequest":{"type":"object","required":["product","quantity"],"properties":{"product":{"type":"integer","description":"Product ID to set in basket"},"quantity":{"type":"number","multipleOf":0.01,"minimum":0,"description":"Quantity to set (replaces existing quantity, 0 removes item)"},"attributes":{"type":"object","description":"Custom attributes for the basket item"},"datasource":{"type":"integer","description":"Datasource/seller ID (required for marketplace)"},"sub_items":{"type":"array","items":{"$ref":"#/components/schemas/AddProductRequest"},"description":"Sub-items to set with the main product"},"namespace":{"type":"string","description":"Basket namespace to use"}}},"AddProductRequest":{"type":"object","required":["product","quantity"],"properties":{"product":{"type":"integer","description":"Product ID to add to basket"},"quantity":{"type":"number","multipleOf":0.01,"minimum":0,"description":"Quantity to add (will be added to existing quantity)"},"attributes":{"type":"object","description":"Custom attributes for the basket item (gift notes, form data, etc.)"},"datasource":{"type":"integer","description":"Datasource/seller ID (required for marketplace)"},"sub_items":{"type":"array","items":{"$ref":"#/components/schemas/AddProductRequest"},"description":"Sub-items to add with the main product (extra products)"},"namespace":{"type":"string","description":"Basket namespace to use"}}}}}}
```

## The UpdateVoucherRequest object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"UpdateVoucherRequest":{"type":"object","properties":{"voucher_code":{"type":"string","description":"Voucher code to apply"},"remove_voucher_code":{"type":"boolean","description":"Set to true to remove current voucher code"},"external_offer_code":{"type":"string","description":"External offer code (alternative to voucher_code)"}}}}}}
```

## The UpdateItemAttributesRequest object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"UpdateItemAttributesRequest":{"type":"object","required":["id","attributes"],"properties":{"id":{"type":"integer","description":"Basket item ID to update"},"attributes":{"type":"object","description":"Attributes to update (merged with existing attributes)"},"is_all":{"type":"boolean","description":"Apply to all items with same product (default false)"}}}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"detail":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Field-specific validation errors"}}}}}}
```

## The BasketList object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"BasketList":{"type":"object","properties":{"pk":{"type":"integer","description":"Unique identifier for the basket"},"namespace":{"type":"string","nullable":true,"description":"Namespace identifier for the basket"}}}}}}
```

## The BasketListResponse object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"BasketListResponse":{"type":"object","properties":{"baskets":{"type":"array","items":{"$ref":"#/components/schemas/BasketList"},"description":"List of active baskets"}}},"BasketList":{"type":"object","properties":{"pk":{"type":"integer","description":"Unique identifier for the basket"},"namespace":{"type":"string","nullable":true,"description":"Namespace identifier for the basket"}}}}}}
```

## The Segment object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"Segment":{"type":"object","properties":{"pk":{"type":"integer","nullable":true,"description":"Segment primary key"},"price_list":{"type":"integer","nullable":true,"description":"Price list ID for the segment"},"stock_list":{"type":"integer","nullable":true,"description":"Stock list ID for the segment"}}}}}}
```

## The DetailedDiscount object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"DetailedDiscount":{"allOf":[{"$ref":"#/components/schemas/Discount"},{"type":"object","properties":{"sample_products":{"type":"array","items":{"type":"object"},"description":"Sample products for the discount"},"allowed_quantity":{"type":"integer","description":"Allowed quantity for the discount"}}}]},"Discount":{"type":"object","properties":{"description":{"type":"string","description":"Description of the discount"},"discount":{"type":"string","description":"Discount amount"},"affects":{"$ref":"#/components/schemas/ApplicationResultTypeEnum"}}},"ApplicationResultTypeEnum":{"type":"string","description":"Type of discount application result that determines what the discount affects.\n\nApplication types:\n* `basket` - Discount applied to basket items (reduces product prices)\n* `shipping` - Discount applied to shipping costs (free or reduced shipping)\n* `post_order` - Discount applied after order completion (cashback, loyalty points)\n* `sample_product` - Free sample product added to basket as promotional item\n\n**Usage in responses:**\n* Basket discounts reduce the total_amount\n* Shipping discounts appear in shipping_discount field on items\n* Sample products appear as separate basket items with special pricing\n* Post-order benefits are tracked separately for future application","enum":["basket","shipping","post_order","sample_product"]}}}}
```

## The EnumValue object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"EnumValue":{"type":"object","description":"Enum value (value + label pair)","required":["value","label"],"properties":{"value":{"type":"string","description":"Enum code value"},"label":{"type":"string","description":"Human readable label"}}}}}}
```

## The ApplicableVoucherCode object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"ApplicableVoucherCode":{"type":"object","description":"Voucher/coupon code that is applicable to the current basket but not yet\napplied. Returned by the applicable discount codes endpoint so that the\nstorefront can render usable codes on the basket page.","required":["end_datetime","start_datetime","voucher_code","offer_type","benefit_type"],"properties":{"label":{"type":"string","maxLength":512,"nullable":true,"description":"Offer label (display name shown to the user)"},"amount":{"type":"number","format":"decimal","description":"Fixed discount amount (for `fixed` benefit type).\nReturns `0` for `percentage` or `shipping_free` benefit types."},"percentage":{"type":"number","format":"decimal","nullable":true,"description":"Percentage discount rate (for `percentage` benefit type).\nReturns `null` for `fixed` or `shipping_free` benefit types."},"end_datetime":{"type":"string","format":"date-time","description":"Offer end date (ISO 8601)"},"start_datetime":{"type":"string","format":"date-time","description":"Offer start date (ISO 8601)"},"currency":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Currency derived from the active session"},"voucher_code":{"type":"string","nullable":true,"description":"Voucher/coupon code that can be entered in the basket to redeem the offer.\nFor `bulk_voucher_code` offers this is the user-specific code assigned to\nthe requester. For `voucher_code`/`coupon_code` offers this is the public\ncode of the offer."},"status":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Offer status. For `bulk_voucher_code` offers the status reflects the\nstatus of the user-specific bulk voucher code, not the parent offer.\nOne of `active`, `passive`, `used`, `revoked`."},"offer_type":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Offer type. Only voucher-like offers are returned by this endpoint:\n- `voucher_code` — single code valid for any user\n- `coupon_code` — code assigned to a specific user\n- `bulk_voucher_code` — user-specific code generated from a bulk pool"},"condition":{"type":"object","nullable":true,"description":"Offer condition (e.g. minimum basket amount/quantity). For query-based\nconditions, `value` holds the threshold extracted from the query (the\nmaximum `basket__get_total_product_amount__gte` value).","properties":{"type":{"type":"string","description":"Human readable condition type (e.g. \"Amount\", \"Quantity\", \"Query\")"},"value":{"type":"number","format":"decimal","nullable":true,"description":"Condition threshold value"}}},"benefit_type":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Benefit type:\n- `fixed` — fixed amount discount\n- `percentage` — percentage discount\n- `shipping_free` — free shipping\n- `sample_product` — sample product gift"}}},"EnumValue":{"type":"object","description":"Enum value (value + label pair)","required":["value","label"],"properties":{"value":{"type":"string","description":"Enum code value"},"label":{"type":"string","description":"Human readable label"}}}}}}
```

## The ApplicableDiscountCodesResponse object

```json
{"openapi":"3.0.3","info":{"title":"Basket API","version":"1.0.0"},"components":{"schemas":{"ApplicableDiscountCodesResponse":{"type":"object","description":"Response of the applicable discount codes endpoint. Contains the list of\nvoucher/coupon codes that the current user can apply to the current basket.","required":["voucher_codes"],"properties":{"voucher_codes":{"type":"array","description":"Voucher/coupon codes that are applicable to the current basket. Returns\nan empty list when the basket has no items or when no voucher-like offer\nsatisfies the basket conditions. Excludes the code currently applied to\nthe basket (if any).","items":{"$ref":"#/components/schemas/ApplicableVoucherCode"}}}},"ApplicableVoucherCode":{"type":"object","description":"Voucher/coupon code that is applicable to the current basket but not yet\napplied. Returned by the applicable discount codes endpoint so that the\nstorefront can render usable codes on the basket page.","required":["end_datetime","start_datetime","voucher_code","offer_type","benefit_type"],"properties":{"label":{"type":"string","maxLength":512,"nullable":true,"description":"Offer label (display name shown to the user)"},"amount":{"type":"number","format":"decimal","description":"Fixed discount amount (for `fixed` benefit type).\nReturns `0` for `percentage` or `shipping_free` benefit types."},"percentage":{"type":"number","format":"decimal","nullable":true,"description":"Percentage discount rate (for `percentage` benefit type).\nReturns `null` for `fixed` or `shipping_free` benefit types."},"end_datetime":{"type":"string","format":"date-time","description":"Offer end date (ISO 8601)"},"start_datetime":{"type":"string","format":"date-time","description":"Offer start date (ISO 8601)"},"currency":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Currency derived from the active session"},"voucher_code":{"type":"string","nullable":true,"description":"Voucher/coupon code that can be entered in the basket to redeem the offer.\nFor `bulk_voucher_code` offers this is the user-specific code assigned to\nthe requester. For `voucher_code`/`coupon_code` offers this is the public\ncode of the offer."},"status":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Offer status. For `bulk_voucher_code` offers the status reflects the\nstatus of the user-specific bulk voucher code, not the parent offer.\nOne of `active`, `passive`, `used`, `revoked`."},"offer_type":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Offer type. Only voucher-like offers are returned by this endpoint:\n- `voucher_code` — single code valid for any user\n- `coupon_code` — code assigned to a specific user\n- `bulk_voucher_code` — user-specific code generated from a bulk pool"},"condition":{"type":"object","nullable":true,"description":"Offer condition (e.g. minimum basket amount/quantity). For query-based\nconditions, `value` holds the threshold extracted from the query (the\nmaximum `basket__get_total_product_amount__gte` value).","properties":{"type":{"type":"string","description":"Human readable condition type (e.g. \"Amount\", \"Quantity\", \"Query\")"},"value":{"type":"number","format":"decimal","nullable":true,"description":"Condition threshold value"}}},"benefit_type":{"allOf":[{"$ref":"#/components/schemas/EnumValue"}],"description":"Benefit type:\n- `fixed` — fixed amount discount\n- `percentage` — percentage discount\n- `shipping_free` — free shipping\n- `sample_product` — sample product gift"}}},"EnumValue":{"type":"object","description":"Enum value (value + label pair)","required":["value","label"],"properties":{"value":{"type":"string","description":"Enum code value"},"label":{"type":"string","description":"Human readable label"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/basket/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
