# Carts

Manage Carts

## Retrieving cart details by criteria

> Retrieves cart details based on the store's site code and criteria such as session ID or customer ID. \
> \
> As a response only one cart is returned, so all required criteria needs to be provided to fetch the unique cart. Uniqueness of the cart is defined by combination of \`siteCode\`, \`type\`, \`legalEntityId\` and  (\`sessionId\` or \`customerId\`)\
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]},{"OAuth2":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer"},"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}}},"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"}}},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts":{"get":{"responses":{"200":{"description":"The request was successful. Cart details are returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cart"}}}},"400":{"$ref":"#/components/responses/trait_400"},"401":{"$ref":"#/components/responses/trait_401"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Retrieves cart details based on the store's site code and criteria such as session ID or customer ID. \n\nAs a response only one cart is returned, so all required criteria needs to be provided to fetch the unique cart. Uniqueness of the cart is defined by combination of `siteCode`, `type`, `legalEntityId` and  (`sessionId` or `customerId`)\n***\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"GET-cart-retrieve-cart-by-criteria","parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"schema":{"type":"string"},"in":"query","name":"sessionId","description":"Customer unique session identifier.\n\n**Note**: The `sessionId` is only required if you want to retrieve an anonymous customer cart.\n"},{"schema":{"type":"string"},"in":"query","name":"customerId","description":"Customer unique identifier generated when a customer account is created.\n\n**Note**: The `customerId` is only required if you want to create a cart for a logged in customer.\n"},{"schema":{"type":"string"},"in":"query","name":"siteCode","required":true,"description":"Site unique identifier. A site is a specific shop. \n\nIf the tenant owns only one shop, the value should be set to `main`.\n"},{"schema":{"type":"string"},"in":"query","name":"legalEntityId","required":false,"description":"ID of the legal entity to which customer is assigned. Should not be provided for B2C business model. \n\n**Note**: The query param is optional, but if not provided, the cart without legalEntity assigned is returned.\n"},{"schema":{"type":"boolean"},"in":"query","name":"create","description":"If set to `true` and no cart exists for the specified criteria, a new cart will be created."},{"schema":{"type":"string"},"name":"type","in":"query","required":false,"description":"Type of the cart. \n\n**Note**: The query param is optional, but if not provided then only cart without `type` is returned.\n"},{"name":"zipCode","in":"query","description":"The zip code of the shipping address, used for tax calculations, shipping cost estimations, and pricing. Must be provided together with `countryCode` if either of the parameters is specified. If the cart already has both (`zipCode` and `countyCode`) address values, the request parameters are ignored. If the cart is missing either value, request parameters are used to fill the missing one.","required":false,"schema":{"type":"string","minLength":1,"maxLength":9}},{"name":"countryCode","in":"query","description":"The country code of the shipping address, used for tax calculations, shipping cost estimations, and pricing. Must be provided together with `zipCode` if either of the parameters is specified. If the cart already has both (`zipCode` and `countyCode`) address values, the request parameters are ignored. If the cart is missing either value, request parameters are used to fill the missing one.","required":false,"schema":{"type":"string","minLength":2,"maxLength":2}}],"summary":"Retrieving cart details by criteria","tags":["Carts"]}}}}
```

## Creating a new cart

> Creates a new cart. When a cart is created, its status is set to \`open\`.\
> \
> \*\*Note\*\*: A customer can have multiple carts opened, but they have to be of a different type. The cart type is specified in the payload in the \`type\` property. It allows for different types of carts, such as shopping carts and wishlists.\
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.\
> &#x20;     Use when you want to create a cart for a logged in customer.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]},{"OAuth2":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer"},"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}}},"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},"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"}}},"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}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_conflict_409":{"description":"The request could not be completed due to a conflict with the current state of the target resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts":{"post":{"responses":{"201":{"description":"The request was successful. Cart details are returned.","headers":{"Location":{"description":"Location of the newly created cart.","schema":{"type":"string"}},"Version":{"schema":{"type":"integer"},"description":"Cart version."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createdCart"}}}},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"409":{"$ref":"#/components/responses/trait_conflict_409"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Creates a new cart. When a cart is created, its status is set to `open`.\n\n**Note**: A customer can have multiple carts opened, but they have to be of a different type. The cart type is specified in the payload in the `type` property. It allows for different types of carts, such as shopping carts and wishlists.\n***\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.\n      Use when you want to create a cart for a logged in customer.","operationId":"POST-cart-create-cart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createCart"}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"schema":{"type":"string"},"in":"header","name":"session-id","description":"Anonymous customer unique session identifier.\n\n**Note**: The `session-id` is only required if you want to create a cart for an anonymous customer.\n"},{"schema":{"type":"string"},"in":"header","name":"saas-token","description":"Customer `saasToken` generated when the customer token is generated. \n\n**Note**: The `saas-token` is only required if you want to create a cart for a logged in customer.\n"}],"summary":"Creating a new cart","tags":["Carts"]}}}}
```

