{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emporix/main/json-schema/emporix-cart-item-response-schema.json",
  "title": "cartItemResponse",
  "description": "Cart item details.",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-cart-openapi.yml#/components/schemas/cartItemResponse",
  "allOf": [
    {
      "$ref": "#/$defs/baseCartItemResponse"
    },
    {
      "type": "object",
      "properties": {
        "price": {
          "allOf": [
            {
              "$ref": "#/$defs/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": "#/$defs/taxValueWithQuantity"
            }
          ],
          "description": "Externally calculated total tax for the item line. Only allowed when `itemType = EXTERNAL`.",
          "required": [
            "netValue",
            "grossValue",
            "rate",
            "quantity"
          ]
        },
        "couponDiscounts": {
          "allOf": [
            {
              "$ref": "#/$defs/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": "#/$defs/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": "#/$defs/taxValue"
          }
        },
        "fees": {
          "allOf": [
            {
              "$ref": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/externalFee"
          }
        }
      },
      "required": [
        "quantity",
        "effectiveQuantity"
      ]
    }
  ],
  "$defs": {
    "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
    },
    "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": "#/$defs/YRN"
        },
        "product": {
          "$ref": "#/$defs/cartItemResponseProduct"
        },
        "itemYrn": {
          "$ref": "#/$defs/YRN"
        },
        "type": {
          "$ref": "#/$defs/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": "#/$defs/itemCalculatedPrice"
        },
        "taxCode": {
          "description": "Tax code. Tax indicated in this field overrides the site's default tax value.",
          "type": "string"
        },
        "unitPrice": {
          "allOf": [
            {
              "$ref": "#/$defs/calculatedPrice"
            },
            {
              "type": "object",
              "description": "Product unit price with tax values"
            }
          ]
        },
        "totalTax": {
          "type": "number",
          "minimum": 0,
          "description": "Product total tax amount.",
          "format": "double"
        },
        "metadata": {
          "$ref": "#/$defs/metadataRequest"
        },
        "mixins": {
          "type": "object",
          "additionalProperties": true
        },
        "externalDiscounts": {
          "type": "array",
          "description": "External discounts applied to this cart item.",
          "items": {
            "$ref": "#/$defs/externalDiscount"
          }
        }
      },
      "required": [
        "quantity",
        "effectiveQuantity"
      ],
      "description": "Cart item details."
    },
    "calculatedAppliedDiscount": {
      "title": "calculatedAppliedDiscount",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID of the applied discount."
        },
        "value": {
          "type": "number",
          "format": "double",
          "description": "The calculated value of the discount."
        },
        "price": {
          "allOf": [
            {
              "$ref": "#/$defs/calculatedPrice"
            },
            {
              "type": "object",
              "description": "Applied discount's price. When discount is applied before tax the value equals `price.netValue` and `price.grossValue` for discount applied after tax."
            }
          ]
        },
        "discountType": {
          "type": "string",
          "enum": [
            "PERCENT",
            "ABSOLUTE",
            "FREE_SHIPPING"
          ],
          "description": "The discount type which shows how the discount was calculated. PERCENT refers to a percentage discount for example 10%. ABSOLUTE is a monetary amount."
        },
        "origin": {
          "type": "string",
          "enum": [
            "INTERNAL",
            "EXTERNAL"
          ],
          "description": "Indicates whether the discount is from internal coupon (INTERNAL) or external discount (EXTERNAL)."
        }
      }
    },
    "calculatedFee": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the fee."
        },
        "origin": {
          "enum": [
            "INTERNAL",
            "EXTERNAL"
          ],
          "type": "string",
          "description": "INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the cart"
        },
        "type": {
          "type": "string",
          "enum": [
            "PERCENT",
            "ABSOLUTE",
            "ABSOLUTE_MULTIPLY_ITEMQUANTITY"
          ],
          "description": "Type of the fee."
        },
        "name": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Localized names of the fee."
        },
        "price": {
          "allOf": [
            {
              "$ref": "#/$defs/calculatedPrice"
            },
            {
              "type": "object",
              "description": "The calculated fee price."
            }
          ]
        },
        "discountedPrice": {
          "allOf": [
            {
              "$ref": "#/$defs/calculatedPriceWithDiscounts"
            },
            {
              "type": "object",
              "description": "The discounted fee value."
            }
          ]
        }
      }
    },
    "calculatedPrice": {
      "type": "object",
      "properties": {
        "netValue": {
          "type": "number",
          "format": "double",
          "description": "Net value of the price, price without tax."
        },
        "grossValue": {
          "type": "number",
          "format": "double",
          "description": "Gross value of the price, price with tax."
        },
        "taxValue": {
          "type": "number",
          "format": "double",
          "description": "Tax value of the price, it's the actual amount of tax that has to be paid."
        },
        "taxCode": {
          "type": "string",
          "description": "Tax code applied to the price, a tax code is a country's set of tax rules."
        },
        "taxRate": {
          "type": "number",
          "format": "double",
          "description": "Tax rate applied to the price, it's the percentage at which an individual or business is taxed."
        }
      },
      "description": "A price calculation model containing net and gross amounts along with their associated tax details."
    },
    "calculatedPriceWithDiscounts": {
      "allOf": [
        {
          "$ref": "#/$defs/calculatedPrice"
        },
        {
          "type": "object",
          "properties": {
            "appliedDiscounts": {
              "type": "array",
              "description": "List of applied discounts for the calculated price.",
              "items": {
                "$ref": "#/$defs/calculatedAppliedDiscount"
              }
            }
          },
          "description": "A price calculation model showing the final amount after applying discounts."
        }
      ]
    },
    "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": "#/$defs/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": "#/$defs/calculatedAppliedDiscount"
          }
        }
      }
    },
    "cartItemResponseProduct": {
      "allOf": [
        {
          "$ref": "#/$defs/product"
        },
        {
          "type": "object",
          "properties": {
            "vendor": {
              "$ref": "#/$defs/vendor"
            }
          }
        }
      ]
    },
    "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."
        }
      }
    },
    "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": "#/$defs/couponDiscount"
      }
    },
    "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": "#/$defs/externalDiscountType"
        },
        "value": {
          "type": "number",
          "format": "double",
          "minimum": 0.0,
          "maximum": 100.0,
          "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"
      ]
    },
    "externalFee": {
      "type": "object",
      "required": [
        "feeType"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the fee."
        },
        "name": {
          "allOf": [
            {
              "$ref": "#/$defs/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."
                  }
                }
              }
            }
          }
        }
      }
    },
    "fee": {
      "title": "fee",
      "type": "object",
      "properties": {
        "yrn": {
          "$ref": "#/$defs/YRN"
        },
        "name": {
          "$ref": "#/$defs/localizedValue"
        },
        "taxCode": {
          "type": "string"
        },
        "amount": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "description": ""
        },
        "totalTax": {
          "type": "number",
          "format": "double",
          "minimum": 0
        },
        "total": {
          "$ref": "#/$defs/total"
        },
        "taxValues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/taxValue"
          }
        }
      },
      "required": [
        "amount",
        "totalTax",
        "total"
      ]
    },
    "feeAggregate": {
      "type": "object",
      "properties": {
        "elements": {
          "description": "",
          "type": "array",
          "items": {
            "$ref": "#/$defs/fee"
          }
        },
        "total": {
          "$ref": "#/$defs/total"
        }
      }
    },
    "itemCalculatedPrice": {
      "type": "object",
      "properties": {
        "price": {
          "allOf": [
            {
              "$ref": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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": "#/$defs/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."
        }
      }
    },
    "itemType": {
      "type": "string",
      "enum": [
        "EXTERNAL",
        "INTERNAL"
      ]
    },
    "localizedValue": {
      "description": "Localized value which can have different structure which depends on provided `Content-Language` header.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      ]
    },
    "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"
      ]
    },
    "metadataRequest": {
      "type": "object",
      "description": "",
      "properties": {
        "mixins": {
          "type": "object",
          "description": "Links to mixin schemas.",
          "additionalProperties": true
        }
      }
    },
    "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": ""
    },
    "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": "#/$defs/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": "#/$defs/measurementUnit"
        }
      },
      "required": [
        "priceId",
        "originalAmount",
        "effectiveAmount",
        "currency"
      ]
    },
    "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": "#/$defs/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": "#/$defs/productImage"
          }
        },
        "metadata": {
          "$ref": "#/$defs/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."
    },
    "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."
        }
      }
    },
    "taxValueWithQuantity": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/taxValue"
        },
        {
          "type": "object",
          "properties": {
            "quantity": {
              "type": "number",
              "description": "Represents the item quantity for which the external `lineTax` was provided."
            }
          }
        }
      ],
      "required": [
        "rate",
        "grossValue",
        "netValue"
      ]
    },
    "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"
        }
      }
    },
    "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"
      ]
    }
  }
}