# Models

## The restriction object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the cart.\n\n**Purpose**: Restricts cart visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access carts with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view carts with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**: \n- If cart is created by customer and `restriction` is not set, the `restriction` will be inherited from customer's restriction'.\n- If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with cart's siteCode property.\n"}}}}
```

## The appliedDiscount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"appliedDiscount":{"type":"object","properties":{"yrn":{"$ref":"#/components/schemas/YRN"},"discountId":{"type":"string","format":"double"},"discountIndex":{"type":"integer","description":"The index of the discount that represents the number in the discounts array. It can be used for the discount removal from the cart."}},"required":["yrn","discountId","discountIndex"]},"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}}}}
```

## The search object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"search":{"type":"object","properties":{"q":{"type":"string","description":"A standard query parameter is used to search for specific values. \n\nSee: [Standard practises - Query parameter](https://developer.emporix.io/api-references/standard-practices/q-param/)\n"}}}}}}
```

## The baseCart object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"baseCart":{"type":"object","properties":{"id":{"type":"string","description":"Cart unique identifier generated when a cart is created."},"yrn":{"$ref":"#/components/schemas/YRN"},"restriction":{"$ref":"#/components/schemas/restriction"},"customerId":{"type":"string","description":"Customer unique identifier generated when a customer account is created through the Customer Service."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"orderId":{"type":"string","description":"The identifier of an order generated from this cart."},"quoteId":{"type":"string","description":"Identifier of a quote created from this cart."},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard.","pattern":"[A-Z]{3}","minLength":3,"maxLength":3},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."},"type":{"type":"string","description":"Cart type."},"zipCode":{"type":"string","description":"Customer address - zip code."},"countryCode":{"type":"string","description":"Two-letter country code, compliant with the ISO 3166 standard.","minLength":2,"maxLength":2,"pattern":"[A-Z]{2}"},"addresses":{"type":"array","description":"A list of addresses used in the cart. The list contains one `BILLING` and one `SHIPPING` address `type`.\nIf one of the address `types` is not provided in the request, it is automatically populated in the following order:\n* If the cart has a legal entity, it gets the first location of the legal entity that has both `country` and `zipCode`, and matches the required `type` - then the address has origin=`LEGAL_ENTITY`.\n* Otherwise, if the cart has a logged-in customer, it finds the `default` address that has both `country` and `zipCode`, and matches the required `type`. If there is no matching default address with the required information, it uses the first customer address that meets the criteria. The address has origin=`CUSTOMER`.\n* Otherwise, the cart uses the site homebase address. Then the address has origin=`SITE`.\nThese addresses are used in the tax country code determination [How to determine a tax country at cart level](https://developer.emporix.io/api-references/api-guides/checkout/cart/cart#how-to-determine-a-tax-country-at-cart-level) and shipping cost calculation [How to calculate shipping cost at cart level](https://developer.emporix.io/api-references/api-guides/checkout/cart/cart#how-to-calculate-shipping-cost-at-cart-level).","items":{"$ref":"#/components/schemas/addressResponse"}},"channel":{"$ref":"#/components/schemas/channel"},"calculatedPrice":{"$ref":"#/components/schemas/cartCalculatedPrice"},"discounts":{"type":"array","description":"Discounts applied to the cart.","items":{"$ref":"#/components/schemas/discountResponse"}},"externalDiscounts":{"type":"array","description":"External discounts that should be applied to this cart. Requires the `cart.cart_manage_external_prices` scope.","items":{"$ref":"#/components/schemas/externalCartDiscount"}},"totalUnitsCount":{"type":"number","description":"Total number of items added to the cart.","format":"double"},"sessionId":{"description":"Customer unique session identifier.","type":"string"},"metadata":{"$ref":"#/components/schemas/metadataResponse"},"totalTax":{"$ref":"#/components/schemas/price"},"taxDescription":{"description":"Information about the applied tax.","type":"string"},"mixins":{"type":"object","additionalProperties":true},"leadTime":{"type":"integer","description":"Time needed to prepare the products for the delivery, expressed in hours. Time is calculated based on the products added to the cart. It is equal to the maximum lead time of all the products - `mixins.productCustomAttributes.leadTime`."},"nonDelivery":{"type":"array","description":"List of days on which the products cannot be delivered. Days are presented by numbers where Monday is `0`, Tuesday is `1` etc. `nonDelivery` list is the union of all `mixins.productCustomAttributes.nonDelivery` products values.","items":{"type":"string"}}},"required":["siteCode"]},"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},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the cart.\n\n**Purpose**: Restricts cart visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access carts with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view carts with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**: \n- If cart is created by customer and `restriction` is not set, the `restriction` will be inherited from customer's restriction'.\n- If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with cart's siteCode property.\n"},"deliveryWindow":{"type":"object","properties":{"id":{"type":"string","description":"ID of the delivery window."},"slotId":{"type":"string","description":"ID of the delivery time slot."},"deliveryDate":{"type":"string","format":"date-time","description":"Delivery date. It has to be of \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\" format."}}},"addressResponse":{"type":"object","description":"Information about the carts address used for shipping and tax determination.","additionalProperties":false,"properties":{"origin":{"type":"string","enum":["REQUEST","LEGAL_ENTITY","CUSTOMER","SITE"],"description":"Holds information about the origin of the address. Possible values:\n  * `REQUEST` - provided in create/update cart request\n  * `LEGAL_ENTITY` - automatically populated from from cart's legal entity location\n  * `CUSTOMER` - automatically populated from fetched from customer addresses\n  * `SITE` - automatically populated from sites base address"},"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"legalEntityLocationId":{"type":"string","description":"ID of the legal entity location."},"customerAddressId":{"type":"string","description":"ID of the customer address."},"contactName":{"type":"string","minLength":0,"description":"Contact name."},"companyName":{"type":"string","description":"Company name."},"street":{"type":"string","minLength":0,"description":"Street."},"streetNumber":{"type":"string","description":"Street number."},"streetAppendix":{"type":"string","description":"Street appendix."},"zipCode":{"type":"string","maxLength":11,"minLength":0,"description":"Zip code."},"city":{"type":"string","minLength":0,"description":"City."},"country":{"type":"string","pattern":"[a-zA-Z]{2}","minLength":2,"maxLength":2,"description":"Country."},"state":{"type":"string","description":"State."},"contactPhone":{"type":"string","description":"Contact phone."},"type":{"type":"string","enum":["BILLING","SHIPPING"],"description":"Type of the address data."},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"Mixins object","additionalProperties":true}}},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"channel":{"type":"object","description":"Channel through which the cart was created.","properties":{"name":{"type":"string","description":""},"source":{"type":"string"}}},"cartCalculatedPrice":{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components.","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item price values, it means unit prices multiplied by quantity - `items[].calculatedPrice.price`.","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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price, it's the percentage at which an individual or business is taxed. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"upliftValue":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item uplift values. Uplift value is the maximum additional amount to be 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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all line item prices after discounts are calculated. It's included in the response if at least one line item has a discounted price. It's the total amount of discounted prices for items with applied discounts and the original prices for items without discounts. It reflects the total cost of all line items after discounts.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the discounted price, a tax code is a country's set of tax rules. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"fees":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee *before discounts*."}]},"totalFee":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee. It's calculated by summing `items[].calculatedPrice.totalFee` with `paymentFee`. 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 total fee, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the total fee, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the total fee, 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, resulting in the same `taxRate`, the value is present. Otherwise, the field is not returned in the response."},"taxCode":{"type":"string","description":"If all fees have the same `taxCode` defined, the value is present. Otherwise, the field is not returned in the response."},"appliedDiscounts":{"description":"A list of discounts applied to on the line item fees. The payment fee itself is not discountable.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"The sum of all `lines[].calculatedPrice.totalFee[].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 fee."}}}]}}}}]},"shipping":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `shipping` is the value *before discounts*, use totalShipping to get the value after discounts."}]},"totalShipping":{"description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `totalShipping` is the value *after all the discounts*, if any discounts were applied.","allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the shipping cost, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the shipping cost, it's the percentage at which an individual or business is taxed."},"appliedDiscounts":{"description":"A list of discounts applied to shipping.","type":"array","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."}}}]}}}}]},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/calculatedTotalDiscount"},{"type":"object","description":"A summary of all discounts applied at a cart level - sum of `lines[].totalDiscount` and shipping discounts. If there are no discounts applied, 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 all `lines[].calculatedPrice.totalDiscount.value` plus `totalShipping.appliedDiscounts[].value` grouped by the discount ID."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts, ABSOLUTE for monetary amount and FREE_SHIPPING is shipping is fully discounted."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `items[].finalPrice`, `totalShipping`, and `paymentFee`, without the uplift value.","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."},"taxAggregate":{"properties":{"lines":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A list of tax values grouped by `taxCode` and `taxRate`. It includes the sum of `item[].calculatedPrice.discountedPrice` or `item[].calculatedPrice.price`, `item[].calculatedPrice.fees[].discountedPrice` or `item[].calculatedPrice.fees[].price`, `calculatedPrice.totalShipping` and `calculatedPrice.paymentFees`. If any of these values have the same `taxRate` but different `taxCode`, they are listed separately. The aggregation also includes items that do not have a `taxRate` or `taxCode` defined.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the tax, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the tax, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the tax, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to the tax, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the tax, it's the percentage at which an individual or business is taxed."}}}]}}}}}]}}},"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)."}}},"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"}}}},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}},"description":"A price calculation model that includes tax aggregate information."}]},"calculatedTaxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/calculatedPrice"},"description":"List of tax calculations grouped by taxCode and taxRate"}},"description":"Aggregated tax information showing detailed tax calculations"},"discountResponse":{"description":"Discount details.","type":"object","properties":{"id":{"type":"string","description":"Discount's unique identifier."},"yrn":{"$ref":"#/components/schemas/YRN"},"couponYrn":{"$ref":"#/components/schemas/YRN"},"code":{"maxLength":150,"description":"Discount code generated when a discount coupon is created through the Coupon Service.","type":"string"},"amount":{"type":"number","minimum":0,"description":"Discount expressed as fixed amount.","format":"double"},"currency":{"type":"string","pattern":"[A-Z]{3}","description":"Three-letter currency code, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"discountRate":{"type":"number","minimum":0,"description":"Discount expressed as a percentage of the price.","format":"double"},"name":{"maxLength":150,"description":"Discount's displayed name.","type":"string"},"calculationType":{"type":"string","maxLength":30,"default":"ApplyDiscountBeforeTax","description":"Calculation type specifies how the discount should be calculated. Can be set to one of the following:\n* `ApplyDiscountBeforeTax`\n* `ApplyDiscountAfterTax`","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"]},"discountCalculationType":{"type":"string","description":"Determines whether the coupon is applied to the total or subtotal value of the order.","enum":["SUBTOTAL","TOTAL"]},"valid":{"default":true,"description":"Flag indicating whether the discount is valid. \nInvalid discounts are not taken into account when the cart is calculated.","type":"boolean"},"links":{"minItems":2,"type":"array","description":"Links to Coupon Service endpoints used to validate and redeem the discount.","items":{"$ref":"#/components/schemas/link"}},"discountValidationDetails":{"$ref":"#/components/schemas/discountValidationDetails"},"discountIndex":{"type":"integer","description":"The index of the discount. It represents the discount position in the cart discounts array."}},"required":["code"]},"link":{"description":"","type":"object","properties":{"rel":{"type":"string","maxLength":50,"description":"Action to be done using the endpoint provided in the `href` field.","enum":["validate","redeem"]},"title":{"maxLength":100,"description":"Detailed link description.","type":"string"},"href":{"type":"string","maxLength":2000,"description":"Endpoint used to validate or redeem the discount."},"type":{"type":"string","maxLength":500,"description":"Content type."}},"required":["rel","href","type"]},"discountValidationDetails":{"description":"","type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}},"externalCartDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"Indicates the type of discount applied:\n* `PERCENT` — a percentage-based discount\n* `ABSOLUTE` — a fixed monetary amount\n* `FREE_SHIPPING` — shipping is fully discounted"},"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)."},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the discount is applied to the total or subtotal value of the order.\n* `TOTAL` - discount is spread across products with product fees and shipping cost.\n* `SUBTOTAL` - discount is spread across products without 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"]},"metadataResponse":{"type":"object","properties":{"createdAt":{"type":"string","description":"Date and time when the object was created, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"modifiedAt":{"type":"string","description":"Date and time when the object was last modified, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"calculatedAt":{"type":"string","description":"Date and time when the object was last calculated, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"version":{"minimum":1,"type":"integer"},"mixins":{"type":"object","additionalProperties":true}},"required":["createdAt","modifiedAt","version"]},"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":""}}}}
```

## The cartGetAll object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"cartGetAll":{"allOf":[{"$ref":"#/components/schemas/baseCart"},{"type":"object","properties":{"items":{"type":"array","description":"Items added to the cart.","items":{"$ref":"#/components/schemas/baseCartItemResponse"}},"status":{"type":"string","enum":["OPEN","CLOSED"],"description":"Informs whether cart is still open or it is already closed."}}}]},"baseCart":{"type":"object","properties":{"id":{"type":"string","description":"Cart unique identifier generated when a cart is created."},"yrn":{"$ref":"#/components/schemas/YRN"},"restriction":{"$ref":"#/components/schemas/restriction"},"customerId":{"type":"string","description":"Customer unique identifier generated when a customer account is created through the Customer Service."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"orderId":{"type":"string","description":"The identifier of an order generated from this cart."},"quoteId":{"type":"string","description":"Identifier of a quote created from this cart."},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard.","pattern":"[A-Z]{3}","minLength":3,"maxLength":3},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."},"type":{"type":"string","description":"Cart type."},"zipCode":{"type":"string","description":"Customer address - zip code."},"countryCode":{"type":"string","description":"Two-letter country code, compliant with the ISO 3166 standard.","minLength":2,"maxLength":2,"pattern":"[A-Z]{2}"},"addresses":{"type":"array","description":"A list of addresses used in the cart. The list contains one `BILLING` and one `SHIPPING` address `type`.\nIf one of the address `types` is not provided in the request, it is automatically populated in the following order:\n* If the cart has a legal entity, it gets the first location of the legal entity that has both `country` and `zipCode`, and matches the required `type` - then the address has origin=`LEGAL_ENTITY`.\n* Otherwise, if the cart has a logged-in customer, it finds the `default` address that has both `country` and `zipCode`, and matches the required `type`. If there is no matching default address with the required information, it uses the first customer address that meets the criteria. The address has origin=`CUSTOMER`.\n* Otherwise, the cart uses the site homebase address. Then the address has origin=`SITE`.\nThese addresses are used in the tax country code determination [How to determine a tax country at cart level](https://developer.emporix.io/api-references/api-guides/checkout/cart/cart#how-to-determine-a-tax-country-at-cart-level) and shipping cost calculation [How to calculate shipping cost at cart level](https://developer.emporix.io/api-references/api-guides/checkout/cart/cart#how-to-calculate-shipping-cost-at-cart-level).","items":{"$ref":"#/components/schemas/addressResponse"}},"channel":{"$ref":"#/components/schemas/channel"},"calculatedPrice":{"$ref":"#/components/schemas/cartCalculatedPrice"},"discounts":{"type":"array","description":"Discounts applied to the cart.","items":{"$ref":"#/components/schemas/discountResponse"}},"externalDiscounts":{"type":"array","description":"External discounts that should be applied to this cart. Requires the `cart.cart_manage_external_prices` scope.","items":{"$ref":"#/components/schemas/externalCartDiscount"}},"totalUnitsCount":{"type":"number","description":"Total number of items added to the cart.","format":"double"},"sessionId":{"description":"Customer unique session identifier.","type":"string"},"metadata":{"$ref":"#/components/schemas/metadataResponse"},"totalTax":{"$ref":"#/components/schemas/price"},"taxDescription":{"description":"Information about the applied tax.","type":"string"},"mixins":{"type":"object","additionalProperties":true},"leadTime":{"type":"integer","description":"Time needed to prepare the products for the delivery, expressed in hours. Time is calculated based on the products added to the cart. It is equal to the maximum lead time of all the products - `mixins.productCustomAttributes.leadTime`."},"nonDelivery":{"type":"array","description":"List of days on which the products cannot be delivered. Days are presented by numbers where Monday is `0`, Tuesday is `1` etc. `nonDelivery` list is the union of all `mixins.productCustomAttributes.nonDelivery` products values.","items":{"type":"string"}}},"required":["siteCode"]},"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},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the cart.\n\n**Purpose**: Restricts cart visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access carts with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view carts with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**: \n- If cart is created by customer and `restriction` is not set, the `restriction` will be inherited from customer's restriction'.\n- If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with cart's siteCode property.\n"},"deliveryWindow":{"type":"object","properties":{"id":{"type":"string","description":"ID of the delivery window."},"slotId":{"type":"string","description":"ID of the delivery time slot."},"deliveryDate":{"type":"string","format":"date-time","description":"Delivery date. It has to be of \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\" format."}}},"addressResponse":{"type":"object","description":"Information about the carts address used for shipping and tax determination.","additionalProperties":false,"properties":{"origin":{"type":"string","enum":["REQUEST","LEGAL_ENTITY","CUSTOMER","SITE"],"description":"Holds information about the origin of the address. Possible values:\n  * `REQUEST` - provided in create/update cart request\n  * `LEGAL_ENTITY` - automatically populated from from cart's legal entity location\n  * `CUSTOMER` - automatically populated from fetched from customer addresses\n  * `SITE` - automatically populated from sites base address"},"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"legalEntityLocationId":{"type":"string","description":"ID of the legal entity location."},"customerAddressId":{"type":"string","description":"ID of the customer address."},"contactName":{"type":"string","minLength":0,"description":"Contact name."},"companyName":{"type":"string","description":"Company name."},"street":{"type":"string","minLength":0,"description":"Street."},"streetNumber":{"type":"string","description":"Street number."},"streetAppendix":{"type":"string","description":"Street appendix."},"zipCode":{"type":"string","maxLength":11,"minLength":0,"description":"Zip code."},"city":{"type":"string","minLength":0,"description":"City."},"country":{"type":"string","pattern":"[a-zA-Z]{2}","minLength":2,"maxLength":2,"description":"Country."},"state":{"type":"string","description":"State."},"contactPhone":{"type":"string","description":"Contact phone."},"type":{"type":"string","enum":["BILLING","SHIPPING"],"description":"Type of the address data."},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"Mixins object","additionalProperties":true}}},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"channel":{"type":"object","description":"Channel through which the cart was created.","properties":{"name":{"type":"string","description":""},"source":{"type":"string"}}},"cartCalculatedPrice":{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components.","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item price values, it means unit prices multiplied by quantity - `items[].calculatedPrice.price`.","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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price, it's the percentage at which an individual or business is taxed. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"upliftValue":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item uplift values. Uplift value is the maximum additional amount to be 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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all line item prices after discounts are calculated. It's included in the response if at least one line item has a discounted price. It's the total amount of discounted prices for items with applied discounts and the original prices for items without discounts. It reflects the total cost of all line items after discounts.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the discounted price, a tax code is a country's set of tax rules. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"fees":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee *before discounts*."}]},"totalFee":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee. It's calculated by summing `items[].calculatedPrice.totalFee` with `paymentFee`. 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 total fee, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the total fee, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the total fee, 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, resulting in the same `taxRate`, the value is present. Otherwise, the field is not returned in the response."},"taxCode":{"type":"string","description":"If all fees have the same `taxCode` defined, the value is present. Otherwise, the field is not returned in the response."},"appliedDiscounts":{"description":"A list of discounts applied to on the line item fees. The payment fee itself is not discountable.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"The sum of all `lines[].calculatedPrice.totalFee[].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 fee."}}}]}}}}]},"shipping":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `shipping` is the value *before discounts*, use totalShipping to get the value after discounts."}]},"totalShipping":{"description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `totalShipping` is the value *after all the discounts*, if any discounts were applied.","allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the shipping cost, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the shipping cost, it's the percentage at which an individual or business is taxed."},"appliedDiscounts":{"description":"A list of discounts applied to shipping.","type":"array","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."}}}]}}}}]},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/calculatedTotalDiscount"},{"type":"object","description":"A summary of all discounts applied at a cart level - sum of `lines[].totalDiscount` and shipping discounts. If there are no discounts applied, 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 all `lines[].calculatedPrice.totalDiscount.value` plus `totalShipping.appliedDiscounts[].value` grouped by the discount ID."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts, ABSOLUTE for monetary amount and FREE_SHIPPING is shipping is fully discounted."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `items[].finalPrice`, `totalShipping`, and `paymentFee`, without the uplift value.","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."},"taxAggregate":{"properties":{"lines":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A list of tax values grouped by `taxCode` and `taxRate`. It includes the sum of `item[].calculatedPrice.discountedPrice` or `item[].calculatedPrice.price`, `item[].calculatedPrice.fees[].discountedPrice` or `item[].calculatedPrice.fees[].price`, `calculatedPrice.totalShipping` and `calculatedPrice.paymentFees`. If any of these values have the same `taxRate` but different `taxCode`, they are listed separately. The aggregation also includes items that do not have a `taxRate` or `taxCode` defined.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the tax, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the tax, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the tax, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to the tax, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the tax, it's the percentage at which an individual or business is taxed."}}}]}}}}}]}}},"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)."}}},"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"}}}},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}},"description":"A price calculation model that includes tax aggregate information."}]},"calculatedTaxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/calculatedPrice"},"description":"List of tax calculations grouped by taxCode and taxRate"}},"description":"Aggregated tax information showing detailed tax calculations"},"discountResponse":{"description":"Discount details.","type":"object","properties":{"id":{"type":"string","description":"Discount's unique identifier."},"yrn":{"$ref":"#/components/schemas/YRN"},"couponYrn":{"$ref":"#/components/schemas/YRN"},"code":{"maxLength":150,"description":"Discount code generated when a discount coupon is created through the Coupon Service.","type":"string"},"amount":{"type":"number","minimum":0,"description":"Discount expressed as fixed amount.","format":"double"},"currency":{"type":"string","pattern":"[A-Z]{3}","description":"Three-letter currency code, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"discountRate":{"type":"number","minimum":0,"description":"Discount expressed as a percentage of the price.","format":"double"},"name":{"maxLength":150,"description":"Discount's displayed name.","type":"string"},"calculationType":{"type":"string","maxLength":30,"default":"ApplyDiscountBeforeTax","description":"Calculation type specifies how the discount should be calculated. Can be set to one of the following:\n* `ApplyDiscountBeforeTax`\n* `ApplyDiscountAfterTax`","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"]},"discountCalculationType":{"type":"string","description":"Determines whether the coupon is applied to the total or subtotal value of the order.","enum":["SUBTOTAL","TOTAL"]},"valid":{"default":true,"description":"Flag indicating whether the discount is valid. \nInvalid discounts are not taken into account when the cart is calculated.","type":"boolean"},"links":{"minItems":2,"type":"array","description":"Links to Coupon Service endpoints used to validate and redeem the discount.","items":{"$ref":"#/components/schemas/link"}},"discountValidationDetails":{"$ref":"#/components/schemas/discountValidationDetails"},"discountIndex":{"type":"integer","description":"The index of the discount. It represents the discount position in the cart discounts array."}},"required":["code"]},"link":{"description":"","type":"object","properties":{"rel":{"type":"string","maxLength":50,"description":"Action to be done using the endpoint provided in the `href` field.","enum":["validate","redeem"]},"title":{"maxLength":100,"description":"Detailed link description.","type":"string"},"href":{"type":"string","maxLength":2000,"description":"Endpoint used to validate or redeem the discount."},"type":{"type":"string","maxLength":500,"description":"Content type."}},"required":["rel","href","type"]},"discountValidationDetails":{"description":"","type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}},"externalCartDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"Indicates the type of discount applied:\n* `PERCENT` — a percentage-based discount\n* `ABSOLUTE` — a fixed monetary amount\n* `FREE_SHIPPING` — shipping is fully discounted"},"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)."},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the discount is applied to the total or subtotal value of the order.\n* `TOTAL` - discount is spread across products with product fees and shipping cost.\n* `SUBTOTAL` - discount is spread across products without 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"]},"metadataResponse":{"type":"object","properties":{"createdAt":{"type":"string","description":"Date and time when the object was created, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"modifiedAt":{"type":"string","description":"Date and time when the object was last modified, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"calculatedAt":{"type":"string","description":"Date and time when the object was last calculated, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"version":{"minimum":1,"type":"integer"},"mixins":{"type":"object","additionalProperties":true}},"required":["createdAt","modifiedAt","version"]},"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":""},"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."},"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."},"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."}}},"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."}]}}},"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"]}}}}
```

## The cart object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"cart":{"allOf":[{"$ref":"#/components/schemas/baseCart"},{"type":"object","description":"Cart details.","properties":{"items":{"type":"array","description":"Items added to the cart.","items":{"$ref":"#/components/schemas/cartItemResponse"}},"deliveryWindowId":{"type":"string","deprecated":true,"description":"Delivery window unique identifier, as defined in the Shipping Service.\n\n***NOTE***\nThis attribute is deprecated. Please use the `deliveryWindow` attribute."},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/feeAggregate"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `items[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"totalPrice":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."}],"deprecated":true},"subTotalPrice":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."}],"deprecated":true},"shipping":{"allOf":[{"$ref":"#/components/schemas/shipping"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalShipping` instead. The `unitPrice` field provides the same value with updated functionality."}],"deprecated":true},"taxAggregate":{"allOf":[{"$ref":"#/components/schemas/taxAggregate"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.finalPrice.taxAggregate` instead. The `calculatedPrice.finalPrice.taxAggregate` field provides the same value with updated functionality."}],"deprecated":true},"subtotalAggregate":{"allOf":[{"$ref":"#/components/schemas/subtotalAggregate"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.price` instead. The `calculatedPrice.price` field provides the same value with updated functionality."}],"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},"itemFeesTotal":{"allOf":[{"$ref":"#/components/schemas/total"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFee` instead. The `unitPrice` field provides the same value with updated functionality."}],"deprecated":true},"paymentFeesTotal":{"allOf":[{"$ref":"#/components/schemas/total"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.paymentFees` instead. The `calculatedPrice.paymentFees` field provides the same value with updated functionality."}],"deprecated":true},"totalAuthorizedAmount":{"allOf":[{"$ref":"#/components/schemas/price"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field provides an information how much final price should be increased for card authorization."}],"deprecated":true}}}]},"baseCart":{"type":"object","properties":{"id":{"type":"string","description":"Cart unique identifier generated when a cart is created."},"yrn":{"$ref":"#/components/schemas/YRN"},"restriction":{"$ref":"#/components/schemas/restriction"},"customerId":{"type":"string","description":"Customer unique identifier generated when a customer account is created through the Customer Service."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"orderId":{"type":"string","description":"The identifier of an order generated from this cart."},"quoteId":{"type":"string","description":"Identifier of a quote created from this cart."},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard.","pattern":"[A-Z]{3}","minLength":3,"maxLength":3},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."},"type":{"type":"string","description":"Cart type."},"zipCode":{"type":"string","description":"Customer address - zip code."},"countryCode":{"type":"string","description":"Two-letter country code, compliant with the ISO 3166 standard.","minLength":2,"maxLength":2,"pattern":"[A-Z]{2}"},"addresses":{"type":"array","description":"A list of addresses used in the cart. The list contains one `BILLING` and one `SHIPPING` address `type`.\nIf one of the address `types` is not provided in the request, it is automatically populated in the following order:\n* If the cart has a legal entity, it gets the first location of the legal entity that has both `country` and `zipCode`, and matches the required `type` - then the address has origin=`LEGAL_ENTITY`.\n* Otherwise, if the cart has a logged-in customer, it finds the `default` address that has both `country` and `zipCode`, and matches the required `type`. If there is no matching default address with the required information, it uses the first customer address that meets the criteria. The address has origin=`CUSTOMER`.\n* Otherwise, the cart uses the site homebase address. Then the address has origin=`SITE`.\nThese addresses are used in the tax country code determination [How to determine a tax country at cart level](https://developer.emporix.io/api-references/api-guides/checkout/cart/cart#how-to-determine-a-tax-country-at-cart-level) and shipping cost calculation [How to calculate shipping cost at cart level](https://developer.emporix.io/api-references/api-guides/checkout/cart/cart#how-to-calculate-shipping-cost-at-cart-level).","items":{"$ref":"#/components/schemas/addressResponse"}},"channel":{"$ref":"#/components/schemas/channel"},"calculatedPrice":{"$ref":"#/components/schemas/cartCalculatedPrice"},"discounts":{"type":"array","description":"Discounts applied to the cart.","items":{"$ref":"#/components/schemas/discountResponse"}},"externalDiscounts":{"type":"array","description":"External discounts that should be applied to this cart. Requires the `cart.cart_manage_external_prices` scope.","items":{"$ref":"#/components/schemas/externalCartDiscount"}},"totalUnitsCount":{"type":"number","description":"Total number of items added to the cart.","format":"double"},"sessionId":{"description":"Customer unique session identifier.","type":"string"},"metadata":{"$ref":"#/components/schemas/metadataResponse"},"totalTax":{"$ref":"#/components/schemas/price"},"taxDescription":{"description":"Information about the applied tax.","type":"string"},"mixins":{"type":"object","additionalProperties":true},"leadTime":{"type":"integer","description":"Time needed to prepare the products for the delivery, expressed in hours. Time is calculated based on the products added to the cart. It is equal to the maximum lead time of all the products - `mixins.productCustomAttributes.leadTime`."},"nonDelivery":{"type":"array","description":"List of days on which the products cannot be delivered. Days are presented by numbers where Monday is `0`, Tuesday is `1` etc. `nonDelivery` list is the union of all `mixins.productCustomAttributes.nonDelivery` products values.","items":{"type":"string"}}},"required":["siteCode"]},"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},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the cart.\n\n**Purpose**: Restricts cart visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access carts with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view carts with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**: \n- If cart is created by customer and `restriction` is not set, the `restriction` will be inherited from customer's restriction'.\n- If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with cart's siteCode property.\n"},"deliveryWindow":{"type":"object","properties":{"id":{"type":"string","description":"ID of the delivery window."},"slotId":{"type":"string","description":"ID of the delivery time slot."},"deliveryDate":{"type":"string","format":"date-time","description":"Delivery date. It has to be of \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\" format."}}},"addressResponse":{"type":"object","description":"Information about the carts address used for shipping and tax determination.","additionalProperties":false,"properties":{"origin":{"type":"string","enum":["REQUEST","LEGAL_ENTITY","CUSTOMER","SITE"],"description":"Holds information about the origin of the address. Possible values:\n  * `REQUEST` - provided in create/update cart request\n  * `LEGAL_ENTITY` - automatically populated from from cart's legal entity location\n  * `CUSTOMER` - automatically populated from fetched from customer addresses\n  * `SITE` - automatically populated from sites base address"},"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"legalEntityLocationId":{"type":"string","description":"ID of the legal entity location."},"customerAddressId":{"type":"string","description":"ID of the customer address."},"contactName":{"type":"string","minLength":0,"description":"Contact name."},"companyName":{"type":"string","description":"Company name."},"street":{"type":"string","minLength":0,"description":"Street."},"streetNumber":{"type":"string","description":"Street number."},"streetAppendix":{"type":"string","description":"Street appendix."},"zipCode":{"type":"string","maxLength":11,"minLength":0,"description":"Zip code."},"city":{"type":"string","minLength":0,"description":"City."},"country":{"type":"string","pattern":"[a-zA-Z]{2}","minLength":2,"maxLength":2,"description":"Country."},"state":{"type":"string","description":"State."},"contactPhone":{"type":"string","description":"Contact phone."},"type":{"type":"string","enum":["BILLING","SHIPPING"],"description":"Type of the address data."},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"Mixins object","additionalProperties":true}}},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}},"channel":{"type":"object","description":"Channel through which the cart was created.","properties":{"name":{"type":"string","description":""},"source":{"type":"string"}}},"cartCalculatedPrice":{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components.","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item price values, it means unit prices multiplied by quantity - `items[].calculatedPrice.price`.","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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price, it's the percentage at which an individual or business is taxed. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"upliftValue":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item uplift values. Uplift value is the maximum additional amount to be 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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all line item prices after discounts are calculated. It's included in the response if at least one line item has a discounted price. It's the total amount of discounted prices for items with applied discounts and the original prices for items without discounts. It reflects the total cost of all line items after discounts.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the discounted price, a tax code is a country's set of tax rules. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"fees":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee *before discounts*."}]},"totalFee":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee. It's calculated by summing `items[].calculatedPrice.totalFee` with `paymentFee`. 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 total fee, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the total fee, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the total fee, 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, resulting in the same `taxRate`, the value is present. Otherwise, the field is not returned in the response."},"taxCode":{"type":"string","description":"If all fees have the same `taxCode` defined, the value is present. Otherwise, the field is not returned in the response."},"appliedDiscounts":{"description":"A list of discounts applied to on the line item fees. The payment fee itself is not discountable.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"The sum of all `lines[].calculatedPrice.totalFee[].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 fee."}}}]}}}}]},"shipping":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `shipping` is the value *before discounts*, use totalShipping to get the value after discounts."}]},"totalShipping":{"description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `totalShipping` is the value *after all the discounts*, if any discounts were applied.","allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the shipping cost, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the shipping cost, it's the percentage at which an individual or business is taxed."},"appliedDiscounts":{"description":"A list of discounts applied to shipping.","type":"array","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."}}}]}}}}]},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/calculatedTotalDiscount"},{"type":"object","description":"A summary of all discounts applied at a cart level - sum of `lines[].totalDiscount` and shipping discounts. If there are no discounts applied, 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 all `lines[].calculatedPrice.totalDiscount.value` plus `totalShipping.appliedDiscounts[].value` grouped by the discount ID."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts, ABSOLUTE for monetary amount and FREE_SHIPPING is shipping is fully discounted."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `items[].finalPrice`, `totalShipping`, and `paymentFee`, without the uplift value.","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."},"taxAggregate":{"properties":{"lines":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A list of tax values grouped by `taxCode` and `taxRate`. It includes the sum of `item[].calculatedPrice.discountedPrice` or `item[].calculatedPrice.price`, `item[].calculatedPrice.fees[].discountedPrice` or `item[].calculatedPrice.fees[].price`, `calculatedPrice.totalShipping` and `calculatedPrice.paymentFees`. If any of these values have the same `taxRate` but different `taxCode`, they are listed separately. The aggregation also includes items that do not have a `taxRate` or `taxCode` defined.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the tax, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the tax, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the tax, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to the tax, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the tax, it's the percentage at which an individual or business is taxed."}}}]}}}}}]}}},"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)."}}},"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"}}}},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}},"description":"A price calculation model that includes tax aggregate information."}]},"calculatedTaxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/calculatedPrice"},"description":"List of tax calculations grouped by taxCode and taxRate"}},"description":"Aggregated tax information showing detailed tax calculations"},"discountResponse":{"description":"Discount details.","type":"object","properties":{"id":{"type":"string","description":"Discount's unique identifier."},"yrn":{"$ref":"#/components/schemas/YRN"},"couponYrn":{"$ref":"#/components/schemas/YRN"},"code":{"maxLength":150,"description":"Discount code generated when a discount coupon is created through the Coupon Service.","type":"string"},"amount":{"type":"number","minimum":0,"description":"Discount expressed as fixed amount.","format":"double"},"currency":{"type":"string","pattern":"[A-Z]{3}","description":"Three-letter currency code, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"discountRate":{"type":"number","minimum":0,"description":"Discount expressed as a percentage of the price.","format":"double"},"name":{"maxLength":150,"description":"Discount's displayed name.","type":"string"},"calculationType":{"type":"string","maxLength":30,"default":"ApplyDiscountBeforeTax","description":"Calculation type specifies how the discount should be calculated. Can be set to one of the following:\n* `ApplyDiscountBeforeTax`\n* `ApplyDiscountAfterTax`","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"]},"discountCalculationType":{"type":"string","description":"Determines whether the coupon is applied to the total or subtotal value of the order.","enum":["SUBTOTAL","TOTAL"]},"valid":{"default":true,"description":"Flag indicating whether the discount is valid. \nInvalid discounts are not taken into account when the cart is calculated.","type":"boolean"},"links":{"minItems":2,"type":"array","description":"Links to Coupon Service endpoints used to validate and redeem the discount.","items":{"$ref":"#/components/schemas/link"}},"discountValidationDetails":{"$ref":"#/components/schemas/discountValidationDetails"},"discountIndex":{"type":"integer","description":"The index of the discount. It represents the discount position in the cart discounts array."}},"required":["code"]},"link":{"description":"","type":"object","properties":{"rel":{"type":"string","maxLength":50,"description":"Action to be done using the endpoint provided in the `href` field.","enum":["validate","redeem"]},"title":{"maxLength":100,"description":"Detailed link description.","type":"string"},"href":{"type":"string","maxLength":2000,"description":"Endpoint used to validate or redeem the discount."},"type":{"type":"string","maxLength":500,"description":"Content type."}},"required":["rel","href","type"]},"discountValidationDetails":{"description":"","type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}},"externalCartDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"Indicates the type of discount applied:\n* `PERCENT` — a percentage-based discount\n* `ABSOLUTE` — a fixed monetary amount\n* `FREE_SHIPPING` — shipping is fully discounted"},"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)."},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the discount is applied to the total or subtotal value of the order.\n* `TOTAL` - discount is spread across products with product fees and shipping cost.\n* `SUBTOTAL` - discount is spread across products without 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"]},"metadataResponse":{"type":"object","properties":{"createdAt":{"type":"string","description":"Date and time when the object was created, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"modifiedAt":{"type":"string","description":"Date and time when the object was last modified, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"calculatedAt":{"type":"string","description":"Date and time when the object was last calculated, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"version":{"minimum":1,"type":"integer"},"mixins":{"type":"object","additionalProperties":true}},"required":["createdAt","modifiedAt","version"]},"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":""},"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."},"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."},"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."}}},"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."}]}}},"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."}}},"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."}}}}}}}},"shipping":{"type":"object","properties":{"fee":{"$ref":"#/components/schemas/price"},"total":{"$ref":"#/components/schemas/total"}},"description":"Shipping cost information."},"taxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxAggregateLine"}}}},"taxAggregateLine":{"type":"object","properties":{"name":{"description":"The tax name e.g.: CANADA GST/TPS","type":"string"},"amount":{"type":"number","description":"The tax amount for the line.","format":"double"},"rate":{"type":"number","description":"The tax rate is a percentage between 0 and 100, e.g.: 5.00","format":"double"},"taxable":{"type":"number","description":"The taxable amount.","format":"double"}}},"subtotalAggregate":{"type":"object","properties":{"currency":{"type":"string"},"netValue":{"type":"number"},"grossValue":{"type":"number"},"taxValue":{"type":"number"}}}}}}
```

## The cartDTRestrictions object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"cartDTRestrictions":{"type":"object","properties":{"leadTime":{"type":"integer","description":"Time needed to prepare the products for the delivery, expressed in hours. Time is calculated based on the products added to the cart. It is equal to the maximum lead time of all the products - `mixins.productCustomAttributes.leadTime`."},"nonDelivery":{"type":"array","description":"List of days on which the products cannot be delivered. Days are presented by numbers where Monday is `0`, Tuesday is `1` etc. `nonDelivery` list is the union of all `mixins.productCustomAttributes.nonDelivery` products values.","items":{"type":"string"}}},"description":"Cart delivery time restrictions."}}}}
```

## The cartItemRequest object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}}}}}}
```

## The couponDiscount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}}}}}}
```

## The couponDiscounts object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}}}}}}
```

## The localizedValue object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"localizedValue":{"description":"Localized value which can have different structure which depends on provided `Content-Language` header.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}]}}}}
```

## The externalFee object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"}}]}}}}
```

## The externalDiscountType object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"externalDiscountType":{"type":"string","description":"Type of the external discount.","enum":["PERCENT","ABSOLUTE"]}}}}
```

## The externalDiscount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]}}}}
```

## The externalCartDiscount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"externalCartDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"Indicates the type of discount applied:\n* `PERCENT` — a percentage-based discount\n* `ABSOLUTE` — a fixed monetary amount\n* `FREE_SHIPPING` — shipping is fully discounted"},"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)."},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the discount is applied to the total or subtotal value of the order.\n* `TOTAL` - discount is spread across products with product fees and shipping cost.\n* `SUBTOTAL` - discount is spread across products without 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"]}}}}
```

## The baseCartItemResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]}}}}
```

## The cartItemResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"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."}}}}}}}}}}}
```

## The changeSite object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"changeSite":{"type":"object","properties":{"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."}},"required":["siteCode"]}}}}
```

## The channel object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"channel":{"type":"object","description":"Channel through which the cart was created.","properties":{"name":{"type":"string","description":""},"source":{"type":"string"}}}}}}
```

## The createCart object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"createCart":{"type":"object","description":"","properties":{"customerId":{"maxLength":200,"type":"string","description":"Customer unique identifier generated when a customer account is created through the Customer Service."},"restriction":{"$ref":"#/components/schemas/restriction"},"currency":{"type":"string","pattern":"[A-Z]{3}","minLength":3,"maxLength":3,"description":"Three-letter currency code, compliant with the ISO 4217 standard."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"deliveryWindowId":{"type":"string","description":"Delivery window unique identifier, as defined in the Shipping Service."},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"siteCode":{"default":"default","type":"string","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`."},"type":{"type":"string","description":"Cart type. You can use this field if your store offers different types of carts, such as shopping carts and wishlists."},"channel":{"$ref":"#/components/schemas/channel"},"addresses":{"type":"array","description":"List of addresses that should be associated with the cart and used for tax determination and shipping cost. There can be one address of type `BILLING` and one of type `SHIPPING` - others are ignored. These addresses are returned with the origin `REQUEST` in the cart response.","items":{"$ref":"#/components/schemas/addressRequest"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","additionalProperties":true},"sessionValidated":{"default":false,"description":"If set to `true`, endpoints validate whether the `session-id` used to create the cart matches the `session-id` passed in the request header.\n\n**Note**: The `sessionValidated` parameter only applies to anonymous customer carts.","type":"boolean"}},"required":["currency"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the cart.\n\n**Purpose**: Restricts cart visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access carts with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view carts with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**: \n- If cart is created by customer and `restriction` is not set, the `restriction` will be inherited from customer's restriction'.\n- If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with cart's siteCode property.\n"},"deliveryWindow":{"type":"object","properties":{"id":{"type":"string","description":"ID of the delivery window."},"slotId":{"type":"string","description":"ID of the delivery time slot."},"deliveryDate":{"type":"string","format":"date-time","description":"Delivery date. It has to be of \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\" format."}}},"channel":{"type":"object","description":"Channel through which the cart was created.","properties":{"name":{"type":"string","description":""},"source":{"type":"string"}}},"addressRequest":{"type":"object","description":"Information about the cart address that can be provided in the request.","additionalProperties":false,"properties":{"contactName":{"type":"string","minLength":0,"description":"Contact name."},"companyName":{"type":"string","description":"Company name."},"street":{"type":"string","minLength":0,"description":"Street."},"streetNumber":{"type":"string","description":"Street number."},"streetAppendix":{"type":"string","description":"Street appendix."},"zipCode":{"type":"string","maxLength":11,"minLength":0,"description":"Zip code."},"city":{"type":"string","minLength":0,"description":"City."},"country":{"type":"string","pattern":"[a-zA-Z]{2}","minLength":2,"maxLength":2,"description":"Country."},"state":{"type":"string","description":"State."},"contactPhone":{"type":"string","description":"Contact phone."},"type":{"type":"string","enum":["BILLING","SHIPPING"],"description":"Type of the address data","minLength":0},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"Mixins object.","additionalProperties":true}}},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}}}}}
```

## The deliveryWindow object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"deliveryWindow":{"type":"object","properties":{"id":{"type":"string","description":"ID of the delivery window."},"slotId":{"type":"string","description":"ID of the delivery time slot."},"deliveryDate":{"type":"string","format":"date-time","description":"Delivery date. It has to be of \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\" format."}}}}}}
```

## The addressRequest object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"addressRequest":{"type":"object","description":"Information about the cart address that can be provided in the request.","additionalProperties":false,"properties":{"contactName":{"type":"string","minLength":0,"description":"Contact name."},"companyName":{"type":"string","description":"Company name."},"street":{"type":"string","minLength":0,"description":"Street."},"streetNumber":{"type":"string","description":"Street number."},"streetAppendix":{"type":"string","description":"Street appendix."},"zipCode":{"type":"string","maxLength":11,"minLength":0,"description":"Zip code."},"city":{"type":"string","minLength":0,"description":"City."},"country":{"type":"string","pattern":"[a-zA-Z]{2}","minLength":2,"maxLength":2,"description":"Country."},"state":{"type":"string","description":"State."},"contactPhone":{"type":"string","description":"Contact phone."},"type":{"type":"string","enum":["BILLING","SHIPPING"],"description":"Type of the address data","minLength":0},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"Mixins object.","additionalProperties":true}}},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}}}}}
```

## The addressResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"addressResponse":{"type":"object","description":"Information about the carts address used for shipping and tax determination.","additionalProperties":false,"properties":{"origin":{"type":"string","enum":["REQUEST","LEGAL_ENTITY","CUSTOMER","SITE"],"description":"Holds information about the origin of the address. Possible values:\n  * `REQUEST` - provided in create/update cart request\n  * `LEGAL_ENTITY` - automatically populated from from cart's legal entity location\n  * `CUSTOMER` - automatically populated from fetched from customer addresses\n  * `SITE` - automatically populated from sites base address"},"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"legalEntityLocationId":{"type":"string","description":"ID of the legal entity location."},"customerAddressId":{"type":"string","description":"ID of the customer address."},"contactName":{"type":"string","minLength":0,"description":"Contact name."},"companyName":{"type":"string","description":"Company name."},"street":{"type":"string","minLength":0,"description":"Street."},"streetNumber":{"type":"string","description":"Street number."},"streetAppendix":{"type":"string","description":"Street appendix."},"zipCode":{"type":"string","maxLength":11,"minLength":0,"description":"Zip code."},"city":{"type":"string","minLength":0,"description":"City."},"country":{"type":"string","pattern":"[a-zA-Z]{2}","minLength":2,"maxLength":2,"description":"Country."},"state":{"type":"string","description":"State."},"contactPhone":{"type":"string","description":"Contact phone."},"type":{"type":"string","enum":["BILLING","SHIPPING"],"description":"Type of the address data."},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"Mixins object","additionalProperties":true}}},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}}}}}
```

## The createdCart object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"createdCart":{"type":"object","properties":{"cartId":{"type":"string","description":"Cart unique identifier.","minLength":1},"yrn":{"$ref":"#/components/schemas/YRN"}},"required":["cartId","yrn"]},"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}}}}
```

## The createdCartItem object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"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}}}}
```

## The discount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"discount":{"description":"","type":"object","title":"","properties":{"id":{"type":"string","description":"Discount unique identifier."},"couponYrn":{"$ref":"#/components/schemas/YRN"},"code":{"type":"string","maxLength":150,"description":"Discount code generated when a discount coupon is created through the Coupon Service.","minLength":1},"currency":{"type":"string","pattern":"[A-Z]{3}","description":"Three-letter currency code, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"amount":{"type":"number","minimum":0,"description":"Discount expressed as fixed amount.","format":"double"},"name":{"maxLength":150,"description":"Discount displayed name.","type":"string"},"discountRate":{"type":"number","minimum":0,"description":"Discount expressed as a percentage of the price.","format":"double"},"discountCalculationType":{"type":"string","default":"SUBTOTAL","description":"Determines whether the coupon is applied to the total or subtotal value of the order.","enum":["SUBTOTAL","TOTAL"]},"links":{"minItems":2,"type":"array","description":"Links to Coupon Service endpoints used to validate and redeem the discount.","items":{"$ref":"#/components/schemas/link"}},"calculationType":{"type":"string","maxLength":30,"default":"ApplyDiscountBeforeTax","deprecated":true,"enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"],"description":"Calculation type specifies how the discount should be calculated. It can be set to one of the following:\n* `ApplyDiscountBeforeTax`\n* `ApplyDiscountAfterTax`\n\nThe field is **deprecated** and is not used in calculatedPrice fields. The calculated price takes into account site's settings\nwhere:\n* `includesTax=true` results in `ApplyDiscountAfterTax`\n* `includesTax=false` results in `ApplyDiscountBeforeTax`"}},"required":["code"]},"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},"link":{"description":"","type":"object","properties":{"rel":{"type":"string","maxLength":50,"description":"Action to be done using the endpoint provided in the `href` field.","enum":["validate","redeem"]},"title":{"maxLength":100,"description":"Detailed link description.","type":"string"},"href":{"type":"string","maxLength":2000,"description":"Endpoint used to validate or redeem the discount."},"type":{"type":"string","maxLength":500,"description":"Content type."}},"required":["rel","href","type"]}}}}
```

## The discountResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"discountResponse":{"description":"Discount details.","type":"object","properties":{"id":{"type":"string","description":"Discount's unique identifier."},"yrn":{"$ref":"#/components/schemas/YRN"},"couponYrn":{"$ref":"#/components/schemas/YRN"},"code":{"maxLength":150,"description":"Discount code generated when a discount coupon is created through the Coupon Service.","type":"string"},"amount":{"type":"number","minimum":0,"description":"Discount expressed as fixed amount.","format":"double"},"currency":{"type":"string","pattern":"[A-Z]{3}","description":"Three-letter currency code, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"discountRate":{"type":"number","minimum":0,"description":"Discount expressed as a percentage of the price.","format":"double"},"name":{"maxLength":150,"description":"Discount's displayed name.","type":"string"},"calculationType":{"type":"string","maxLength":30,"default":"ApplyDiscountBeforeTax","description":"Calculation type specifies how the discount should be calculated. Can be set to one of the following:\n* `ApplyDiscountBeforeTax`\n* `ApplyDiscountAfterTax`","enum":["ApplyDiscountBeforeTax","ApplyDiscountAfterTax"]},"discountCalculationType":{"type":"string","description":"Determines whether the coupon is applied to the total or subtotal value of the order.","enum":["SUBTOTAL","TOTAL"]},"valid":{"default":true,"description":"Flag indicating whether the discount is valid. \nInvalid discounts are not taken into account when the cart is calculated.","type":"boolean"},"links":{"minItems":2,"type":"array","description":"Links to Coupon Service endpoints used to validate and redeem the discount.","items":{"$ref":"#/components/schemas/link"}},"discountValidationDetails":{"$ref":"#/components/schemas/discountValidationDetails"},"discountIndex":{"type":"integer","description":"The index of the discount. It represents the discount position in the cart discounts array."}},"required":["code"]},"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},"link":{"description":"","type":"object","properties":{"rel":{"type":"string","maxLength":50,"description":"Action to be done using the endpoint provided in the `href` field.","enum":["validate","redeem"]},"title":{"maxLength":100,"description":"Detailed link description.","type":"string"},"href":{"type":"string","maxLength":2000,"description":"Endpoint used to validate or redeem the discount."},"type":{"type":"string","maxLength":500,"description":"Content type."}},"required":["rel","href","type"]},"discountValidationDetails":{"description":"","type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}}
```

## The discountValidationDetails object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"discountValidationDetails":{"description":"","type":"object","properties":{"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}}
```

## The fee object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]},"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},"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"}}},"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."}}}}}}
```

## The feeAggregate object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]},"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},"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"}}},"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."}}}}}}
```

## The link object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"link":{"description":"","type":"object","properties":{"rel":{"type":"string","maxLength":50,"description":"Action to be done using the endpoint provided in the `href` field.","enum":["validate","redeem"]},"title":{"maxLength":100,"description":"Detailed link description.","type":"string"},"href":{"type":"string","maxLength":2000,"description":"Endpoint used to validate or redeem the discount."},"type":{"type":"string","maxLength":500,"description":"Content type."}},"required":["rel","href","type"]}}}}
```

## The measurementUnit object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]}}}}
```

## The mergeCart object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"mergeCart":{"type":"object","description":"","properties":{"carts":{"minItems":1,"type":"array","description":"List of anonymous carts to merge with the customer cart.","items":{"type":"string"}}},"required":["carts"]}}}}
```

## The metadataRequest object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}}}}}
```

## The metadataResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"metadataResponse":{"type":"object","properties":{"createdAt":{"type":"string","description":"Date and time when the object was created, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"modifiedAt":{"type":"string","description":"Date and time when the object was last modified, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"calculatedAt":{"type":"string","description":"Date and time when the object was last calculated, compliant with the ISO 8601 format.","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?$"},"version":{"minimum":1,"type":"integer"},"mixins":{"type":"object","additionalProperties":true}},"required":["createdAt","modifiedAt","version"]}}}}
```

## The price object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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":""}}}}
```

## The priceRow object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]},"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},"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"]}}}}
```

## The priceRowItem object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]},"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},"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"]}}}}
```

## The product object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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}}}}}}
```

## The cartItemResponseProduct object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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}}},"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}}},"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"]}}}}
```

## The vendor object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]}}}}
```

## The productImage object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}}}}
```

## The singleBatchResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"singleBatchResponse":{"description":"","type":"object","properties":{"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}}}}
```

## The shipping object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"shipping":{"type":"object","properties":{"fee":{"$ref":"#/components/schemas/price"},"total":{"$ref":"#/components/schemas/total"}},"description":"Shipping cost information."},"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":""},"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"}}}}}}
```

## The taxAggregate object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"taxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxAggregateLine"}}}},"taxAggregateLine":{"type":"object","properties":{"name":{"description":"The tax name e.g.: CANADA GST/TPS","type":"string"},"amount":{"type":"number","description":"The tax amount for the line.","format":"double"},"rate":{"type":"number","description":"The tax rate is a percentage between 0 and 100, e.g.: 5.00","format":"double"},"taxable":{"type":"number","description":"The taxable amount.","format":"double"}}}}}}
```

## The subtotalAggregate object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"subtotalAggregate":{"type":"object","properties":{"currency":{"type":"string"},"netValue":{"type":"number"},"grossValue":{"type":"number"},"taxValue":{"type":"number"}}}}}}
```

## The taxAggregateLine object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"taxAggregateLine":{"type":"object","properties":{"name":{"description":"The tax name e.g.: CANADA GST/TPS","type":"string"},"amount":{"type":"number","description":"The tax amount for the line.","format":"double"},"rate":{"type":"number","description":"The tax rate is a percentage between 0 and 100, e.g.: 5.00","format":"double"},"taxable":{"type":"number","description":"The taxable amount.","format":"double"}}}}}}
```

## The taxValue object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}}}}}}
```

## The taxValueWithQuantity object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}}}}}}
```

## The total object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"}}}}}}
```

## The updateCart object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"updateCart":{"type":"object","description":"","properties":{"customerId":{"type":"string","description":"Customer unique identifier generated when a customer account is created through the Customer Service."},"restriction":{"$ref":"#/components/schemas/restriction"},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3,"pattern":"[A-Z]{3}"},"legalEntityId":{"type":"string","description":"ID of the legal entity to which customer is assigned."},"deliveryWindowId":{"type":"string","description":"Delivery window unique identifier, as defined in the Shipping Service."},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"type":{"type":"string","description":"Cart type. You can use this field if your store offers different types of carts, such as shopping carts and wishlists."},"zipCode":{"maxLength":9,"type":"string","description":"Customer address - zip code."},"countryCode":{"type":"string","pattern":"[a-zA-Z]{2}","description":"Two-letter country code, compliant with the ISO 3166 standard.","minLength":2,"maxLength":2},"orderId":{"type":"string","description":"Order unique identifier generated when a checkout is triggered through the Checkout Service."},"quoteId":{"type":"string","description":"Quote unique identifier generated when a quote is created through the Quote Service out of a cart."},"status":{"type":"string","description":"Cart status.","enum":["OPEN","CLOSED"]},"channel":{"$ref":"#/components/schemas/channel"},"externalDiscounts":{"type":"array","description":"External discounts that should be applied to this cart. Requires `cart.cart_manage_external_prices` scope","items":{"$ref":"#/components/schemas/externalCartDiscount"}},"addresses":{"type":"array","description":"List of addresses that should be associated with the cart and used for tax determination and shipping cost. There can be one address of type `BILLING` and one of type `SHIPPING` - others are ignored. These addresses are returned with the origin `REQUEST` in the cart response.","items":{"$ref":"#/components/schemas/addressRequest"}},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","additionalProperties":true}}},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the cart.\n\n**Purpose**: Restricts cart visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access carts with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view carts with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**: \n- If cart is created by customer and `restriction` is not set, the `restriction` will be inherited from customer's restriction'.\n- If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with cart's siteCode property.\n"},"deliveryWindow":{"type":"object","properties":{"id":{"type":"string","description":"ID of the delivery window."},"slotId":{"type":"string","description":"ID of the delivery time slot."},"deliveryDate":{"type":"string","format":"date-time","description":"Delivery date. It has to be of \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\" format."}}},"channel":{"type":"object","description":"Channel through which the cart was created.","properties":{"name":{"type":"string","description":""},"source":{"type":"string"}}},"externalCartDiscount":{"type":"object","description":"External discount that can be applied to cart items.","properties":{"id":{"type":"string","description":"Unique identifier of the external discount."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"Indicates the type of discount applied:\n* `PERCENT` — a percentage-based discount\n* `ABSOLUTE` — a fixed monetary amount\n* `FREE_SHIPPING` — shipping is fully discounted"},"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)."},"discountCalculationType":{"type":"string","enum":["TOTAL","SUBTOTAL"],"description":"Determines whether the discount is applied to the total or subtotal value of the order.\n* `TOTAL` - discount is spread across products with product fees and shipping cost.\n* `SUBTOTAL` - discount is spread across products without 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"]},"addressRequest":{"type":"object","description":"Information about the cart address that can be provided in the request.","additionalProperties":false,"properties":{"contactName":{"type":"string","minLength":0,"description":"Contact name."},"companyName":{"type":"string","description":"Company name."},"street":{"type":"string","minLength":0,"description":"Street."},"streetNumber":{"type":"string","description":"Street number."},"streetAppendix":{"type":"string","description":"Street appendix."},"zipCode":{"type":"string","maxLength":11,"minLength":0,"description":"Zip code."},"city":{"type":"string","minLength":0,"description":"City."},"country":{"type":"string","pattern":"[a-zA-Z]{2}","minLength":2,"maxLength":2,"description":"Country."},"state":{"type":"string","description":"State."},"contactPhone":{"type":"string","description":"Contact phone."},"type":{"type":"string","enum":["BILLING","SHIPPING"],"description":"Type of the address data","minLength":0},"metadata":{"$ref":"#/components/schemas/metadataRequest"},"mixins":{"type":"object","description":"Mixins object.","additionalProperties":true}}},"metadataRequest":{"type":"object","description":"","properties":{"mixins":{"type":"object","description":"Links to mixin schemas.","additionalProperties":true}}}}}}
```

## The updateCartItem object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"]}}}}
```

## The updateProduct object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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}}}}}}
```

## The cartItemsBatchRequest object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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}}},"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."}}}}}}
```

## The batchResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"batchResponse":{"type":"array","description":"","items":{"$ref":"#/components/schemas/singleBatchResponse"}},"singleBatchResponse":{"description":"","type":"object","properties":{"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}}}}
```

## The cartItemsRequest object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"cartItemsRequest":{"type":"array","items":{"$ref":"#/components/schemas/cartItemRequest"},"description":"List of items added to cart."},"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."}}}}}}
```

## The ErrorMessage object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"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"}}}}}}
```

## The YRN object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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}}}}
```

## The itemType object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"itemType":{"type":"string","enum":["EXTERNAL","INTERNAL"]}}}}
```

## The totalDiscount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"totalDiscount":{"type":"object","properties":{"amount":{"type":"number","format":"double","description":"Total discount amount."},"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":"Total discount information."}}}}
```

## The calculatedPrice object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}}}}
```

## The calculatedPriceWithDiscounts object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}]},"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."},"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)."}}}}}}
```

## The calculatedPriceWithTaxAggregate object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}},"description":"A price calculation model that includes tax aggregate information."}]},"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."},"calculatedTaxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/calculatedPrice"},"description":"List of tax calculations grouped by taxCode and taxRate"}},"description":"Aggregated tax information showing detailed tax calculations"}}}}
```

## The calculatedTaxAggregate object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"calculatedTaxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/calculatedPrice"},"description":"List of tax calculations grouped by taxCode and taxRate"}},"description":"Aggregated tax information showing detailed tax calculations"},"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."}}}}
```

## The cartCalculatedPrice object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"cartCalculatedPrice":{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components.","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item price values, it means unit prices multiplied by quantity - `items[].calculatedPrice.price`.","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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price, it's the percentage at which an individual or business is taxed. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"upliftValue":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all line item uplift values. Uplift value is the maximum additional amount to be 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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"discountedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all line item prices after discounts are calculated. It's included in the response if at least one line item has a discounted price. It's the total amount of discounted prices for items with applied discounts and the original prices for items without discounts. It reflects the total cost of all line items after discounts.","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the discounted price, a tax code is a country's set of tax rules. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."},"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. If all fees have the same taxRate, then the value is present. Otherwise, the field is not returned."}}}]},"fees":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee *before discounts*."}]},"totalFee":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The sum of all fees applied on the line items plus the payment fee. It's calculated by summing `items[].calculatedPrice.totalFee` with `paymentFee`. 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 total fee, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the total fee, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the total fee, 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, resulting in the same `taxRate`, the value is present. Otherwise, the field is not returned in the response."},"taxCode":{"type":"string","description":"If all fees have the same `taxCode` defined, the value is present. Otherwise, the field is not returned in the response."},"appliedDiscounts":{"description":"A list of discounts applied to on the line item fees. The payment fee itself is not discountable.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedAppliedDiscount"},{"type":"object","properties":{"id":{"type":"string","description":"Discount identifier."},"value":{"type":"number","format":"double","description":"The sum of all `lines[].calculatedPrice.totalFee[].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 fee."}}}]}}}}]},"shipping":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `shipping` is the value *before discounts*, use totalShipping to get the value after discounts."}]},"totalShipping":{"description":"The total shipping cost is calculated by summing `items[].calculatedPrice.price.grossValue` for shipping estimation. `GrossValue` is used because, even for zero-tax items, it remains equal to `netValue`. The `totalShipping` is the value *after all the discounts*, if any discounts were applied.","allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value after applying discounts."},"grossValue":{"type":"number","format":"double","description":"The gross value after applying discounts."},"taxValue":{"type":"number","format":"double","description":"The difference between `grossValue` and `netValue`."},"taxCode":{"type":"string","description":"Tax code applied to the shipping cost, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the shipping cost, it's the percentage at which an individual or business is taxed."},"appliedDiscounts":{"description":"A list of discounts applied to shipping.","type":"array","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."}}}]}}}}]},"totalDiscount":{"allOf":[{"$ref":"#/components/schemas/calculatedTotalDiscount"},{"type":"object","description":"A summary of all discounts applied at a cart level - sum of `lines[].totalDiscount` and shipping discounts. If there are no discounts applied, 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 all `lines[].calculatedPrice.totalDiscount.value` plus `totalShipping.appliedDiscounts[].value` grouped by the discount ID."},"discountType":{"type":"string","enum":["PERCENT","ABSOLUTE","FREE_SHIPPING"],"description":"PERCENT for percentage discounts, ABSOLUTE for monetary amount and FREE_SHIPPING is shipping is fully discounted."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `items[].finalPrice`, `totalShipping`, and `paymentFee`, without the uplift value.","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."},"taxAggregate":{"properties":{"lines":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A list of tax values grouped by `taxCode` and `taxRate`. It includes the sum of `item[].calculatedPrice.discountedPrice` or `item[].calculatedPrice.price`, `item[].calculatedPrice.fees[].discountedPrice` or `item[].calculatedPrice.fees[].price`, `calculatedPrice.totalShipping` and `calculatedPrice.paymentFees`. If any of these values have the same `taxRate` but different `taxCode`, they are listed separately. The aggregation also includes items that do not have a `taxRate` or `taxCode` defined.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the tax, value without tax."},"grossValue":{"type":"number","format":"double","description":"Gross value of the tax, value with tax."},"taxValue":{"type":"number","format":"double","description":"Tax value of the tax, it's the actual amount of tax that has to be paid."},"taxCode":{"type":"string","description":"Tax code applied to the tax, a tax code is a country's set of tax rules."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the tax, it's the percentage at which an individual or business is taxed."}}}]}}}}}]}}},"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)."}}},"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"}}}},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}},"description":"A price calculation model that includes tax aggregate information."}]},"calculatedTaxAggregate":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/calculatedPrice"},"description":"List of tax calculations grouped by taxCode and taxRate"}},"description":"Aggregated tax information showing detailed tax calculations"}}}}
```

## The calculatedFee object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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."}]}}},"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)."}}}}}}
```

## The calculatedPaymentFee object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"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."}]}}},"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."}}}}
```

## The itemCalculatedPrice object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"}}}}}}}
```

## The cartItemsResponse object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"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."}}}}}}}}}}}
```

## The calculatedAppliedDiscount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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)."}}},"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."}}}}
```

## The calculatedTotalDiscount object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"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"}}}},"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."},"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)."}}}}}}
```

## The cartValidationResult object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"cartValidationResult":{"type":"object","description":"Result of cart validation showing any errors in the cart items.","properties":{"isValid":{"type":"boolean","description":"Flag indicating if the cart is valid or contains validation errors."},"itemsValidationDetails":{"type":"array","description":"Detailed list of validation errors for specific cart items.","items":{"$ref":"#/components/schemas/itemValidationDetails"}}}},"itemValidationDetails":{"type":"object","description":"Validation details for a specific cart item.","properties":{"id":{"type":"string","description":"Identifier of the cart item."},"errors":{"type":"array","description":"List of validation errors for this cart item.","items":{"$ref":"#/components/schemas/validationError"}}}},"validationError":{"type":"object","description":"Details of a specific validation error.","properties":{"errorCode":{"type":"string","description":"Error code for the validation issue. Common codes include: - CART-ITEM-UNIT-PRICE-100001: Item's price was not found in the price match - CART-ITEM-UNIT-PRICE-100002: Duplicated prices found for the same product - CART-ITEM-EXTERNAL-DISCOUNT-100001: Invalid external discount configuration - CART-ITEM-EXTERNAL-DISCOUNT-100002: External discount amount exceeds item price\n"},"message":{"type":"string","description":"Human-readable message describing the error."},"field":{"type":"string","description":"Field path where the error occurred."}}}}}}
```

## The itemValidationDetails object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"itemValidationDetails":{"type":"object","description":"Validation details for a specific cart item.","properties":{"id":{"type":"string","description":"Identifier of the cart item."},"errors":{"type":"array","description":"List of validation errors for this cart item.","items":{"$ref":"#/components/schemas/validationError"}}}},"validationError":{"type":"object","description":"Details of a specific validation error.","properties":{"errorCode":{"type":"string","description":"Error code for the validation issue. Common codes include: - CART-ITEM-UNIT-PRICE-100001: Item's price was not found in the price match - CART-ITEM-UNIT-PRICE-100002: Duplicated prices found for the same product - CART-ITEM-EXTERNAL-DISCOUNT-100001: Invalid external discount configuration - CART-ITEM-EXTERNAL-DISCOUNT-100002: External discount amount exceeds item price\n"},"message":{"type":"string","description":"Human-readable message describing the error."},"field":{"type":"string","description":"Field path where the error occurred."}}}}}}
```

## The validationError object

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"components":{"schemas":{"validationError":{"type":"object","description":"Details of a specific validation error.","properties":{"errorCode":{"type":"string","description":"Error code for the validation issue. Common codes include: - CART-ITEM-UNIT-PRICE-100001: Item's price was not found in the price match - CART-ITEM-UNIT-PRICE-100002: Duplicated prices found for the same product - CART-ITEM-EXTERNAL-DISCOUNT-100001: Invalid external discount configuration - CART-ITEM-EXTERNAL-DISCOUNT-100002: External discount amount exceeds item price\n"},"message":{"type":"string","description":"Human-readable message describing the error."},"field":{"type":"string","description":"Field path where the error occurred."}}}}}}
```