## Searching for carts

> Returns all carts that match provided criteria.\
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]},{"OAuth2":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer"},"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}}},"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"}}},"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"]},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"pageSize":{"schema":{"type":"string"},"in":"query","name":"pageSize","description":"The number of documents to be retrieved per page."},"pageNumber":{"schema":{"type":"string"},"in":"query","name":"pageNumber","description":"The page number to be retrieved. The size of the pages should be specified by the pageSize parameter."},"sort":{"schema":{"type":"string"},"in":"query","name":"sort","description":"List of properties used to sort the results, separated by colons."},"fields":{"schema":{"type":"string"},"in":"query","name":"fields","description":"Fields to be returned in the response."},"xTotalCount":{"schema":{"type":"boolean"},"in":"header","name":"X-Total-Count","description":"Flag indicating whether the total number of retrieved results should be returned."}}},"paths":{"/cart/{tenant}/carts/search":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/search"}}}},"responses":{"200":{"description":"The request was successful. Carts are returned.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/cartGetAll"}}}}},"400":{"$ref":"#/components/responses/trait_400"},"401":{"$ref":"#/components/responses/trait_401"},"403":{"$ref":"#/components/responses/trait_403"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Returns all carts that match provided criteria.\n***\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"POST-cart-retrieve-carts-by-search","parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageNumber"},{"$ref":"#/components/parameters/sort"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/xTotalCount"}],"summary":"Searching for carts","tags":["Carts"]}}}}
```

## Retrieving cart details by ID

> Retrieves specified cart details.\
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"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"}}},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}":{"get":{"responses":{"200":{"description":"The request was successful. Cart details are returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cart"}}}},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Retrieves specified cart details.\n***\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"GET-cart-retrieve-cart-by-cartId","parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"schema":{"type":"boolean","default":true},"in":"query","name":"expandCalculation","description":"If set to `true`, a fully calculated cart is returned."},{"name":"zipCode","in":"query","description":"The zip code of the shipping address, used for tax calculations, shipping cost estimations, and pricing. Must be provided together with `countryCode` if either of the parameters is specified. If the cart already has both (`zipCode` and `countryCode`) address values, the request parameters are ignored. If the cart is missing either value, request parameters are used to fill the missing one.","required":false,"schema":{"type":"string","minLength":1,"maxLength":9}},{"name":"countryCode","in":"query","description":"The country code of the shipping address, used for tax calculations, shipping cost estimations, and pricing. Must be provided together with `zipCode` if either of the parameters is specified. If the cart already has both (`zipCode` and `countryCode`) address values, the request parameters are ignored. If the cart is missing either value, request parameters are used to fill the missing one.","required":false,"schema":{"type":"string","minLength":2,"maxLength":2}}],"summary":"Retrieving cart details by ID","tags":["Carts"]}}}}
```

## Updating a cart

> Updates specified cart details.\
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_conflict_409":{"description":"The request could not be completed due to a conflict with the current state of the target resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}},"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}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}":{"put":{"responses":{"204":{"description":"The request was successful. The cart has been updated."},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"409":{"$ref":"#/components/responses/trait_conflict_409"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Updates specified cart details.\n***\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"PUT-cart-update-cart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateCart"}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Updating a cart","tags":["Carts"]}}}}
```

## Deleting a cart

> Deletes a specified cart.\
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

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

## Refreshing a cart

> Refreshes a specified cart and their items. In case the prices assigned to cart items have been changed then these changes are recognized and reassigned to the cart.\
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_conflict_409":{"description":"The request could not be completed due to a conflict with the current state of the target resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/refresh":{"put":{"responses":{"204":{"description":"The request was successful. The cart has been refreshed."},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"409":{"$ref":"#/components/responses/trait_conflict_409"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Refreshes a specified cart and their items. In case the prices assigned to cart items have been changed then these changes are recognized and reassigned to the cart.\n***\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"PUT-cart-refresh-cart","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Refreshing a cart","tags":["Carts"]}}}}
```

## Changing a cart site

> Changes a specified cart site. The following cart settings are changed according to the new site:\
> \* Language\
> \* Currency\
> \* Shipment\
> \* Tax\
> \* Payment\
> \
> In case the new site uses a different currency, the endpoint sends a price match request to the Price Service. This ensures that items in cart display correct prices in the new site's currency.\
> \*\*\*\
> \
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}},"changeSite":{"type":"object","properties":{"siteCode":{"type":"string","description":"Site unique identifier. A site is a specific shop."}},"required":["siteCode"]}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/changeSite":{"post":{"responses":{"200":{"description":"All item's currencies are updated."},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Changes a specified cart site. The following cart settings are changed according to the new site:\n* Language\n* Currency\n* Shipment\n* Tax\n* Payment\n\nIn case the new site uses a different currency, the endpoint sends a price match request to the Price Service. This ensures that items in cart display correct prices in the new site's currency.\n***\n\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"POST-cart-change-cart-site","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/changeSite"}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Changing a cart site","tags":["Carts"]}}}}
```

## Changing a cart currency

> Changes a specified cart currency. The endpoint sends a price match request to the Price Service. This ensures that items in cart display correct prices in the new currency.\
> \*\*\*\
> \
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/changeCurrency":{"post":{"responses":{"200":{"description":"All item's currencies are updated."},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Changes a specified cart currency. The endpoint sends a price match request to the Price Service. This ensures that items in cart display correct prices in the new currency.\n***\n\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"POST-cart-change-cart-currency","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string"}}}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Changing a cart currency","tags":["Carts"]}}}}
```

