# Cart items

Manage Cart items

## Adding multiple products to cart

> Adds multiple products to the specified cart and creates cart items. The maximum batch size is 200.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["cart.cart_manage"]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"schemas":{"batchResponse":{"type":"array","description":"","items":{"$ref":"#/components/schemas/singleBatchResponse"}},"singleBatchResponse":{"description":"","type":"object","properties":{"index":{"type":"integer","description":"Index of the processed cart item, matching the position in the request body."},"status":{"type":"integer","description":"HTTP response status code."},"id":{"type":"string","minLength":1,"description":"Cart item's unique identifier."},"errorMessage":{"type":"string","description":"Descriptive error message for debugging purposes."},"headers":{"type":"object","properties":{"location":{"type":"string","minLength":1,"description":"Cart item location."}}},"yrn":{"$ref":"#/components/schemas/YRN"}},"required":["status"]},"YRN":{"type":"string","title":"YRN","description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.","minLength":1},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}},"cartItemsBatchRequest":{"type":"array","items":{"$ref":"#/components/schemas/cartItemRequest"}},"cartItemRequest":{"type":"object","properties":{"id":{"type":"string","description":"Cart item's unique identifier. "},"keepAsSeparateLineItem":{"type":"boolean","description":"Indicates that products are maintained as individual entries in the cart, rather than being consolidated. When identical products are added multiple times, each addition creates a new line item instead of increasing the quantity of an existing one."},"product":{"allOf":[{"$ref":"#/components/schemas/product"},{"type":"object","description":"Product details. This field is required when itemType is EXTERNAL and product does not exist in Emporix system."}]},"itemYrn":{"type":"string","title":"YRN","minLength":1,"description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant. This field should not be provided when itemType is EXTERNAL and request contains external product."},"externalFees":{"type":"array","items":{"$ref":"#/components/schemas/externalFee"}},"externalDiscounts":{"type":"array","description":"External discounts that should be applied to this cart item. Requires `cart.cart_manage_external_prices` scope","items":{"$ref":"#/components/schemas/externalDiscount"}},"itemType":{"allOf":[{"$ref":"#/components/schemas/itemType"},{"type":"object","description":"Optional field which allows fetching external prices if set to EXTERNAL."}]},"taxCode":{"description":"Tax code. Tax indicated in this field overrides the site's default tax value.","type":"string"},"quantity":{"type":"number","minimum":0,"format":"double","description":"Quantity of the product added to cart."},"price":{"$ref":"#/components/schemas/priceRowItem"},"tax":{"allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","description":"Tax information per unit. This field is only required when itemType is EXTERNAL and request contains external price. It's optional for the `INTERNAL` itemType.'"}]},"linePrice":{"description":"Externally calculated total line price (`unit price × quantity`). When provided, this overrides internal calculations.","properties":{"effectiveAmount":{"type":"number","minimum":0},"originalAmount":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["effectiveAmount","originalAmount","currency"]},"lineTax":{"allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","required":["netValue","grossValue","rate"]}],"description":"Externally calculated total tax for the item line. Only allowed when `itemType = EXTERNAL`."},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true},"weightDependent":{"type":"boolean","deprecated":true,"description":"Deprecated, use product `weightDependent` attribute that is stored in the database. \nIf set to `true`, the storefront displays a hint that the total price of the product may vary depending on the product’s actual weight.\n"}},"required":["quantity","price"]},"product":{"type":"object","description":"Product details.","properties":{"id":{"type":"string","description":"Product’s unique identifier. This field should be provided when itemType is EXTERNAl and request contains external product."},"sku":{"type":"string","description":"Product Stock Keeping Unit (SKU)."},"code":{"type":"string","description":"Product code."},"yrn":{"$ref":"#/components/schemas/YRN"},"name":{"type":"string","description":"Product name."},"localizedName":{"description":"A product name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string","description":"Product description."},"images":{"type":"array","description":"List of product images.","items":{"$ref":"#/components/schemas/productImage"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true}}},"productImage":{"type":"object","properties":{"id":{"type":"string","description":"Product image''s unique identifier, generated when the image is added through the Product Service."},"url":{"type":"string","description":"Product image's URL with the file extension specified."}},"required":["id","url"],"description":"Product image details."},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"externalFee":{"type":"object","required":["feeType"],"properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of fee as absolute. It must be provided when feeType equals `ABSOLUTE` or `ABSOLUTE_MULTIPLY_ITEMQUANTITY`.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Currency of fee absolute."},"amount":{"type":"number","description":"Value of fee absolute."}}},"taxable":{"type":"boolean","description":"Whether tax should be included to the fee or not."},"taxCode":{"type":"string","description":"Tax code of the fee."},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"rate":{"type":"number","description":"Rate of the tax."},"taxable":{"type":"number","description":"The taxable amount."},"value":{"type":"object","properties":{"currency":{"type":"string","description":"Currency of the tax."},"amount":{"type":"number","description":"Value of the tax."}}}}}}}},"localizedValue":{"description":"Localized value which can have different structure which depends on provided `Content-Language` header.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]},"externalDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"$ref":"#/components/schemas/externalDiscountType"},"value":{"type":"number","format":"double","minimum":0,"maximum":100,"description":"Value of the discount (percentage e.g 15.00 -> 15% or absolute amount e.g 10.00 -> 10 EUR depending on the discountType)."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount should be also applied to fees."},"sequence":{"type":"integer","description":"Sequence number determining the order in which discounts are applied. The lowest sequence number is applied first."}},"required":["id","discountType","value"]},"externalDiscountType":{"type":"string","description":"Type of the external discount.","enum":["PERCENT","ABSOLUTE"]},"itemType":{"type":"string","enum":["EXTERNAL","INTERNAL"]},"priceRowItem":{"type":"object","description":"Price details.","properties":{"priceId":{"type":"string","description":"Price’s unique identifier generated when the price is created through the Price Service. This field should not be provided when itemType is EXTERNAL."},"yrn":{"$ref":"#/components/schemas/YRN"},"originalAmount":{"minimum":0,"type":"number","format":"double","description":"Product’s regular price per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipOriginalAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"effectiveAmount":{"minimum":0,"type":"number","format":"double","description":"Actual amount the customer will pay per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipEffectiveAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard. Property can be made optional by setting `cartItemValidationSkipCurrency` configuration to `true` in the configuration-service. In that case, the value is fetched from cart currency."},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"}},"required":["priceId","originalAmount","effectiveAmount","currency"]},"measurementUnit":{"type":"object","description":"Information about the unit by which the customer can order the product.","properties":{"quantity":{"type":"number","minimum":0,"description":"Quantity of the measurement unit.\n\nFor example, if the customer can order a product by one piece, the value should be set to `1`.","format":"double"},"unitCode":{"description":"Code of the measurement unit by which the customer can order the product. The possible values for the `unitCode` field are explained in the table below:\n|     |     |\n| --- | --- |\n| **Value** | **Measurement unit** |\n| `H87` | Pieces |\n| `KGM` | Kilograms |\n| `GRM` | Grams |\n| `LTR` | Liters |\n| `MLT` | Milliliters |\n| `MTR` | Meters |\n| `RO` | Rolls |\n\nFor example, if the customer can order a product by pieces, the value should be set to `H87`.","enum":["kg","g","mg","l","ml","lb","qt","qtr","gal","pt","oz","MTR","XRO","MLT","LTR","H87","KGM","GRM","HLT","DL","DAG","RO"],"type":"string"}},"required":["quantity"]},"taxValue":{"type":"object","description":"The tax amount from an external source, requiring either gross amount, net amount, or both to be specified","properties":{"name":{"description":"Tax name. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","type":"string"},"rate":{"type":"number","description":"Tax rate based on which the net/gross values can be calculated. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","format":"double"},"grossValue":{"type":"number","description":"The gross value (amount including tax). If not provided, it's calculated based on the net value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."},"netValue":{"type":"number","description":"The net value (amount excluding tax). If not provided, it's calculated based on the gross value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/itemsBatch":{"post":{"responses":{"200":{"description":"The request was successful. Items have been added to the cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/batchResponse"}}}},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Adds multiple products to the specified cart and creates cart items. The maximum batch size is 200.","operationId":"POST-cart-add-multiple-items-to-cart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartItemsBatchRequest"}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Adding multiple products to cart","tags":["Cart items"]}}}}
```

## Updating multiple products in cart

> Updates multiple cart items in the specified cart. The maximum batch size is 50.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["cart.cart_manage"]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"schemas":{"cartItemsBatchUpdateResponse":{"type":"array","description":"Per-entry results for batch cart item updates.","items":{"$ref":"#/components/schemas/updateCartItemsBatchEntryResponse"}},"updateCartItemsBatchEntryResponse":{"title":"updateCartItemsBatchEntryResponse","type":"object","description":"Result for a single cart item in a batch update, aligned with bulk operation entry responses.","properties":{"index":{"type":"integer","description":"Index of the processed cart item, matching the position in the request body.\n"},"id":{"type":"string","description":"Cart item unique identifier."},"code":{"type":"integer","description":"HTTP status code for this entry."},"status":{"type":"string","description":"HTTP status description for this entry."},"message":{"type":"string","description":"Message describing the outcome or error for this entry."},"details":{"type":"array","description":"Additional detail messages for this entry.","items":{"type":"string"}}}},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}},"cartItemsBatchUpdateRequest":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/cartItemRequest"},{"type":"object","required":["id"]}]}},"cartItemRequest":{"type":"object","properties":{"id":{"type":"string","description":"Cart item's unique identifier. "},"keepAsSeparateLineItem":{"type":"boolean","description":"Indicates that products are maintained as individual entries in the cart, rather than being consolidated. When identical products are added multiple times, each addition creates a new line item instead of increasing the quantity of an existing one."},"product":{"allOf":[{"$ref":"#/components/schemas/product"},{"type":"object","description":"Product details. This field is required when itemType is EXTERNAL and product does not exist in Emporix system."}]},"itemYrn":{"type":"string","title":"YRN","minLength":1,"description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant. This field should not be provided when itemType is EXTERNAL and request contains external product."},"externalFees":{"type":"array","items":{"$ref":"#/components/schemas/externalFee"}},"externalDiscounts":{"type":"array","description":"External discounts that should be applied to this cart item. Requires `cart.cart_manage_external_prices` scope","items":{"$ref":"#/components/schemas/externalDiscount"}},"itemType":{"allOf":[{"$ref":"#/components/schemas/itemType"},{"type":"object","description":"Optional field which allows fetching external prices if set to EXTERNAL."}]},"taxCode":{"description":"Tax code. Tax indicated in this field overrides the site's default tax value.","type":"string"},"quantity":{"type":"number","minimum":0,"format":"double","description":"Quantity of the product added to cart."},"price":{"$ref":"#/components/schemas/priceRowItem"},"tax":{"allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","description":"Tax information per unit. This field is only required when itemType is EXTERNAL and request contains external price. It's optional for the `INTERNAL` itemType.'"}]},"linePrice":{"description":"Externally calculated total line price (`unit price × quantity`). When provided, this overrides internal calculations.","properties":{"effectiveAmount":{"type":"number","minimum":0},"originalAmount":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["effectiveAmount","originalAmount","currency"]},"lineTax":{"allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","required":["netValue","grossValue","rate"]}],"description":"Externally calculated total tax for the item line. Only allowed when `itemType = EXTERNAL`."},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true},"weightDependent":{"type":"boolean","deprecated":true,"description":"Deprecated, use product `weightDependent` attribute that is stored in the database. \nIf set to `true`, the storefront displays a hint that the total price of the product may vary depending on the product’s actual weight.\n"}},"required":["quantity","price"]},"product":{"type":"object","description":"Product details.","properties":{"id":{"type":"string","description":"Product’s unique identifier. This field should be provided when itemType is EXTERNAl and request contains external product."},"sku":{"type":"string","description":"Product Stock Keeping Unit (SKU)."},"code":{"type":"string","description":"Product code."},"yrn":{"$ref":"#/components/schemas/YRN"},"name":{"type":"string","description":"Product name."},"localizedName":{"description":"A product name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string","description":"Product description."},"images":{"type":"array","description":"List of product images.","items":{"$ref":"#/components/schemas/productImage"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true}}},"YRN":{"type":"string","title":"YRN","description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.","minLength":1},"productImage":{"type":"object","properties":{"id":{"type":"string","description":"Product image''s unique identifier, generated when the image is added through the Product Service."},"url":{"type":"string","description":"Product image's URL with the file extension specified."}},"required":["id","url"],"description":"Product image details."},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"externalFee":{"type":"object","required":["feeType"],"properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of fee as absolute. It must be provided when feeType equals `ABSOLUTE` or `ABSOLUTE_MULTIPLY_ITEMQUANTITY`.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Currency of fee absolute."},"amount":{"type":"number","description":"Value of fee absolute."}}},"taxable":{"type":"boolean","description":"Whether tax should be included to the fee or not."},"taxCode":{"type":"string","description":"Tax code of the fee."},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"rate":{"type":"number","description":"Rate of the tax."},"taxable":{"type":"number","description":"The taxable amount."},"value":{"type":"object","properties":{"currency":{"type":"string","description":"Currency of the tax."},"amount":{"type":"number","description":"Value of the tax."}}}}}}}},"localizedValue":{"description":"Localized value which can have different structure which depends on provided `Content-Language` header.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]},"externalDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"$ref":"#/components/schemas/externalDiscountType"},"value":{"type":"number","format":"double","minimum":0,"maximum":100,"description":"Value of the discount (percentage e.g 15.00 -> 15% or absolute amount e.g 10.00 -> 10 EUR depending on the discountType)."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount should be also applied to fees."},"sequence":{"type":"integer","description":"Sequence number determining the order in which discounts are applied. The lowest sequence number is applied first."}},"required":["id","discountType","value"]},"externalDiscountType":{"type":"string","description":"Type of the external discount.","enum":["PERCENT","ABSOLUTE"]},"itemType":{"type":"string","enum":["EXTERNAL","INTERNAL"]},"priceRowItem":{"type":"object","description":"Price details.","properties":{"priceId":{"type":"string","description":"Price’s unique identifier generated when the price is created through the Price Service. This field should not be provided when itemType is EXTERNAL."},"yrn":{"$ref":"#/components/schemas/YRN"},"originalAmount":{"minimum":0,"type":"number","format":"double","description":"Product’s regular price per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipOriginalAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"effectiveAmount":{"minimum":0,"type":"number","format":"double","description":"Actual amount the customer will pay per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipEffectiveAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard. Property can be made optional by setting `cartItemValidationSkipCurrency` configuration to `true` in the configuration-service. In that case, the value is fetched from cart currency."},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"}},"required":["priceId","originalAmount","effectiveAmount","currency"]},"measurementUnit":{"type":"object","description":"Information about the unit by which the customer can order the product.","properties":{"quantity":{"type":"number","minimum":0,"description":"Quantity of the measurement unit.\n\nFor example, if the customer can order a product by one piece, the value should be set to `1`.","format":"double"},"unitCode":{"description":"Code of the measurement unit by which the customer can order the product. The possible values for the `unitCode` field are explained in the table below:\n|     |     |\n| --- | --- |\n| **Value** | **Measurement unit** |\n| `H87` | Pieces |\n| `KGM` | Kilograms |\n| `GRM` | Grams |\n| `LTR` | Liters |\n| `MLT` | Milliliters |\n| `MTR` | Meters |\n| `RO` | Rolls |\n\nFor example, if the customer can order a product by pieces, the value should be set to `H87`.","enum":["kg","g","mg","l","ml","lb","qt","qtr","gal","pt","oz","MTR","XRO","MLT","LTR","H87","KGM","GRM","HLT","DL","DAG","RO"],"type":"string"}},"required":["quantity"]},"taxValue":{"type":"object","description":"The tax amount from an external source, requiring either gross amount, net amount, or both to be specified","properties":{"name":{"description":"Tax name. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","type":"string"},"rate":{"type":"number","description":"Tax rate based on which the net/gross values can be calculated. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","format":"double"},"grossValue":{"type":"number","description":"The gross value (amount including tax). If not provided, it's calculated based on the net value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."},"netValue":{"type":"number","description":"The net value (amount excluding tax). If not provided, it's calculated based on the gross value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"cartId":{"name":"cartId","in":"path","required":true,"schema":{"type":"string"},"description":"Cart unique identifier generated when a cart is created."},"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/itemsBatch":{"put":{"responses":{"207":{"description":"The request was successful. Items have been updated in the cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartItemsBatchUpdateResponse"}}}},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Updates multiple cart items in the specified cart. The maximum batch size is 50.","operationId":"PUT-cart-update-multiple-items-in-cart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartItemsBatchUpdateRequest"}}},"required":false},"summary":"Updating multiple products in cart","tags":["Cart items"],"parameters":[{"$ref":"#/components/parameters/cartId"},{"$ref":"#/components/parameters/trait_tenant"}]}}}}
```

## Retrieving all products added to a cart

> Retrieves all items added to the specified cart.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["cart.cart_manage"]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"schemas":{"cartItemsResponse":{"type":"array","items":{"$ref":"#/components/schemas/cartItemResponse"},"description":"Array of cart items with their details."},"cartItemResponse":{"description":"Cart item details.","allOf":[{"$ref":"#/components/schemas/baseCartItemResponse"},{"type":"object","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/priceRow"},{"type":"object","description":"**This field is deprecated**. Please use `unitPrice` instead. The `unitPrice` field provides the same value with updated functionality."}],"deprecated":true},"linePrice":{"description":"Externally calculated total line price (`unit price × quantity`). When provided, this overrides internal calculations.","properties":{"effectiveAmount":{"type":"number","minimum":0},"originalAmount":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["effectiveAmount","originalAmount","currency"]},"lineTax":{"allOf":[{"$ref":"#/components/schemas/taxValueWithQuantity"}],"description":"Externally calculated total tax for the item line. Only allowed when `itemType = EXTERNAL`.","required":["netValue","grossValue","rate","quantity"]},"couponDiscounts":{"allOf":[{"$ref":"#/components/schemas/couponDiscounts"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalDiscounts.appliedDiscounts` instead. The `calculatedPrice.totalDiscount.appliedDiscounts` field provides the same value with updated functionality."}],"deprecated":true},"itemPrice":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `unitPrice` instead. The `unitPrice` field provides the same value with updated functionality."}],"deprecated":true},"itemTaxInfo":{"type":"array","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedPrice.price` instead.","items":{"$ref":"#/components/schemas/taxValue"}},"fees":{"allOf":[{"$ref":"#/components/schemas/feeAggregate"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.fees` instead. The `calculatedPrice.fees` field provides the same value with updated functionality."}],"deprecated":true},"authorizedAmount":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much should be payment authorization increased for given item."}],"deprecated":true},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."}],"deprecated":true},"externalFees":{"type":"array","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedPrice.fees` instead. A fee has an enum value that allows to distinguish external prices","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["quantity","effectiveQuantity"]}]},"baseCartItemResponse":{"type":"object","properties":{"id":{"type":"string","description":"Cart item's unique identifier generated when the item is added to cart."},"keepAsSeparateLineItem":{"type":"boolean","description":"Indicates that products are maintained as individual entries in the cart, rather than being consolidated. When identical products are added multiple times, each addition creates a new line item instead of increasing the quantity of an existing one."},"yrn":{"$ref":"#/components/schemas/YRN"},"product":{"$ref":"#/components/schemas/cartItemResponseProduct"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"type":{"$ref":"#/components/schemas/itemType"},"quantity":{"type":"number","minimum":0,"format":"double","description":"Quantity of the product added to cart."},"effectiveQuantity":{"type":"number","minimum":0,"format":"double","description":"Effective quantity of the product added to cart."},"calculatedPrice":{"$ref":"#/components/schemas/itemCalculatedPrice"},"taxCode":{"description":"Tax code. Tax indicated in this field overrides the site's default tax value.","type":"string"},"unitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product unit price with tax values"}]},"totalTax":{"type":"number","minimum":0,"description":"Product total tax amount.","format":"double"},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","additionalProperties":true},"externalDiscounts":{"type":"array","description":"External discounts applied to this cart item.","items":{"$ref":"#/components/schemas/externalDiscount"}}},"required":["quantity","effectiveQuantity"],"description":"Cart item details."},"YRN":{"type":"string","title":"YRN","description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.","minLength":1},"cartItemResponseProduct":{"allOf":[{"$ref":"#/components/schemas/product"},{"type":"object","properties":{"vendor":{"$ref":"#/components/schemas/vendor"}}}]},"product":{"type":"object","description":"Product details.","properties":{"id":{"type":"string","description":"Product’s unique identifier. This field should be provided when itemType is EXTERNAl and request contains external product."},"sku":{"type":"string","description":"Product Stock Keeping Unit (SKU)."},"code":{"type":"string","description":"Product code."},"yrn":{"$ref":"#/components/schemas/YRN"},"name":{"type":"string","description":"Product name."},"localizedName":{"description":"A product name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string","description":"Product description."},"images":{"type":"array","description":"List of product images.","items":{"$ref":"#/components/schemas/productImage"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true}}},"productImage":{"type":"object","properties":{"id":{"type":"string","description":"Product image''s unique identifier, generated when the image is added through the Product Service."},"url":{"type":"string","description":"Product image's URL with the file extension specified."}},"required":["id","url"],"description":"Product image details."},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"vendor":{"type":"object","description":"Product vendor information, autopopulated based on product catalog information.","properties":{"id":{"type":"string","description":"An identifier of a vendor to whom the product belongs"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"itemType":{"type":"string","enum":["EXTERNAL","INTERNAL"]},"itemCalculatedPrice":{"type":"object","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The price is calculated by multiplying the unit price (taken from priceMatch) by the quantity."},{"properties":{"calculated":{"type":"string","description":"Indicates how the line item price was determined. - `INTERNAL` — Calculated by Emporix using unit price × quantity. - `EXTERNAL` — Provided externally with `lineTax`.","enum":["INTERNAL","EXTERNAL"]}}}]},"upliftValue":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Maximum additional amount authorized for payment to cover potential price adjustments during packaging of weight-based products. For example, if the item’s `price.netValue=12`, the `upliftValue.netValue=1,2`, with 10% uplift configured. If the uplift value is not configured for an item, it's not returned in the response.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the uplift amount, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the uplift amount, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the uplift amount, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to uplift amount, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the uplift amount, it's the percentage at which an individual or business is taxed."}}}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total price for the item line calculated by multiplying the unit price by the quantity, with applied discounts. If there are no applied discounts to the given line item, the attribute is not returned in the response.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts, calculated if `includesTax=false`."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts, calculated if `includesTax=true`."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the discounted price, it's the percentage at which an individual or business is taxed."},"taxCode":{"type":"string","description":"Tax code applied to the discounted price, a tax code is a country's set of tax rules."},"appliedDiscounts":{"type":"array","description":"A list of discounts applied to the line item.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"Value of the discount that was applied."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for amount applied to the line item."}}}]}}}}]},"fees":{"type":"array","description":"A list of fees applied to the line item. If there are no fees on the item line, it's not returned in the response.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedFee"},{"type":"object","properties":{"id":{"type":"string","description":"Fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"PERCENT for fee percentage of the item's line `price.netValue` - unit price x quantity. ABSOLUTE for the absolute amount assigned to the item line. ABSOLUTE_MULTIPLY_ITEMQUANTITY for the monetary amount multiplied by the item quantity and assigned to the item line."},"origin":{"enum":["INTERNAL","EXTERNAL"],"type":"string","description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the cart."},"name":{"type":"object","description":"Fee name."},"price":{"description":"The calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"Monetary amount of the fee, depends on the fee type."},"grossValue":{"type":"number","format":"double","description":"Value calculated based on the `taxCode` and the `taxRate` if `taxable=true`."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the provided `taxCode` at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"Tax code defined on the fee level, for example STANDARD. The value should match the available tax codes in the system configuration."},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total price for the item line calculated by multiplying the unit price by the quantity, with applied discounts. If there are no applied discounts to the given line item, the attribute is not returned in the response.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts, calculated if `includesTax=false`."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts, calculated if `includesTax=true`."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxRate":{"type":"number","format":"double","description":"Refers to `fees[].price.taxRate`."},"taxCode":{"type":"string","description":"Refers to `fees[].price.taxCode`."},"appliedDiscounts":{"type":"array","description":"A list of discounts applied to the line item.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"Monetary amount of the discount applied to the price for the given discount ID."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for amount applied to the line item."}}}]}}}}]}}}}}]}},"totalFee":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"Sum of all fees applied to the item. It's calculated by summarizing `fees[].discountedPrice` if any discounts were applied to the fee, or `fees[].price` for an pre-discounted fee. If there are no fees applied to the line item, it's not returned in the response. The `totalFee` is the value after all the discounts, if any discounts were applied.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price, price without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price, price with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If all fees have the same `taxCode` defined, which results in the same `taxRate`, then the value is present. Otherwise, the field is not returned."},"taxCode":{"type":"string","description":"If all fees have the same `taxCode`, then the value is present. Otherwise, the field is not returned."},"appliedDiscounts":{"type":"array","description":"A list of discounts applied to the line item.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"Sum of all `fees[].discountedPrice.appliedDiscounts[].value` grouped by `discount.id`"},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for amount applied to the line item."}}}]}}}}]},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/calculatedTotalDiscount"},{"type":"object","description":"A summary of all discounts applied to the line, including discounts on both the line item's price and its fees. If there are no discounts applied on to the line item, it's not returned in the response.","properties":{"calculationType":{"type":"string","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"],"description":"Indicates whether discounts were applied to net or gross values."},"value":{"type":"number","format":"double","description":"Aggregated sum of `lines[].calculatedPrice.totalDiscount.value` plus the sum of shipping discounts `totalShipping.appliedDiscounts[].value`."},"appliedDiscounts":{"type":"array","description":"A list of the applied discounts.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"The sum of `discountedPrice.appliedDiscounts[].value` and `fees[].discountedPrice.appliedDiscounts[].value`."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for monetary amount."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The final price is the sum of the `discountedPrice` or the original price, depending on whether any discounts were applied to the line item, and the `totalFee`, which includes all fees applied to the line item. Since the total fee already includes the discounted prices of fees, the sum is calculated at the `totalFee` level.","properties":{"netValue":{"type":"number","format":"double","description":"The sum of line items, `discountedPrice.netValue` or `price.netValue`, and `totalFee.netValue`."},"grossValue":{"type":"number","format":"double","description":"The sum of line items, `discountedPrice.grossValue` or `price.grossValue`, and `totalFee.grossValue`."},"taxValue":{"type":"number","format":"double","description":"The result of subtracting `netValue` and `grossValue`, which is equal to the sum of all `taxValues` from the prices."},"taxRate":{"type":"number","format":"double","description":"If the tax code of the line item matches the tax code of all applied fees, the tax rate is populated with the value. Otherwise, it's not returned in the response."},"taxCode":{"type":"string","description":"The common tax code of the line item and all applicable fees. If at least one fee does not have a defined tax code, the common tax code cannot be determined, and the field is empty."}}}],"description":"Detailed price calculation for a single line item with all pricing components."}}},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price, price without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price, price with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to the price, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price, it's the percentage at which an individual or business is taxed."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details."},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","description":"List of applied discounts for the calculated price.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}},"description":"A price calculation model showing the final amount after applying discounts."}]},"calculatedAppliedDiscount":{"title":"calculatedAppliedDiscount","type":"object","properties":{"id":{"type":"string","description":"The ID of the applied discount."},"value":{"type":"number","format":"double","description":"The calculated value of the discount."},"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Applied discount's price. When discount is applied before tax the value equals `price.netValue` and `price.grossValue` for discount applied after tax."}]},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"The discount type which shows how the discount was calculated. PERCENT refers to a percentage discount for example 10%. ABSOLUTE is a monetary amount."},"origin":{"type":"string","enum":["INTERNAL","EXTERNAL"],"description":"Indicates whether the discount is from internal coupon (INTERNAL) or external discount (EXTERNAL)."}}},"calculatedFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"origin":{"enum":["INTERNAL","EXTERNAL"],"type":"string","description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the cart"},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The calculated fee price."}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The discounted fee value."}]}}},"calculatedTotalDiscount":{"title":"calculatedTotalDiscount","type":"object","description":"The total combined value of all applied discounts.","properties":{"calculationType":{"type":"string","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"],"description":"Indicates whether discounts were calculated using net or gross price values."},"value":{"type":"number","format":"double","description":"The calculated amount of all discounts."},"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Total discounts price. When discounts are applied before tax the value equals `price.netValue` and `price.grossValue` for discounts applied after tax."}]},"appliedDiscounts":{"type":"array","description":"All applied discounts that are parts of the sum. Sum of all `discountedPrice.appliedDiscounts[].value` and `fees[].discountedPrice.appliedDiscounts[].value`.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"externalDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"$ref":"#/components/schemas/externalDiscountType"},"value":{"type":"number","format":"double","minimum":0,"maximum":100,"description":"Value of the discount (percentage e.g 15.00 -> 15% or absolute amount e.g 10.00 -> 10 EUR depending on the discountType)."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount should be also applied to fees."},"sequence":{"type":"integer","description":"Sequence number determining the order in which discounts are applied. The lowest sequence number is applied first."}},"required":["id","discountType","value"]},"externalDiscountType":{"type":"string","description":"Type of the external discount.","enum":["PERCENT","ABSOLUTE"]},"priceRow":{"type":"object","description":"Price details.","properties":{"priceId":{"type":"string","description":"Price’s unique identifier generated when the price is created through the Price Service."},"priceListId":{"type":"string","description":"Identifier of price list. The field is populated only in case when the returned prices belongs to any price list."},"yrn":{"$ref":"#/components/schemas/YRN"},"originalAmount":{"minimum":0,"type":"number","format":"double","description":"Product’s regular price per specified `measurementUnit`."},"effectiveAmount":{"minimum":0,"type":"number","format":"double","description":"Actual amount the customer will pay per specified `measurementUnit`."},"currency":{"type":"string","pattern":"[A-Z]{3}","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard."},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"}},"required":["priceId","originalAmount","effectiveAmount","currency"]},"measurementUnit":{"type":"object","description":"Information about the unit by which the customer can order the product.","properties":{"quantity":{"type":"number","minimum":0,"description":"Quantity of the measurement unit.\n\nFor example, if the customer can order a product by one piece, the value should be set to `1`.","format":"double"},"unitCode":{"description":"Code of the measurement unit by which the customer can order the product. The possible values for the `unitCode` field are explained in the table below:\n|     |     |\n| --- | --- |\n| **Value** | **Measurement unit** |\n| `H87` | Pieces |\n| `KGM` | Kilograms |\n| `GRM` | Grams |\n| `LTR` | Liters |\n| `MLT` | Milliliters |\n| `MTR` | Meters |\n| `RO` | Rolls |\n\nFor example, if the customer can order a product by pieces, the value should be set to `H87`.","enum":["kg","g","mg","l","ml","lb","qt","qtr","gal","pt","oz","MTR","XRO","MLT","LTR","H87","KGM","GRM","HLT","DL","DAG","RO"],"type":"string"}},"required":["quantity"]},"taxValueWithQuantity":{"type":"object","allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","properties":{"quantity":{"type":"number","description":"Represents the item quantity for which the external `lineTax` was provided."}}}],"required":["rate","grossValue","netValue"]},"taxValue":{"type":"object","description":"The tax amount from an external source, requiring either gross amount, net amount, or both to be specified","properties":{"name":{"description":"Tax name. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","type":"string"},"rate":{"type":"number","description":"Tax rate based on which the net/gross values can be calculated. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","format":"double"},"grossValue":{"type":"number","description":"The gross value (amount including tax). If not provided, it's calculated based on the net value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."},"netValue":{"type":"number","description":"The net value (amount excluding tax). If not provided, it's calculated based on the gross value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."}}},"couponDiscounts":{"type":"array","description":"Collection of couponId-value pairs indicating how much particular coupon lowered absolute price of given item. Coupons of FREE_SHIPPING discount type are not taken into account.","items":{"$ref":"#/components/schemas/couponDiscount"}},"couponDiscount":{"type":"object","properties":{"couponId":{"type":"string","description":"ID of coupon."},"value":{"type":"number","description":"Absolute value indicating how much given coupon lowered the price of given item."}}},"price":{"type":"object","properties":{"amount":{"type":"number","minimum":0,"format":"double","description":"Price."},"currency":{"type":"string","pattern":"[A-Z]{3}","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard."}},"required":["amount","currency"],"description":""},"feeAggregate":{"type":"object","properties":{"elements":{"description":"","type":"array","items":{"$ref":"#/components/schemas/fee"}},"total":{"$ref":"#/components/schemas/total"}}},"fee":{"title":"fee","type":"object","properties":{"yrn":{"$ref":"#/components/schemas/YRN"},"name":{"$ref":"#/components/schemas/localizedValue"},"taxCode":{"type":"string"},"amount":{"type":"number","format":"double","minimum":0,"description":""},"totalTax":{"type":"number","format":"double","minimum":0},"total":{"$ref":"#/components/schemas/total"},"taxValues":{"type":"array","items":{"$ref":"#/components/schemas/taxValue"}}},"required":["amount","totalTax","total"]},"localizedValue":{"description":"Localized value which can have different structure which depends on provided `Content-Language` header.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]},"total":{"type":"object","properties":{"subTotal":{"type":"number","description":"Subtotal for the products."},"totalTax":{"type":"number","description":"Total tax for the products."},"total":{"type":"number","description":"Total amount the customer will pay for the products."},"discount":{"type":"number","description":"Total discount for the products"}}},"externalFee":{"type":"object","required":["feeType"],"properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of fee as absolute. It must be provided when feeType equals `ABSOLUTE` or `ABSOLUTE_MULTIPLY_ITEMQUANTITY`.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Currency of fee absolute."},"amount":{"type":"number","description":"Value of fee absolute."}}},"taxable":{"type":"boolean","description":"Whether tax should be included to the fee or not."},"taxCode":{"type":"string","description":"Tax code of the fee."},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"rate":{"type":"number","description":"Rate of the tax."},"taxable":{"type":"number","description":"The taxable amount."},"value":{"type":"object","properties":{"currency":{"type":"string","description":"Currency of the tax."},"amount":{"type":"number","description":"Value of the tax."}}}}}}}},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/items":{"get":{"responses":{"200":{"description":"The request was successful. Cart items details are returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartItemsResponse"}}}},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Retrieves all items added to the specified cart.","operationId":"GET-cart-list-cart-items","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Retrieving all products added to a cart","tags":["Cart items"]}}}}
```

## Adding a product to cart

> Adds a product to the specified cart and creates a cart item.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]},{"OAuth2":["cart.cart_manage","cart.cart_manage_external_prices"]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer"},"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}}},"schemas":{"createdCartItem":{"type":"object","properties":{"itemId":{"type":"string","description":"Cart item unique identifier."},"yrn":{"$ref":"#/components/schemas/YRN"}},"required":["itemId","yrn"],"description":""},"YRN":{"type":"string","title":"YRN","description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.","minLength":1},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}},"cartItemRequest":{"type":"object","properties":{"id":{"type":"string","description":"Cart item's unique identifier. "},"keepAsSeparateLineItem":{"type":"boolean","description":"Indicates that products are maintained as individual entries in the cart, rather than being consolidated. When identical products are added multiple times, each addition creates a new line item instead of increasing the quantity of an existing one."},"product":{"allOf":[{"$ref":"#/components/schemas/product"},{"type":"object","description":"Product details. This field is required when itemType is EXTERNAL and product does not exist in Emporix system."}]},"itemYrn":{"type":"string","title":"YRN","minLength":1,"description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant. This field should not be provided when itemType is EXTERNAL and request contains external product."},"externalFees":{"type":"array","items":{"$ref":"#/components/schemas/externalFee"}},"externalDiscounts":{"type":"array","description":"External discounts that should be applied to this cart item. Requires `cart.cart_manage_external_prices` scope","items":{"$ref":"#/components/schemas/externalDiscount"}},"itemType":{"allOf":[{"$ref":"#/components/schemas/itemType"},{"type":"object","description":"Optional field which allows fetching external prices if set to EXTERNAL."}]},"taxCode":{"description":"Tax code. Tax indicated in this field overrides the site's default tax value.","type":"string"},"quantity":{"type":"number","minimum":0,"format":"double","description":"Quantity of the product added to cart."},"price":{"$ref":"#/components/schemas/priceRowItem"},"tax":{"allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","description":"Tax information per unit. This field is only required when itemType is EXTERNAL and request contains external price. It's optional for the `INTERNAL` itemType.'"}]},"linePrice":{"description":"Externally calculated total line price (`unit price × quantity`). When provided, this overrides internal calculations.","properties":{"effectiveAmount":{"type":"number","minimum":0},"originalAmount":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["effectiveAmount","originalAmount","currency"]},"lineTax":{"allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","required":["netValue","grossValue","rate"]}],"description":"Externally calculated total tax for the item line. Only allowed when `itemType = EXTERNAL`."},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true},"weightDependent":{"type":"boolean","deprecated":true,"description":"Deprecated, use product `weightDependent` attribute that is stored in the database. \nIf set to `true`, the storefront displays a hint that the total price of the product may vary depending on the product’s actual weight.\n"}},"required":["quantity","price"]},"product":{"type":"object","description":"Product details.","properties":{"id":{"type":"string","description":"Product’s unique identifier. This field should be provided when itemType is EXTERNAl and request contains external product."},"sku":{"type":"string","description":"Product Stock Keeping Unit (SKU)."},"code":{"type":"string","description":"Product code."},"yrn":{"$ref":"#/components/schemas/YRN"},"name":{"type":"string","description":"Product name."},"localizedName":{"description":"A product name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string","description":"Product description."},"images":{"type":"array","description":"List of product images.","items":{"$ref":"#/components/schemas/productImage"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true}}},"productImage":{"type":"object","properties":{"id":{"type":"string","description":"Product image''s unique identifier, generated when the image is added through the Product Service."},"url":{"type":"string","description":"Product image's URL with the file extension specified."}},"required":["id","url"],"description":"Product image details."},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"externalFee":{"type":"object","required":["feeType"],"properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of fee as absolute. It must be provided when feeType equals `ABSOLUTE` or `ABSOLUTE_MULTIPLY_ITEMQUANTITY`.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Currency of fee absolute."},"amount":{"type":"number","description":"Value of fee absolute."}}},"taxable":{"type":"boolean","description":"Whether tax should be included to the fee or not."},"taxCode":{"type":"string","description":"Tax code of the fee."},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"rate":{"type":"number","description":"Rate of the tax."},"taxable":{"type":"number","description":"The taxable amount."},"value":{"type":"object","properties":{"currency":{"type":"string","description":"Currency of the tax."},"amount":{"type":"number","description":"Value of the tax."}}}}}}}},"localizedValue":{"description":"Localized value which can have different structure which depends on provided `Content-Language` header.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]},"externalDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"$ref":"#/components/schemas/externalDiscountType"},"value":{"type":"number","format":"double","minimum":0,"maximum":100,"description":"Value of the discount (percentage e.g 15.00 -> 15% or absolute amount e.g 10.00 -> 10 EUR depending on the discountType)."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount should be also applied to fees."},"sequence":{"type":"integer","description":"Sequence number determining the order in which discounts are applied. The lowest sequence number is applied first."}},"required":["id","discountType","value"]},"externalDiscountType":{"type":"string","description":"Type of the external discount.","enum":["PERCENT","ABSOLUTE"]},"itemType":{"type":"string","enum":["EXTERNAL","INTERNAL"]},"priceRowItem":{"type":"object","description":"Price details.","properties":{"priceId":{"type":"string","description":"Price’s unique identifier generated when the price is created through the Price Service. This field should not be provided when itemType is EXTERNAL."},"yrn":{"$ref":"#/components/schemas/YRN"},"originalAmount":{"minimum":0,"type":"number","format":"double","description":"Product’s regular price per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipOriginalAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"effectiveAmount":{"minimum":0,"type":"number","format":"double","description":"Actual amount the customer will pay per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipEffectiveAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard. Property can be made optional by setting `cartItemValidationSkipCurrency` configuration to `true` in the configuration-service. In that case, the value is fetched from cart currency."},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"}},"required":["priceId","originalAmount","effectiveAmount","currency"]},"measurementUnit":{"type":"object","description":"Information about the unit by which the customer can order the product.","properties":{"quantity":{"type":"number","minimum":0,"description":"Quantity of the measurement unit.\n\nFor example, if the customer can order a product by one piece, the value should be set to `1`.","format":"double"},"unitCode":{"description":"Code of the measurement unit by which the customer can order the product. The possible values for the `unitCode` field are explained in the table below:\n|     |     |\n| --- | --- |\n| **Value** | **Measurement unit** |\n| `H87` | Pieces |\n| `KGM` | Kilograms |\n| `GRM` | Grams |\n| `LTR` | Liters |\n| `MLT` | Milliliters |\n| `MTR` | Meters |\n| `RO` | Rolls |\n\nFor example, if the customer can order a product by pieces, the value should be set to `H87`.","enum":["kg","g","mg","l","ml","lb","qt","qtr","gal","pt","oz","MTR","XRO","MLT","LTR","H87","KGM","GRM","HLT","DL","DAG","RO"],"type":"string"}},"required":["quantity"]},"taxValue":{"type":"object","description":"The tax amount from an external source, requiring either gross amount, net amount, or both to be specified","properties":{"name":{"description":"Tax name. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","type":"string"},"rate":{"type":"number","description":"Tax rate based on which the net/gross values can be calculated. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","format":"double"},"grossValue":{"type":"number","description":"The gross value (amount including tax). If not provided, it's calculated based on the net value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."},"netValue":{"type":"number","description":"The net value (amount excluding tax). If not provided, it's calculated based on the gross value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_conflict_409":{"description":"The request could not be completed due to a conflict with the current state of the target resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/items":{"post":{"responses":{"201":{"description":"The request was successful. The product has been added to the cart.","headers":{"Location":{"description":"Location of the newly created cart item.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createdCartItem"}}}},"400":{"$ref":"#/components/responses/trait_400"},"401":{"$ref":"#/components/responses/trait_401"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"409":{"$ref":"#/components/responses/trait_conflict_409"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Adds a product to the specified cart and creates a cart item.","operationId":"POST-cart-add-item-to-cart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartItemRequest"}}},"required":false,"description":""},"parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"schema":{"type":"string"},"in":"query","name":"siteCode","description":"Site unique identifier. A site is a specific shop. \n\nIf the tenant owns only one shop, the value should be set to `main`.\n","required":true}],"summary":"Adding a product to cart","tags":["Cart items"]}}}}
```

## Deleting all products added to a cart

> Removes all products from the specified cart and deletes the cart items.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["cart.cart_manage"]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/items":{"delete":{"responses":{"204":{"description":"The request was successful. Products have been deleted from the cart."},"400":{"$ref":"#/components/responses/trait_400"},"401":{"$ref":"#/components/responses/trait_401"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Removes all products from the specified cart and deletes the cart items.","operationId":"DELETE-cart-remove-items-from-cart","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Deleting all products added to a cart","tags":["Cart items"]}}}}
```

## Retrieving a cart item

> Retrieves a specified cart item's details.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["cart.cart_manage"]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"schemas":{"cartItemResponse":{"description":"Cart item details.","allOf":[{"$ref":"#/components/schemas/baseCartItemResponse"},{"type":"object","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/priceRow"},{"type":"object","description":"**This field is deprecated**. Please use `unitPrice` instead. The `unitPrice` field provides the same value with updated functionality."}],"deprecated":true},"linePrice":{"description":"Externally calculated total line price (`unit price × quantity`). When provided, this overrides internal calculations.","properties":{"effectiveAmount":{"type":"number","minimum":0},"originalAmount":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["effectiveAmount","originalAmount","currency"]},"lineTax":{"allOf":[{"$ref":"#/components/schemas/taxValueWithQuantity"}],"description":"Externally calculated total tax for the item line. Only allowed when `itemType = EXTERNAL`.","required":["netValue","grossValue","rate","quantity"]},"couponDiscounts":{"allOf":[{"$ref":"#/components/schemas/couponDiscounts"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalDiscounts.appliedDiscounts` instead. The `calculatedPrice.totalDiscount.appliedDiscounts` field provides the same value with updated functionality."}],"deprecated":true},"itemPrice":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `unitPrice` instead. The `unitPrice` field provides the same value with updated functionality."}],"deprecated":true},"itemTaxInfo":{"type":"array","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedPrice.price` instead.","items":{"$ref":"#/components/schemas/taxValue"}},"fees":{"allOf":[{"$ref":"#/components/schemas/feeAggregate"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.fees` instead. The `calculatedPrice.fees` field provides the same value with updated functionality."}],"deprecated":true},"authorizedAmount":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much should be payment authorization increased for given item."}],"deprecated":true},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."}],"deprecated":true},"externalFees":{"type":"array","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedPrice.fees` instead. A fee has an enum value that allows to distinguish external prices","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["quantity","effectiveQuantity"]}]},"baseCartItemResponse":{"type":"object","properties":{"id":{"type":"string","description":"Cart item's unique identifier generated when the item is added to cart."},"keepAsSeparateLineItem":{"type":"boolean","description":"Indicates that products are maintained as individual entries in the cart, rather than being consolidated. When identical products are added multiple times, each addition creates a new line item instead of increasing the quantity of an existing one."},"yrn":{"$ref":"#/components/schemas/YRN"},"product":{"$ref":"#/components/schemas/cartItemResponseProduct"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"type":{"$ref":"#/components/schemas/itemType"},"quantity":{"type":"number","minimum":0,"format":"double","description":"Quantity of the product added to cart."},"effectiveQuantity":{"type":"number","minimum":0,"format":"double","description":"Effective quantity of the product added to cart."},"calculatedPrice":{"$ref":"#/components/schemas/itemCalculatedPrice"},"taxCode":{"description":"Tax code. Tax indicated in this field overrides the site's default tax value.","type":"string"},"unitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product unit price with tax values"}]},"totalTax":{"type":"number","minimum":0,"description":"Product total tax amount.","format":"double"},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","additionalProperties":true},"externalDiscounts":{"type":"array","description":"External discounts applied to this cart item.","items":{"$ref":"#/components/schemas/externalDiscount"}}},"required":["quantity","effectiveQuantity"],"description":"Cart item details."},"YRN":{"type":"string","title":"YRN","description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.","minLength":1},"cartItemResponseProduct":{"allOf":[{"$ref":"#/components/schemas/product"},{"type":"object","properties":{"vendor":{"$ref":"#/components/schemas/vendor"}}}]},"product":{"type":"object","description":"Product details.","properties":{"id":{"type":"string","description":"Product’s unique identifier. This field should be provided when itemType is EXTERNAl and request contains external product."},"sku":{"type":"string","description":"Product Stock Keeping Unit (SKU)."},"code":{"type":"string","description":"Product code."},"yrn":{"$ref":"#/components/schemas/YRN"},"name":{"type":"string","description":"Product name."},"localizedName":{"description":"A product name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string","description":"Product description."},"images":{"type":"array","description":"List of product images.","items":{"$ref":"#/components/schemas/productImage"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"","additionalProperties":true}}},"productImage":{"type":"object","properties":{"id":{"type":"string","description":"Product image''s unique identifier, generated when the image is added through the Product Service."},"url":{"type":"string","description":"Product image's URL with the file extension specified."}},"required":["id","url"],"description":"Product image details."},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"vendor":{"type":"object","description":"Product vendor information, autopopulated based on product catalog information.","properties":{"id":{"type":"string","description":"An identifier of a vendor to whom the product belongs"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"itemType":{"type":"string","enum":["EXTERNAL","INTERNAL"]},"itemCalculatedPrice":{"type":"object","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The price is calculated by multiplying the unit price (taken from priceMatch) by the quantity."},{"properties":{"calculated":{"type":"string","description":"Indicates how the line item price was determined. - `INTERNAL` — Calculated by Emporix using unit price × quantity. - `EXTERNAL` — Provided externally with `lineTax`.","enum":["INTERNAL","EXTERNAL"]}}}]},"upliftValue":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Maximum additional amount authorized for payment to cover potential price adjustments during packaging of weight-based products. For example, if the item’s `price.netValue=12`, the `upliftValue.netValue=1,2`, with 10% uplift configured. If the uplift value is not configured for an item, it's not returned in the response.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the uplift amount, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the uplift amount, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the uplift amount, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to uplift amount, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the uplift amount, it's the percentage at which an individual or business is taxed."}}}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total price for the item line calculated by multiplying the unit price by the quantity, with applied discounts. If there are no applied discounts to the given line item, the attribute is not returned in the response.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts, calculated if `includesTax=false`."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts, calculated if `includesTax=true`."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the discounted price, it's the percentage at which an individual or business is taxed."},"taxCode":{"type":"string","description":"Tax code applied to the discounted price, a tax code is a country's set of tax rules."},"appliedDiscounts":{"type":"array","description":"A list of discounts applied to the line item.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"Value of the discount that was applied."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for amount applied to the line item."}}}]}}}}]},"fees":{"type":"array","description":"A list of fees applied to the line item. If there are no fees on the item line, it's not returned in the response.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedFee"},{"type":"object","properties":{"id":{"type":"string","description":"Fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"PERCENT for fee percentage of the item's line `price.netValue` - unit price x quantity. ABSOLUTE for the absolute amount assigned to the item line. ABSOLUTE_MULTIPLY_ITEMQUANTITY for the monetary amount multiplied by the item quantity and assigned to the item line."},"origin":{"enum":["INTERNAL","EXTERNAL"],"type":"string","description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the cart."},"name":{"type":"object","description":"Fee name."},"price":{"description":"The calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"Monetary amount of the fee, depends on the fee type."},"grossValue":{"type":"number","format":"double","description":"Value calculated based on the `taxCode` and the `taxRate` if `taxable=true`."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the provided `taxCode` at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"Tax code defined on the fee level, for example STANDARD. The value should match the available tax codes in the system configuration."},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total price for the item line calculated by multiplying the unit price by the quantity, with applied discounts. If there are no applied discounts to the given line item, the attribute is not returned in the response.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts, calculated if `includesTax=false`."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts, calculated if `includesTax=true`."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxRate":{"type":"number","format":"double","description":"Refers to `fees[].price.taxRate`."},"taxCode":{"type":"string","description":"Refers to `fees[].price.taxCode`."},"appliedDiscounts":{"type":"array","description":"A list of discounts applied to the line item.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"Monetary amount of the discount applied to the price for the given discount ID."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for amount applied to the line item."}}}]}}}}]}}}}}]}},"totalFee":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"Sum of all fees applied to the item. It's calculated by summarizing `fees[].discountedPrice` if any discounts were applied to the fee, or `fees[].price` for an pre-discounted fee. If there are no fees applied to the line item, it's not returned in the response. The `totalFee` is the value after all the discounts, if any discounts were applied.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price, price without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price, price with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If all fees have the same `taxCode` defined, which results in the same `taxRate`, then the value is present. Otherwise, the field is not returned."},"taxCode":{"type":"string","description":"If all fees have the same `taxCode`, then the value is present. Otherwise, the field is not returned."},"appliedDiscounts":{"type":"array","description":"A list of discounts applied to the line item.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"Sum of all `fees[].discountedPrice.appliedDiscounts[].value` grouped by `discount.id`"},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for amount applied to the line item."}}}]}}}}]},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/calculatedTotalDiscount"},{"type":"object","description":"A summary of all discounts applied to the line, including discounts on both the line item's price and its fees. If there are no discounts applied on to the line item, it's not returned in the response.","properties":{"calculationType":{"type":"string","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"],"description":"Indicates whether discounts were applied to net or gross values."},"value":{"type":"number","format":"double","description":"Aggregated sum of `lines[].calculatedPrice.totalDiscount.value` plus the sum of shipping discounts `totalShipping.appliedDiscounts[].value`."},"appliedDiscounts":{"type":"array","description":"A list of the applied discounts.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"The sum of `discountedPrice.appliedDiscounts[].value` and `fees[].discountedPrice.appliedDiscounts[].value`."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts and ABSOLUTE for monetary amount."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The final price is the sum of the `discountedPrice` or the original price, depending on whether any discounts were applied to the line item, and the `totalFee`, which includes all fees applied to the line item. Since the total fee already includes the discounted prices of fees, the sum is calculated at the `totalFee` level.","properties":{"netValue":{"type":"number","format":"double","description":"The sum of line items, `discountedPrice.netValue` or `price.netValue`, and `totalFee.netValue`."},"grossValue":{"type":"number","format":"double","description":"The sum of line items, `discountedPrice.grossValue` or `price.grossValue`, and `totalFee.grossValue`."},"taxValue":{"type":"number","format":"double","description":"The result of subtracting `netValue` and `grossValue`, which is equal to the sum of all `taxValues` from the prices."},"taxRate":{"type":"number","format":"double","description":"If the tax code of the line item matches the tax code of all applied fees, the tax rate is populated with the value. Otherwise, it's not returned in the response."},"taxCode":{"type":"string","description":"The common tax code of the line item and all applicable fees. If at least one fee does not have a defined tax code, the common tax code cannot be determined, and the field is empty."}}}],"description":"Detailed price calculation for a single line item with all pricing components."}}},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price, price without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price, price with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to the price, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price, it's the percentage at which an individual or business is taxed."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details."},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","description":"List of applied discounts for the calculated price.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}},"description":"A price calculation model showing the final amount after applying discounts."}]},"calculatedAppliedDiscount":{"title":"calculatedAppliedDiscount","type":"object","properties":{"id":{"type":"string","description":"The ID of the applied discount."},"value":{"type":"number","format":"double","description":"The calculated value of the discount."},"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Applied discount's price. When discount is applied before tax the value equals `price.netValue` and `price.grossValue` for discount applied after tax."}]},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"The discount type which shows how the discount was calculated. PERCENT refers to a percentage discount for example 10%. ABSOLUTE is a monetary amount."},"origin":{"type":"string","enum":["INTERNAL","EXTERNAL"],"description":"Indicates whether the discount is from internal coupon (INTERNAL) or external discount (EXTERNAL)."}}},"calculatedFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"origin":{"enum":["INTERNAL","EXTERNAL"],"type":"string","description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the cart"},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The calculated fee price."}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The discounted fee value."}]}}},"calculatedTotalDiscount":{"title":"calculatedTotalDiscount","type":"object","description":"The total combined value of all applied discounts.","properties":{"calculationType":{"type":"string","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"],"description":"Indicates whether discounts were calculated using net or gross price values."},"value":{"type":"number","format":"double","description":"The calculated amount of all discounts."},"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Total discounts price. When discounts are applied before tax the value equals `price.netValue` and `price.grossValue` for discounts applied after tax."}]},"appliedDiscounts":{"type":"array","description":"All applied discounts that are parts of the sum. Sum of all `discountedPrice.appliedDiscounts[].value` and `fees[].discountedPrice.appliedDiscounts[].value`.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"externalDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"$ref":"#/components/schemas/externalDiscountType"},"value":{"type":"number","format":"double","minimum":0,"maximum":100,"description":"Value of the discount (percentage e.g 15.00 -> 15% or absolute amount e.g 10.00 -> 10 EUR depending on the discountType)."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount should be also applied to fees."},"sequence":{"type":"integer","description":"Sequence number determining the order in which discounts are applied. The lowest sequence number is applied first."}},"required":["id","discountType","value"]},"externalDiscountType":{"type":"string","description":"Type of the external discount.","enum":["PERCENT","ABSOLUTE"]},"priceRow":{"type":"object","description":"Price details.","properties":{"priceId":{"type":"string","description":"Price’s unique identifier generated when the price is created through the Price Service."},"priceListId":{"type":"string","description":"Identifier of price list. The field is populated only in case when the returned prices belongs to any price list."},"yrn":{"$ref":"#/components/schemas/YRN"},"originalAmount":{"minimum":0,"type":"number","format":"double","description":"Product’s regular price per specified `measurementUnit`."},"effectiveAmount":{"minimum":0,"type":"number","format":"double","description":"Actual amount the customer will pay per specified `measurementUnit`."},"currency":{"type":"string","pattern":"[A-Z]{3}","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard."},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"}},"required":["priceId","originalAmount","effectiveAmount","currency"]},"measurementUnit":{"type":"object","description":"Information about the unit by which the customer can order the product.","properties":{"quantity":{"type":"number","minimum":0,"description":"Quantity of the measurement unit.\n\nFor example, if the customer can order a product by one piece, the value should be set to `1`.","format":"double"},"unitCode":{"description":"Code of the measurement unit by which the customer can order the product. The possible values for the `unitCode` field are explained in the table below:\n|     |     |\n| --- | --- |\n| **Value** | **Measurement unit** |\n| `H87` | Pieces |\n| `KGM` | Kilograms |\n| `GRM` | Grams |\n| `LTR` | Liters |\n| `MLT` | Milliliters |\n| `MTR` | Meters |\n| `RO` | Rolls |\n\nFor example, if the customer can order a product by pieces, the value should be set to `H87`.","enum":["kg","g","mg","l","ml","lb","qt","qtr","gal","pt","oz","MTR","XRO","MLT","LTR","H87","KGM","GRM","HLT","DL","DAG","RO"],"type":"string"}},"required":["quantity"]},"taxValueWithQuantity":{"type":"object","allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","properties":{"quantity":{"type":"number","description":"Represents the item quantity for which the external `lineTax` was provided."}}}],"required":["rate","grossValue","netValue"]},"taxValue":{"type":"object","description":"The tax amount from an external source, requiring either gross amount, net amount, or both to be specified","properties":{"name":{"description":"Tax name. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","type":"string"},"rate":{"type":"number","description":"Tax rate based on which the net/gross values can be calculated. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","format":"double"},"grossValue":{"type":"number","description":"The gross value (amount including tax). If not provided, it's calculated based on the net value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."},"netValue":{"type":"number","description":"The net value (amount excluding tax). If not provided, it's calculated based on the gross value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."}}},"couponDiscounts":{"type":"array","description":"Collection of couponId-value pairs indicating how much particular coupon lowered absolute price of given item. Coupons of FREE_SHIPPING discount type are not taken into account.","items":{"$ref":"#/components/schemas/couponDiscount"}},"couponDiscount":{"type":"object","properties":{"couponId":{"type":"string","description":"ID of coupon."},"value":{"type":"number","description":"Absolute value indicating how much given coupon lowered the price of given item."}}},"price":{"type":"object","properties":{"amount":{"type":"number","minimum":0,"format":"double","description":"Price."},"currency":{"type":"string","pattern":"[A-Z]{3}","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard."}},"required":["amount","currency"],"description":""},"feeAggregate":{"type":"object","properties":{"elements":{"description":"","type":"array","items":{"$ref":"#/components/schemas/fee"}},"total":{"$ref":"#/components/schemas/total"}}},"fee":{"title":"fee","type":"object","properties":{"yrn":{"$ref":"#/components/schemas/YRN"},"name":{"$ref":"#/components/schemas/localizedValue"},"taxCode":{"type":"string"},"amount":{"type":"number","format":"double","minimum":0,"description":""},"totalTax":{"type":"number","format":"double","minimum":0},"total":{"$ref":"#/components/schemas/total"},"taxValues":{"type":"array","items":{"$ref":"#/components/schemas/taxValue"}}},"required":["amount","totalTax","total"]},"localizedValue":{"description":"Localized value which can have different structure which depends on provided `Content-Language` header.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]},"total":{"type":"object","properties":{"subTotal":{"type":"number","description":"Subtotal for the products."},"totalTax":{"type":"number","description":"Total tax for the products."},"total":{"type":"number","description":"Total amount the customer will pay for the products."},"discount":{"type":"number","description":"Total discount for the products"}}},"externalFee":{"type":"object","required":["feeType"],"properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of fee as absolute. It must be provided when feeType equals `ABSOLUTE` or `ABSOLUTE_MULTIPLY_ITEMQUANTITY`.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Currency of fee absolute."},"amount":{"type":"number","description":"Value of fee absolute."}}},"taxable":{"type":"boolean","description":"Whether tax should be included to the fee or not."},"taxCode":{"type":"string","description":"Tax code of the fee."},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"rate":{"type":"number","description":"Rate of the tax."},"taxable":{"type":"number","description":"The taxable amount."},"value":{"type":"object","properties":{"currency":{"type":"string","description":"Currency of the tax."},"amount":{"type":"number","description":"Value of the tax."}}}}}}}},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/items/{itemId}":{"get":{"responses":{"200":{"description":"The request was successful. Cart item details are returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartItemResponse"}}}},"400":{"$ref":"#/components/responses/trait_400"},"401":{"$ref":"#/components/responses/trait_401"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Retrieves a specified cart item's details.","operationId":"GET-cart-retrieve-item-details","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Retrieving a cart item","tags":["Cart items"]}}}}
```

## Updating a cart item

> Updates a specified cart item.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["cart.cart_manage"]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_conflict_409":{"description":"The request could not be completed due to a conflict with the current state of the target resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}},"updateCartItem":{"type":"object","properties":{"externalFees":{"type":"array","items":{"$ref":"#/components/schemas/externalFee"}},"externalDiscounts":{"type":"array","description":"External discounts applied to this cart item.","items":{"$ref":"#/components/schemas/externalDiscount"}},"product":{"$ref":"#/components/schemas/updateProduct"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"itemType":{"allOf":[{"$ref":"#/components/schemas/itemType"},{"type":"object","description":"Optional field which allows fetching external prices if set to EXTERNAL."}]},"quantity":{"type":"number","minimum":0,"format":"double","description":"Quantity of the product added to cart."},"taxCode":{"description":"Tax code. Tax indicated in this field overrides the site's default tax value.","type":"string"},"tax":{"allOf":[{"$ref":"#/components/schemas/taxValue"},{"type":"object","description":"Tax information per unit. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."}]},"price":{"$ref":"#/components/schemas/priceRowItem"},"linePrice":{"description":"Externally calculated total line price (`unit price × quantity`). When provided, this overrides internal calculations.","properties":{"effectiveAmount":{"type":"number","minimum":0},"originalAmount":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["effectiveAmount","originalAmount","currency"]},"lineTax":{"allOf":[{"$ref":"#/components/schemas/taxValue"}],"description":"Externally calculated total tax for the item line. Only allowed when `itemType = EXTERNAL`.","required":["netValue","grossValue","rate"]},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","additionalProperties":true}}},"externalFee":{"type":"object","required":["feeType"],"properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of fee as absolute. It must be provided when feeType equals `ABSOLUTE` or `ABSOLUTE_MULTIPLY_ITEMQUANTITY`.","required":["currency","amount"],"properties":{"currency":{"type":"string","description":"Currency of fee absolute."},"amount":{"type":"number","description":"Value of fee absolute."}}},"taxable":{"type":"boolean","description":"Whether tax should be included to the fee or not."},"taxCode":{"type":"string","description":"Tax code of the fee."},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"rate":{"type":"number","description":"Rate of the tax."},"taxable":{"type":"number","description":"The taxable amount."},"value":{"type":"object","properties":{"currency":{"type":"string","description":"Currency of the tax."},"amount":{"type":"number","description":"Value of the tax."}}}}}}}},"localizedValue":{"description":"Localized value which can have different structure which depends on provided `Content-Language` header.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]},"externalDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"$ref":"#/components/schemas/externalDiscountType"},"value":{"type":"number","format":"double","minimum":0,"maximum":100,"description":"Value of the discount (percentage e.g 15.00 -> 15% or absolute amount e.g 10.00 -> 10 EUR depending on the discountType)."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount should be also applied to fees."},"sequence":{"type":"integer","description":"Sequence number determining the order in which discounts are applied. The lowest sequence number is applied first."}},"required":["id","discountType","value"]},"externalDiscountType":{"type":"string","description":"Type of the external discount.","enum":["PERCENT","ABSOLUTE"]},"updateProduct":{"type":"object","properties":{"code":{"type":"string","description":"Product code."},"sku":{"type":"string","description":"Product Stock Keeping Unit (SKU)."},"description":{"type":"string","description":"Product description."},"name":{"type":"string","description":"Product name."},"localizedName":{"description":"A product name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"images":{"type":"array","description":"List of product images.","items":{"$ref":"#/components/schemas/productImage"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","additionalProperties":true}}},"productImage":{"type":"object","properties":{"id":{"type":"string","description":"Product image''s unique identifier, generated when the image is added through the Product Service."},"url":{"type":"string","description":"Product image's URL with the file extension specified."}},"required":["id","url"],"description":"Product image details."},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"YRN":{"type":"string","title":"YRN","description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.","minLength":1},"itemType":{"type":"string","enum":["EXTERNAL","INTERNAL"]},"taxValue":{"type":"object","description":"The tax amount from an external source, requiring either gross amount, net amount, or both to be specified","properties":{"name":{"description":"Tax name. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","type":"string"},"rate":{"type":"number","description":"Tax rate based on which the net/gross values can be calculated. This field is required only when the itemType is set as EXTERNAL and the request contains an external price.","format":"double"},"grossValue":{"type":"number","description":"The gross value (amount including tax). If not provided, it's calculated based on the net value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."},"netValue":{"type":"number","description":"The net value (amount excluding tax). If not provided, it's calculated based on the gross value and tax rate.  If provided then the price effective amount must be equal to it. This field is required only when the itemType is set as EXTERNAL and the request contains an external price."}}},"priceRowItem":{"type":"object","description":"Price details.","properties":{"priceId":{"type":"string","description":"Price’s unique identifier generated when the price is created through the Price Service. This field should not be provided when itemType is EXTERNAL."},"yrn":{"$ref":"#/components/schemas/YRN"},"originalAmount":{"minimum":0,"type":"number","format":"double","description":"Product’s regular price per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipOriginalAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"effectiveAmount":{"minimum":0,"type":"number","format":"double","description":"Actual amount the customer will pay per specified `measurementUnit`. Property can be made optional by setting `cartItemValidationSkipEffectiveAmount` configuration to `true` in the configuration-service. In that case, the value is fetched from `priceId`."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard. Property can be made optional by setting `cartItemValidationSkipCurrency` configuration to `true` in the configuration-service. In that case, the value is fetched from cart currency."},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"}},"required":["priceId","originalAmount","effectiveAmount","currency"]},"measurementUnit":{"type":"object","description":"Information about the unit by which the customer can order the product.","properties":{"quantity":{"type":"number","minimum":0,"description":"Quantity of the measurement unit.\n\nFor example, if the customer can order a product by one piece, the value should be set to `1`.","format":"double"},"unitCode":{"description":"Code of the measurement unit by which the customer can order the product. The possible values for the `unitCode` field are explained in the table below:\n|     |     |\n| --- | --- |\n| **Value** | **Measurement unit** |\n| `H87` | Pieces |\n| `KGM` | Kilograms |\n| `GRM` | Grams |\n| `LTR` | Liters |\n| `MLT` | Milliliters |\n| `MTR` | Meters |\n| `RO` | Rolls |\n\nFor example, if the customer can order a product by pieces, the value should be set to `H87`.","enum":["kg","g","mg","l","ml","lb","qt","qtr","gal","pt","oz","MTR","XRO","MLT","LTR","H87","KGM","GRM","HLT","DL","DAG","RO"],"type":"string"}},"required":["quantity"]}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/items/{itemId}":{"put":{"responses":{"204":{"description":"The request was successful. The cart item has been updated."},"400":{"$ref":"#/components/responses/trait_400"},"401":{"$ref":"#/components/responses/trait_401"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"409":{"$ref":"#/components/responses/trait_conflict_409"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Updates a specified cart item.","operationId":"PUT-cart-update-item-details","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateCartItem"}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"schema":{"type":"boolean","default":false},"in":"query","name":"partial","description":"| Option  | Description |\n|---|---|\n| `true` | A partial product update will be performed. |\n| `false` | A full product replacement will be performed.|\n"}],"summary":"Updating a cart item","tags":["Cart items"]}}}}
```

## Removing an item from cart

> Removes a specified product from cart and deletes the cart item.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Cart items","description":"Manage Cart items"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["cart.cart_manage"]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts. This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","cart.cart_manage_external_prices":"Needed to manage external prices, products, fees and discounts. It's required only when an external price, product, fee or discount is provided."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/items/{itemId}":{"delete":{"responses":{"204":{"description":"The request was successful. The item has been removed from cart.\n"},"400":{"$ref":"#/components/responses/trait_400"},"401":{"$ref":"#/components/responses/trait_401"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Removes a specified product from cart and deletes the cart item.","operationId":"DELETE-cart-remove-item-from-cart","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Removing an item from cart","tags":["Cart items"]}}}}
```


---

# 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://developer.emporix.io/api-references/api-guides/checkout/cart/api-reference/cart-items.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.
