# 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"]}}}}
```