## Merging carts

> Merges a list of anonymous carts with the specified customer cart.\
> \
> \*\*Note\*\*: The cart specified in the path parameter must belong to a logged in customer. Carts listed in the request body must belong to anonymous customers.\
> \*\*\*\
> \
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}},"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"]}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/merge":{"post":{"responses":{"200":{"description":"The request was successful. Carts have been merged."},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Merges a list of anonymous carts with the specified customer cart.\n\n**Note**: The cart specified in the path parameter must belong to a logged in customer. Carts listed in the request body must belong to anonymous customers.\n***\n\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"POST-cart-merge-carts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/mergeCart"}}},"required":false,"description":""},"parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Merging carts","tags":["Carts"]}}}}
```

## Retrieving lead time and non-delivery times for a cart

> Retrieves the lead time and non-delivery times for a specified cart. \
> \*\*\*\
> \
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"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."},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/dtRestrictions":{"get":{"responses":{"200":{"description":"The request was successful. Cart lead time and non delivery times are returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartDTRestrictions"}}}},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Retrieves the lead time and non-delivery times for a specified cart. \n***\n\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"GET-cart-retrieve-lead-time-and-non-delivery-times","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Retrieving lead time and non-delivery times for a cart","tags":["Carts"]}}}}
```

## Validating cart items

> Validates the cart items, checking for pricing issues and other potential problems.\
> \
> The endpoint checks for two specific validation issues:\
> 1\. \*\*CART-ITEM-UNIT-PRICE-100001\*\* - Returns this error when a cart contains a price that is no longer valid or not found in the price match.\
> 2\. \*\*CART-ITEM-UNIT-PRICE-100002\*\* - Returns this error when there are duplicated prices for the same product in the cart.\
> \
> \*\*\*\
> \### Required scopes\
> \
> \*  \`cart.cart\_manage\`\
> \
> &#x20;   \*\*Note\*\*: This scope is only required for OAuth2 authorization method to authorize the request with the \`access\_token\`.

```json
{"openapi":"3.0.0","info":{"title":"Cart Service","version":"0.0.1"},"tags":[{"name":"Carts","description":"Manage Carts"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]},{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"cart.cart_manage":"Needed to manage carts."}}}},"CustomerAccessToken":{"type":"http","scheme":"bearer"}},"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."}}},"ErrorMessage":{"title":"error","description":"Schema for API-specific errors.","type":"object","properties":{"code":{"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"status":{"description":"HTTP Status","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"}}}},"responses":{"trait_400":{"description":"The request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_notFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"trait_500":{"description":"Some server-side error occurred. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"cartId":{"name":"cartId","in":"path","required":true,"schema":{"type":"string"},"description":"Cart unique identifier generated when a cart is created."},"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/cart/{tenant}/carts/{cartId}/validate":{"get":{"responses":{"200":{"description":"The request was successful. Returns the validation status of the cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/cartValidationResult"}}}},"400":{"$ref":"#/components/responses/trait_400"},"403":{"$ref":"#/components/responses/trait_403"},"404":{"$ref":"#/components/responses/trait_notFound_404"},"500":{"$ref":"#/components/responses/trait_500"}},"description":"Validates the cart items, checking for pricing issues and other potential problems.\n\nThe endpoint checks for two specific validation issues:\n1. **CART-ITEM-UNIT-PRICE-100001** - Returns this error when a cart contains a price that is no longer valid or not found in the price match.\n2. **CART-ITEM-UNIT-PRICE-100002** - Returns this error when there are duplicated prices for the same product in the cart.\n\n***\n### Required scopes\n\n*  `cart.cart_manage`\n\n    **Note**: This scope is only required for OAuth2 authorization method to authorize the request with the `access_token`.","operationId":"GET-cart-validate","parameters":[{"$ref":"#/components/parameters/cartId"},{"$ref":"#/components/parameters/trait_tenant"}],"summary":"Validating cart items","tags":["Carts"]}}}}
```
