# Orders (Tenant Managed)

Manage tenant orders.

## Retrieving orders

> Retrieves tenant orders for administrative purposes. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_read","order.order_read_by_vendor","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"salesOrders":{"title":"Sales Orders","description":"The collection of orders created by employees.","type":"array","items":{"$ref":"#/components/schemas/salesOrder"}},"salesOrder":{"allOf":[{"type":"object","properties":{"id":{"description":"Order's unique identifier.","type":"string"},"quoteId":{"description":"Identifier of the quote from which the order has been created","type":"string"},"createdBy":{"description":"Order's creator name.","type":"string"},"assistedBuying":{"$ref":"#/components/schemas/assistedBuying"},"checkout":{"type":"boolean","description":"Indicates whether this order was created through checkout. Available in tenant-managed responses only.\n\nWhen set to `true`, only one order can be created per cart ID — enforcing that a checkout cart results in a single order.\nOrders created through the checkout flow have this flag set to `true` by default.\n"}}},{"$ref":"#/components/schemas/orderUpdateDto"}]},"assistedBuying":{"title":"assistedBuying","type":"object","properties":{"entries":{"type":"array","description":"List of operations done by an employee on behalf of a customer.","items":{"$ref":"#/components/schemas/assistedBuyingEntry"}}},"description":"The field is populated only if an assisted buying operation was performed. The field is read-only. There is no possibility to update it by PUT/PATCH operation."},"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"'Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`'","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}},"orderUpdateDto":{"title":"Order Update DTO","type":"object","allOf":[{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/channel"},"created":{"description":"Order's creation date.","type":"string"},"completed":{"description":"Order's completion date.","type":"string"},"lastStatusChange":{"description":"Order last status change date.","type":"string"},"shipments":{"description":"Shipment list.","type":"array","items":{"$ref":"#/components/schemas/shipment"}}}},{"$ref":"#/components/schemas/orderCommonDto"}]},"channel":{"title":"Channel","type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"}}},"shipment":{"title":"Shipment","description":"Shippment details.","type":"object","properties":{"shippedDate":{"description":"Shipped date.","type":"string"},"carrier":{"description":"Carrier.","type":"string"},"trackingNumber":{"description":"Tracking number.","type":"string"},"expectDeliveryOn":{"description":"Expected delivery date.","type":"string"}},"required":["shippedDate","carrier"]},"orderCommonDto":{"title":"Order Common DTO","description":"The base order fields. This object is inherited by all of other order objects as Order Creation DTO, Order Update DTO etc.","type":"object","properties":{"restriction":{"$ref":"#/components/schemas/restriction"},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `entries[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"status":{"$ref":"#/components/schemas/orderStatus"},"cartId":{"type":"string","description":"The identifier of a cart that was used to create this order."},"vendor":{"$ref":"#/components/schemas/vendor"},"orderType":{"$ref":"#/components/schemas/splitOrderType"},"masterOrder":{"type":"string","description":"The identifier of a master order. Available on suborders that have been created after splitting the master order."},"splitInfo":{"$ref":"#/components/schemas/splitInfo"},"subOrders":{"type":"array","description":"A list of string IDs for suborders created after a split. Available only on the master order from which the split originated."},"entries":{"description":"Ordered item list.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/orderEntry"}},"discounts":{"description":"Discount list.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"customer":{"$ref":"#/components/schemas/customer"},"siteCode":{"description":"Site's unique identifier. A site is a specific shop.","type":"string"},"countryCode":{"description":"Two-letter country code, compliant with the ISO 3166 standard.","type":"string"},"billingAddress":{"$ref":"#/components/schemas/address"},"shippingAddress":{"$ref":"#/components/schemas/address"},"payments":{"description":"Payment list.","type":"array","items":{"$ref":"#/components/schemas/payment"}},"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},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"subTotalPrice":{"type":"number","deprecated":true,"description":"Order sub total price. **This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"Order total price. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"totalAuthorizedAmount":{"type":"number","description":"The amount that should be authorized with payment provider. It's a sum of `calculatedPrice.finalPrice.grossValue` and `calculatedPrice.upliftValue.grossValue`."},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"orderCycle":{"description":"Order cycle date.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.deliveryCycle` attribute","deprecated":true,"type":"string"},"deliveryWindowId":{"description":"Delivery window's unique identifier.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.id` attribute","type":"string","deprecated":true},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"metadata":{"$ref":"#/components/schemas/metadataMixins"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderCalculatedPrice"},{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components. Can be skipped if deprecated`totalPrice` is provided to preserve backward compatibility"}]},"legalEntityId":{"type":"string","description":"The identifier of the legal entity on whose behalf the order was placed."}},"required":["entries","customer","calculatedPrice"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the order.\n\n**Purpose**: Restricts order visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access orders with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view orders 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**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `siteCode` property.\n"},"aggregateFee":{"type":"object","title":"Aggregate Fee","properties":{"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"elements":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"taxCode":{"type":"string","description":"Tax code of the fee."},"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"value":{"type":"number","description":"Value of the tax."},"rate":{"type":"number","description":"Rate of the tax."}}}}}}}},"required":["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"}}]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"vendor":{"type":"object","properties":{"id":{"type":"string","description":"An identifier of a vendor"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"splitOrderType":{"type":"string","enum":["MASTER_ORDER","SUB_ORDER"],"description":"Available on orders that have been split. For standard orders, the value is `null`. For the original order that was split, the value is `MASTER_ORDER`s, and for the created suborders, the value is `SUB_ORDER`."},"splitInfo":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders. Available only on suborders that had uniqueValue for the split. Not available on master order."}},"description":"Information about how the order was split from the master order."},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"orderEntry":{"title":"Order entry","description":"The ordered item.","type":"object","properties":{"id":{"description":"The ordered item ID.","type":"string"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"fees":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"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},"amount":{"description":"The amount of items.","type":"integer"},"orderedAmount":{"description":"The ordered amount of items.","type":"integer"},"packedAmountInPc":{"description":"The packed amount of items.","type":"integer"},"effectiveQuantity":{"description":"Effective quantity is q calculated average quantity customer is paying for.","type":"number","format":"double"},"originalAmount":{"description":"The original amount. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"originalPrice":{"description":"The original price. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"unitPrice":{"type":"number","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality."},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product's unit price with tax values, can be skipped if deprecated `unitPrice` is provided for backward compatibility."}]},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"},"link":{"description":"Link to product.","type":"string"},"discounts":{"deprecated":true,"description":"The discount list. **This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"The total price of items. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"authorizedAmount":{"description":"The authorized amount. **This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much payment authorization should be increased for given item.","deprecated":true,"type":"number"},"product":{"$ref":"#/components/schemas/product"},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"price":{"$ref":"#/components/schemas/price"},"metadata":{"$ref":"#/components/schemas/mixinsMetadata"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderEntryCalculatedPrice"},{"type":"object","description":"Detailed price calculation for a single line item with all pricing components. Can be skipped if deprecated `totalPrice` is provided for backward compatibility."}]},"priceMatchDetails":{"$ref":"#/components/schemas/priceMatchDetails"},"externalDiscounts":{"type":"array","description":"External discounts applied to this order entry.","items":{"$ref":"#/components/schemas/externalDiscount"}},"externalFees":{"type":"array","description":"External fees applied to this order entry.","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["amount","calculatedUnitPrice","calculatedPrice"]},"YRN":{"type":"string","title":"YRN","description":"In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.\n\nIt is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.","minLength":1},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details.","required":["netValue","grossValue","taxValue"]},"measurementUnit":{"title":"Measurement Unit","description":"The entry measurement unit","type":"object","properties":{"unit":{"description":"Code of the unit, like `kg` or `l`.","type":"string"},"value":{"description":"Quantity of given unit.","type":"number"}},"required":["value"]},"product":{"title":"Product","description":"Product details.","type":"object","properties":{"id":{"description":"Unique identifier of a product.","type":"string"},"sku":{"description":"Product sku.","type":"string"},"code":{"description":"Unique code of a product.","type":"string"},"name":{"description":"Unique name of a product.","type":"string"},"localizedName":{"description":"A product's name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"description":"Product description.","type":"string"},"published":{"description":"Product published flag.","type":"boolean"},"productType":{"description":"Type of the product (BASIC, VARIANT, BUNDLE).","type":"string","enum":["BASIC","VARIANT","BUNDLE"]},"bundledProducts":{"description":"The collection of products assigned to the bundle.","type":"array","items":{"$ref":"#/components/schemas/bundleProduct"}},"images":{"description":"Product images.","type":"array","items":{"$ref":"#/components/schemas/media"}},"vendor":{"$ref":"#/components/schemas/vendor"},"mixins":{"description":"Product additional information.","type":"object","additionalProperties":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"The metadata of the product."}]}}},"bundleProduct":{"title":"Bundle Product","description":"Represents the product used in a bundle.","type":"object","properties":{"amount":{"description":"The number of given products assigned to the bundle.","type":"number"},"productId":{"description":"Id of the product assigned to the bundle.","type":"string"}}},"media":{"title":"Media","description":"The media.","type":"object","properties":{"id":{"description":"Unique identifier of a media file.","type":"string"},"url":{"description":"Media URL.","type":"string"},"stored":{"description":"Media stored flag.","type":"boolean","default":false}}},"mixinsMetadata":{"title":"Product Metadata","description":"Product Metadata","type":"object","additionalProperties":true,"properties":{"mixins":{"description":"A key-value map of mixins, where the mixin name is a key and schema url is a value","type":"object","additionalProperties":true},"version":{"description":"The document version number.","type":"integer"}}},"tax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"}},"required":["total"]},"taxLine":{"title":"taxLine","description":"Tax line details.","type":"object","properties":{"amount":{"description":"Tax line amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Tax code.","type":"string"},"name":{"description":"Tax name.","type":"string"},"rate":{"description":"Tax rate.","type":"number","default":0},"taxable":{"description":"Order's taxable amount.","type":"number"},"sequenceId":{"description":"Sequence ID.","type":"integer","default":0},"inclusive":{"description":"Inclusive flag.","type":"boolean","default":false}},"required":["amount","currency","sequenceId","inclusive"]},"taxTotal":{"title":"Tax total","description":"The tax total tax amount.","type":"object","properties":{"amount":{"description":"Total tax amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"inclusive":{"description":"Total tax inclusive flag.","default":false,"type":"boolean"}},"required":["amount","currency","inclusive"]},"price":{"title":"Price","description":"Price details.","type":"object","properties":{"priceId":{"description":"Id of the price related to order entry.","type":"string"},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the returned prices belongs to any price list."},"effectiveAmount":{"description":"Effective amount is a calculated average item price after a discount.","type":"number"},"originalAmount":{"description":"Oryginal amount is a price set by the merchant.","type":"number"},"currency":{"description":"Currency of the entry price.","type":"string"},"salePrice":{"allOf":[{"$ref":"#/components/schemas/salePrice"},{"type":"object","description":"Attributes of the sale price."}]}}},"salePrice":{"title":"Sale Price","description":"The sale price.","type":"object","properties":{"discountAmount":{"description":"Amount of the discount for sale price promotion.","type":"number"},"discountRate":{"description":"Rate of the discount for sale price promotion.","type":"number"},"description":{"description":"The sale price description.","type":"string"}}},"orderEntryCalculatedPrice":{"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"],"description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the order."},"name":{"type":"object","description":"Fee name."},"price":{"type":"object","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.","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 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/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."}}}]}},"required":["finalPrice"]},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}}]},"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."},"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."},"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."},"origin":{"enum":["INTERNAL","EXTERNAL"],"description":"origin of the fee, `INTERNAL` defined in commerce engine, `EXTERNAL` specified when item is added to the cart."},"price":{"$ref":"#/components/schemas/calculatedPrice"},"discountedPrice":{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"}}},"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.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"priceMatchDetails":{"title":"priceMatchDetails","type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value of the matched price"},"grossValue":{"type":"number","format":"double","description":"The gross value of the matched price"},"taxValue":{"type":"number","format":"double","description":"The calculated tax value"},"taxCode":{"type":"string","description":"The applied tax code"},"taxRate":{"type":"number","format":"double","description":"The applied tax rate"},"taxCountry":{"type":"string","description":"The tax country for which the price was matched"}},"description":"This model represents the price value retrieved from the price service"},"externalDiscount":{"type":"object","description":"External discount that was applied to order 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). For discountType=`PERCENT`, maximum is 100.0; for ABSOLUTE, there is no limit."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount is 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":"#/components/schemas/localizedValue"}],"description":"Fee name."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of the fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of the 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 the fee absolute."},"amount":{"type":"number","description":"Value of the fee absolute."}}},"taxable":{"type":"boolean","description":"It marks whether tax should be included to the fee or not. A taxable fee must have the `taxCode` attribute provided."},"taxCode":{"type":"string","description":"Tax code of the fee."}}},"discount":{"title":"Discount","properties":{"code":{"description":"Discount's code.","type":"string"},"amount":{"description":"Amount of discount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"name":{"description":"Discount's name.","type":"string"},"discountRate":{"description":"Discount's rate.","type":"number"},"calculationType":{"description":"Discount's code.calculation type.","type":"string"},"discountCalculationType":{"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","type":"string","enum":["SUBTOTAL","TOTAL"]},"discountType":{"description":"Discount's type.","type":"string"},"sequenceId":{"description":"Discount's unique sequence ID identifier.","type":"integer"},"link":{"allOf":[{"$ref":"#/components/schemas/reference"},{"type":"object","description":"Link to discount."}]},"categoryRestricted":{"description":"This flag indicates if discount is category restricted.","type":"boolean"},"restrictions":{"allOf":[{"$ref":"#/components/schemas/discountRestrictions"},{"type":"object","description":"The restrictions based on which the discount can be applied."}]}},"required":["code","currency"]},"reference":{"title":"Link","properties":{"id":{"description":"Unique identifier of a link.","type":"string"},"type":{"description":"Link type.","type":"string"},"url":{"description":"URL of the link.","type":"string"}},"required":["id","type","url"]},"discountRestrictions":{"title":"Discount Restrictions","properties":{"validFrom":{"description":"The date from which the discount restriction is valid.","type":"string"},"validUntil":{"description":"The date from which the discount restriction is valid.","type":"string"},"minOrderValue":{"allOf":[{"$ref":"#/components/schemas/discountRestrictionsPrice"},{"type":"object","description":"The minimum order price for which the discount is valid."}]},"includedCategories":{"description":"List of included categories.","type":"array","items":{"type":"string"}},"excludedCategories":{"description":"List of excluded categories.","type":"array","items":{"type":"string"}}}},"discountRestrictionsPrice":{"title":"Discount Restrictions Price","properties":{"amount":{"description":"The amount of discount price","type":"number"},"currency":{"description":"The currency of the price","type":"string"}}},"customer":{"title":"Customer","description":"Customer data. \n\nOne of these properties needs to be provided:\n- `name` for business customers (B2B)\n- `firstName` and `lastName` for individual customers (B2C)\n","properties":{"id":{"description":"Customer's unique identifier.","type":"string","default":"ANONYMOUS"},"name":{"description":"Customer's name.","type":"string"},"title":{"description":"Customer's title.","type":"string"},"firstName":{"description":"Customer's first name.","type":"string"},"middleName":{"description":"Customer's middle name.","type":"string"},"lastName":{"description":"Customer's last name.","type":"string"},"company":{"description":"Company name.","type":"string"},"email":{"description":"Customer's email address.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Customer additional information.","type":"object","additionalProperties":true}},"required":["email"]},"address":{"title":"Address","description":"Customer's address.","type":"object","properties":{"contactName":{"description":"Customer's name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"street":{"description":"Street name.","type":"string"},"streetNumber":{"description":"Street number.","type":"string"},"streetAppendix":{"description":"Street appendix.","type":"string"},"extraLine1":{"description":"Additional address information.","type":"string"},"extraLine2":{"description":"Additional address information.","type":"string"},"extraLine3":{"description":"Additional address information.","type":"string"},"extraLine4":{"description":"Additional address information.","type":"string"},"zipCode":{"description":"Customer's address - zip code.","type":"string"},"city":{"description":"City name.","type":"string"},"state":{"description":"State name.","type":"string"},"country":{"description":"Country name.","type":"string"},"contactPhone":{"description":"Customer's contact phone.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Additional address information.","type":"object","additionalProperties":true}},"required":["contactName","street","city","zipCode","country"]},"payment":{"title":"Payment","description":"Payment details.","type":"object","properties":{"method":{"description":"Payment method.","type":"string"},"status":{"description":"Payment status.","allOf":[{"$ref":"#/components/schemas/paymentStatus"}]},"paymentResponse":{"description":"Payment response.","type":"string"},"paidAmount":{"description":"Paid amount.","type":"number"},"refundAmount":{"description":"Refund amount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"transactionId":{"description":"The ID of the payment transaction.","type":"string"},"redirectUrl":{"description":"Redirect url.","type":"string"},"authorizedAmount":{"description":"Authorized amount.","type":"number"},"provider":{"description":"Payment provider.","type":"string"}},"required":["method","paidAmount","currency"]},"paymentStatus":{"type":"string","enum":["PENDING","AUTHORIZATION_SUCCESS","AUTHORIZATION_FAILURE","CAPTURE_SUCCESS","CAPTURE_FAILURE","SUCCESS","FAILURE","CANCELLATION_SUCCESS","CANCELLATION_FAILURE","REFUND_SUCCESS","REFUND_FAILURE"],"default":"PENDING","description":"Status of the payment."},"shipping":{"description":"Shipping details.","title":"Shipping","type":"object","properties":{"total":{"description":"Total shipping amount.","type":"object","properties":{"amount":{"type":"number","description":"Shipping amount.","default":0},"currency":{"type":"string","description":"Currency of the shipping amount."}}},"lines":{"description":"Shipping line list.","type":"array","items":{"$ref":"#/components/schemas/shippingLine"}}},"required":["total"]},"shippingLine":{"title":"Shipping line","description":"Shipping line.","type":"object","properties":{"amount":{"type":"number","description":"Shipping line amount.","default":0},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Shipping line code.","type":"string"},"name":{"description":"Shipping line name.","type":"string"},"localizedName":{"description":"Shipping line name in a form of a map of translations.","type":"object","additionalProperties":{"type":"string"}},"discounts":{"description":"Shipping line discount.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"tax":{"$ref":"#/components/schemas/shippingTax"},"link":{"$ref":"#/components/schemas/reference"},"shippingTaxCode":{"type":"string"}},"required":["code"]},"shippingTax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"},"rate":{"description":"The rate of the shipping tax","type":"number"}},"required":["total"]},"deliveryWindow":{"title":"Delivery Window","type":"object","properties":{"id":{"type":"string","description":"Id of the delivery window"},"deliveryDate":{"type":"string","format":"date","description":"Delivery date."},"slotId":{"type":"string","description":"ID of the delivery slot"},"deliveryTimeRange":{"$ref":"#/components/schemas/deliveryTimeRange"},"deliveryCycle":{"type":"string","description":"Delivery cycle to which the order is assigned (containing date)"},"deliveryCycleName":{"type":"string","description":"Delivery cycle name to which the order is assigned"}}},"deliveryTimeRange":{"title":"Delivery Time Range","type":"object","properties":{"timeFrom":{"type":"string","format":"time","description":"Start Time"},"timeTo":{"type":"string","format":"time","description":"End Time"}}},"metadataMixins":{"title":"Metadata DTO","type":"object","additionalProperties":true,"properties":{"mixins":{"type":"object","additionalProperties":true},"version":{"type":"integer"}}},"orderCalculatedPrice":{"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 - `entries[].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 any 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 the 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."}}}]},"paymentFees":{"type":"array","description":"The list of payment fees applied to an order. Payment fees are not changed and are not discounted, even when a discount or coupon is applied to the total.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedPaymentFee"},{"type":"object","properties":{"id":{"type":"string","description":"Payment fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the payment fee. PERCENT for the fee’s `feePercentage`` multiplied by sum of line items `finalPrice` plus shipping cost. ABSOLUTE - monetary amount that is assigned to the payment method."},"price":{"description":"Calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"The monetary amount of the fee, depending on the fee type. ABSOLUTE for the value of defined fee’s `feeAbsolute.amount` attribute. The amount is treated as `netValue`. PERCENT, when defined on fee level percentage, `feePercentage` attribute, of sum of all item line’s `finalPrice.netValue` plus cart’s `calculatedPrice.totalShipping.netValue`. If the fee is taxable and has a tax code, the gross value is calculated. Otherwise, `grossValue` is equal to `netValue`."},"grossValue":{"type":"number","format":"double","description":"For a fee where `taxable=true` and a valid `taxCode` is provided, the tax rate associated with that tax code is used to calculate `grossValue`. If the fee is not taxable, `netValue` is equal to `grossValue`."},"taxValue":{"type":"number","format":"double","description":"Tax value of the payment fee, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the `taxCode` provided at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"The tax code defined at the fee level, for example STANDARD. The value must correspond to the available tax codes in the system configuration."}}}}}]}},"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 `entries[].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":{"type":"array","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."}}}]}}}}]},"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 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."}}}]}}}}]},"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":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total shipping cost is calculated by summing `entries[].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.**","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":{"type":"array","description":"A list of discounts applied to shipping.","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."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `entries[].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."}}}]}}}}}]}}},"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"$ref":"#/components/schemas/calculatedPrice"}},"title":"calculatedPaymentFee"},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A price calculation model that includes tax aggregate information.","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}}}]},"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"}},"responses":{"trait_paged_400":{"description":"Request was syntactically incorrect. Details of the error are included in the response payload.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"trait_sortable_sort":{"name":"sort","in":"query","description":"The list of comma-separated properties used to sort the results.\nBy default, the column values are sorted in ascending order.\nCan either be in the form of fieldName or fieldName:asc,fieldName:desc.\nIf you want to sort by localized attributes, you must use the following form:\nfieldName.language or fieldName.language:asc,fieldName.language:desc.\n","schema":{"type":"string"}},"trait_paged_pageNumber":{"name":"pageNumber","in":"query","description":"The page number to be retrieved where the size of the pages must be specified by the pageSize parameter.\nThe number of the first page is 1.\n","schema":{"default":1,"minimum":1,"type":"integer"}},"trait_paged_pageSize":{"name":"pageSize","in":"query","description":"The number of documents being retrieved on the page.\n","schema":{"default":16,"minimum":1,"type":"integer"}},"trait_queryable_q":{"name":"q","in":"query","description":"A standard query parameter is used to search for specific values.\n\n   + Searching for an item by string property: `q=currency:USD` where `currency` is the name of string field and `USD` is its required value.\n   + Searching for items by number-based property:\n     + Searching for items with specific value: `q=tax.total.amount:20`\n     + Searching for items with value greater than: `q=tax.total.amount:>20`\n     + Searching for items with value lower than: `q=tax.total.amount:<20`\n     + Searching for items with value greater or equal than: `q=tax.total.amount:>=20`\n     + Searching for items with value lower or equal than: `q=tax.total.amount:<=20`\n     + Searching for items with within a range of values: `q=tax.total.amount:(>=10 AND <=20)`\\\n   where `tax.total.amount` is name of number-based field and `20` is it's querying value.\n   + Searching for items by date property. All number-based property queries are valid also for dates. In that case the date should be placed within double quotes: `q=created:(>=\"2021-05-18T07:27:27.455Z\" AND <\"2021-05-20T07:27:27.455Z\")`\n   + Searching for items by boolean value: `q=customer.mixins.generalAttributes.invoiceNotDeliveryAddress:true` where `customer.mixins.generalAttributes.invoiceNotDeliveryAddress` is a name of boolean field and 'true' is it`s required value.\n   + Searching for items with non existing or empty property: `q=billingAddress.contactPhone:null` where `billingAddress.contactPhone` is a name of fields that has value `null`.\n   + Searching for items with existing property: `q=mixins.mixinName:exists` where the specific mixin named `mixinName` exists in the database.\n   + Searching for items by multiple specific values: `q=id:(order_id1,order_id2)` where `id` is name of field and strings within a bracket are it's required value.\n   + Searching for items by multiple fields: `q=id:order_id1 status:COMPLETED` where `id` and `status` are the names of fields. All documents that contain given values of these fields are returned. Multiple fields separated by space can be specified. Multiple values for each field can be also specified in a format presented above.\n","schema":{"type":"string"}},"trait_fields":{"name":"fields","in":"query","description":"A list of comma-separated fields names of the Order. If the field is empty then full order is returned. Otherwise, only the indicated fields will be populated in a response.\n","schema":{"type":"string"}}}},"paths":{"/order-v2/{tenant}/salesorders":{"get":{"tags":["Orders (Tenant-managed)"],"summary":"Retrieving orders","description":"Retrieves tenant orders for administrative purposes. To be used by tenant employees.\n","operationId":"GET-order-retrieve-tenant-orders","responses":{"200":{"description":"The request was successful. List of orders with details has been returned.\n","headers":{"X-Total-Count":{"schema":{"type":"number"},"description":"Number of orders matching the specified query\n"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/salesOrders"}}}},"400":{"$ref":"#/components/responses/trait_paged_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"500":{"$ref":"#/components/responses/trait_500"}},"parameters":[{"$ref":"#/components/parameters/trait_sortable_sort"},{"$ref":"#/components/parameters/trait_paged_pageNumber"},{"$ref":"#/components/parameters/trait_paged_pageSize"},{"$ref":"#/components/parameters/trait_queryable_q"},{"$ref":"#/components/parameters/trait_fields"}]}}}}
```

## Creating a new order

> Creates an order by the tenant employee, on behalf of a customer. \
> \
> \*\*Note:\*\* The \`entries.originalAmount\` is DEPRECATED. Use the \`entries.originalPrice\` field instead.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_create"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"resourceLocation":{"title":"Resource location","description":"Resource location is a response object which contains ID and link to created resource.","type":"object","properties":{"id":{"description":"Unique identifier of the created resource.","type":"string"},"yrn":{"$ref":"#/components/schemas/YRN"}}},"YRN":{"type":"string","title":"YRN","description":"In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.\n\nIt is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.","minLength":1},"salesOrderCreationDto":{"title":"Order Creation DTO","allOf":[{"type":"object","description":"The order creation DTO.","properties":{"quoteId":{"description":"Identifier of the quote from which the order has been created","type":"string"},"checkout":{"type":"boolean","description":"Indicates whether this order was created through checkout. Can only be provided when creating an order.\n\nWhen set to `true`, only one order can be created per cart ID — enforcing that a checkout cart results in a single order.\nOrders created through the checkout flow have this flag set to `true` by default.\n"}}},{"$ref":"#/components/schemas/orderCreationDto"}]},"orderCreationDto":{"title":"Order Creation DTO","allOf":[{"type":"object","description":"The order creation DTO.","properties":{"channel":{"$ref":"#/components/schemas/channel"}}},{"$ref":"#/components/schemas/orderCommonDto"}]},"channel":{"title":"Channel","type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"}}},"orderCommonDto":{"title":"Order Common DTO","description":"The base order fields. This object is inherited by all of other order objects as Order Creation DTO, Order Update DTO etc.","type":"object","properties":{"restriction":{"$ref":"#/components/schemas/restriction"},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `entries[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"status":{"$ref":"#/components/schemas/orderStatus"},"cartId":{"type":"string","description":"The identifier of a cart that was used to create this order."},"vendor":{"$ref":"#/components/schemas/vendor"},"orderType":{"$ref":"#/components/schemas/splitOrderType"},"masterOrder":{"type":"string","description":"The identifier of a master order. Available on suborders that have been created after splitting the master order."},"splitInfo":{"$ref":"#/components/schemas/splitInfo"},"subOrders":{"type":"array","description":"A list of string IDs for suborders created after a split. Available only on the master order from which the split originated."},"entries":{"description":"Ordered item list.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/orderEntry"}},"discounts":{"description":"Discount list.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"customer":{"$ref":"#/components/schemas/customer"},"siteCode":{"description":"Site's unique identifier. A site is a specific shop.","type":"string"},"countryCode":{"description":"Two-letter country code, compliant with the ISO 3166 standard.","type":"string"},"billingAddress":{"$ref":"#/components/schemas/address"},"shippingAddress":{"$ref":"#/components/schemas/address"},"payments":{"description":"Payment list.","type":"array","items":{"$ref":"#/components/schemas/payment"}},"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},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"subTotalPrice":{"type":"number","deprecated":true,"description":"Order sub total price. **This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"Order total price. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"totalAuthorizedAmount":{"type":"number","description":"The amount that should be authorized with payment provider. It's a sum of `calculatedPrice.finalPrice.grossValue` and `calculatedPrice.upliftValue.grossValue`."},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"orderCycle":{"description":"Order cycle date.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.deliveryCycle` attribute","deprecated":true,"type":"string"},"deliveryWindowId":{"description":"Delivery window's unique identifier.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.id` attribute","type":"string","deprecated":true},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"metadata":{"$ref":"#/components/schemas/metadataMixins"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderCalculatedPrice"},{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components. Can be skipped if deprecated`totalPrice` is provided to preserve backward compatibility"}]},"legalEntityId":{"type":"string","description":"The identifier of the legal entity on whose behalf the order was placed."}},"required":["entries","customer","calculatedPrice"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the order.\n\n**Purpose**: Restricts order visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access orders with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view orders 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**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `siteCode` property.\n"},"aggregateFee":{"type":"object","title":"Aggregate Fee","properties":{"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"elements":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"taxCode":{"type":"string","description":"Tax code of the fee."},"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"value":{"type":"number","description":"Value of the tax."},"rate":{"type":"number","description":"Rate of the tax."}}}}}}}},"required":["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"}}]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"vendor":{"type":"object","properties":{"id":{"type":"string","description":"An identifier of a vendor"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"splitOrderType":{"type":"string","enum":["MASTER_ORDER","SUB_ORDER"],"description":"Available on orders that have been split. For standard orders, the value is `null`. For the original order that was split, the value is `MASTER_ORDER`s, and for the created suborders, the value is `SUB_ORDER`."},"splitInfo":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders. Available only on suborders that had uniqueValue for the split. Not available on master order."}},"description":"Information about how the order was split from the master order."},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"orderEntry":{"title":"Order entry","description":"The ordered item.","type":"object","properties":{"id":{"description":"The ordered item ID.","type":"string"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"fees":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"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},"amount":{"description":"The amount of items.","type":"integer"},"orderedAmount":{"description":"The ordered amount of items.","type":"integer"},"packedAmountInPc":{"description":"The packed amount of items.","type":"integer"},"effectiveQuantity":{"description":"Effective quantity is q calculated average quantity customer is paying for.","type":"number","format":"double"},"originalAmount":{"description":"The original amount. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"originalPrice":{"description":"The original price. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"unitPrice":{"type":"number","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality."},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product's unit price with tax values, can be skipped if deprecated `unitPrice` is provided for backward compatibility."}]},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"},"link":{"description":"Link to product.","type":"string"},"discounts":{"deprecated":true,"description":"The discount list. **This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"The total price of items. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"authorizedAmount":{"description":"The authorized amount. **This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much payment authorization should be increased for given item.","deprecated":true,"type":"number"},"product":{"$ref":"#/components/schemas/product"},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"price":{"$ref":"#/components/schemas/price"},"metadata":{"$ref":"#/components/schemas/mixinsMetadata"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderEntryCalculatedPrice"},{"type":"object","description":"Detailed price calculation for a single line item with all pricing components. Can be skipped if deprecated `totalPrice` is provided for backward compatibility."}]},"priceMatchDetails":{"$ref":"#/components/schemas/priceMatchDetails"},"externalDiscounts":{"type":"array","description":"External discounts applied to this order entry.","items":{"$ref":"#/components/schemas/externalDiscount"}},"externalFees":{"type":"array","description":"External fees applied to this order entry.","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["amount","calculatedUnitPrice","calculatedPrice"]},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details.","required":["netValue","grossValue","taxValue"]},"measurementUnit":{"title":"Measurement Unit","description":"The entry measurement unit","type":"object","properties":{"unit":{"description":"Code of the unit, like `kg` or `l`.","type":"string"},"value":{"description":"Quantity of given unit.","type":"number"}},"required":["value"]},"product":{"title":"Product","description":"Product details.","type":"object","properties":{"id":{"description":"Unique identifier of a product.","type":"string"},"sku":{"description":"Product sku.","type":"string"},"code":{"description":"Unique code of a product.","type":"string"},"name":{"description":"Unique name of a product.","type":"string"},"localizedName":{"description":"A product's name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"description":"Product description.","type":"string"},"published":{"description":"Product published flag.","type":"boolean"},"productType":{"description":"Type of the product (BASIC, VARIANT, BUNDLE).","type":"string","enum":["BASIC","VARIANT","BUNDLE"]},"bundledProducts":{"description":"The collection of products assigned to the bundle.","type":"array","items":{"$ref":"#/components/schemas/bundleProduct"}},"images":{"description":"Product images.","type":"array","items":{"$ref":"#/components/schemas/media"}},"vendor":{"$ref":"#/components/schemas/vendor"},"mixins":{"description":"Product additional information.","type":"object","additionalProperties":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"The metadata of the product."}]}}},"bundleProduct":{"title":"Bundle Product","description":"Represents the product used in a bundle.","type":"object","properties":{"amount":{"description":"The number of given products assigned to the bundle.","type":"number"},"productId":{"description":"Id of the product assigned to the bundle.","type":"string"}}},"media":{"title":"Media","description":"The media.","type":"object","properties":{"id":{"description":"Unique identifier of a media file.","type":"string"},"url":{"description":"Media URL.","type":"string"},"stored":{"description":"Media stored flag.","type":"boolean","default":false}}},"mixinsMetadata":{"title":"Product Metadata","description":"Product Metadata","type":"object","additionalProperties":true,"properties":{"mixins":{"description":"A key-value map of mixins, where the mixin name is a key and schema url is a value","type":"object","additionalProperties":true},"version":{"description":"The document version number.","type":"integer"}}},"tax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"}},"required":["total"]},"taxLine":{"title":"taxLine","description":"Tax line details.","type":"object","properties":{"amount":{"description":"Tax line amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Tax code.","type":"string"},"name":{"description":"Tax name.","type":"string"},"rate":{"description":"Tax rate.","type":"number","default":0},"taxable":{"description":"Order's taxable amount.","type":"number"},"sequenceId":{"description":"Sequence ID.","type":"integer","default":0},"inclusive":{"description":"Inclusive flag.","type":"boolean","default":false}},"required":["amount","currency","sequenceId","inclusive"]},"taxTotal":{"title":"Tax total","description":"The tax total tax amount.","type":"object","properties":{"amount":{"description":"Total tax amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"inclusive":{"description":"Total tax inclusive flag.","default":false,"type":"boolean"}},"required":["amount","currency","inclusive"]},"price":{"title":"Price","description":"Price details.","type":"object","properties":{"priceId":{"description":"Id of the price related to order entry.","type":"string"},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the returned prices belongs to any price list."},"effectiveAmount":{"description":"Effective amount is a calculated average item price after a discount.","type":"number"},"originalAmount":{"description":"Oryginal amount is a price set by the merchant.","type":"number"},"currency":{"description":"Currency of the entry price.","type":"string"},"salePrice":{"allOf":[{"$ref":"#/components/schemas/salePrice"},{"type":"object","description":"Attributes of the sale price."}]}}},"salePrice":{"title":"Sale Price","description":"The sale price.","type":"object","properties":{"discountAmount":{"description":"Amount of the discount for sale price promotion.","type":"number"},"discountRate":{"description":"Rate of the discount for sale price promotion.","type":"number"},"description":{"description":"The sale price description.","type":"string"}}},"orderEntryCalculatedPrice":{"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"],"description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the order."},"name":{"type":"object","description":"Fee name."},"price":{"type":"object","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.","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 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/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."}}}]}},"required":["finalPrice"]},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}}]},"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."},"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."},"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."},"origin":{"enum":["INTERNAL","EXTERNAL"],"description":"origin of the fee, `INTERNAL` defined in commerce engine, `EXTERNAL` specified when item is added to the cart."},"price":{"$ref":"#/components/schemas/calculatedPrice"},"discountedPrice":{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"}}},"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.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"priceMatchDetails":{"title":"priceMatchDetails","type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value of the matched price"},"grossValue":{"type":"number","format":"double","description":"The gross value of the matched price"},"taxValue":{"type":"number","format":"double","description":"The calculated tax value"},"taxCode":{"type":"string","description":"The applied tax code"},"taxRate":{"type":"number","format":"double","description":"The applied tax rate"},"taxCountry":{"type":"string","description":"The tax country for which the price was matched"}},"description":"This model represents the price value retrieved from the price service"},"externalDiscount":{"type":"object","description":"External discount that was applied to order 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). For discountType=`PERCENT`, maximum is 100.0; for ABSOLUTE, there is no limit."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount is 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":"#/components/schemas/localizedValue"}],"description":"Fee name."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of the fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of the 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 the fee absolute."},"amount":{"type":"number","description":"Value of the fee absolute."}}},"taxable":{"type":"boolean","description":"It marks whether tax should be included to the fee or not. A taxable fee must have the `taxCode` attribute provided."},"taxCode":{"type":"string","description":"Tax code of the fee."}}},"discount":{"title":"Discount","properties":{"code":{"description":"Discount's code.","type":"string"},"amount":{"description":"Amount of discount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"name":{"description":"Discount's name.","type":"string"},"discountRate":{"description":"Discount's rate.","type":"number"},"calculationType":{"description":"Discount's code.calculation type.","type":"string"},"discountCalculationType":{"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","type":"string","enum":["SUBTOTAL","TOTAL"]},"discountType":{"description":"Discount's type.","type":"string"},"sequenceId":{"description":"Discount's unique sequence ID identifier.","type":"integer"},"link":{"allOf":[{"$ref":"#/components/schemas/reference"},{"type":"object","description":"Link to discount."}]},"categoryRestricted":{"description":"This flag indicates if discount is category restricted.","type":"boolean"},"restrictions":{"allOf":[{"$ref":"#/components/schemas/discountRestrictions"},{"type":"object","description":"The restrictions based on which the discount can be applied."}]}},"required":["code","currency"]},"reference":{"title":"Link","properties":{"id":{"description":"Unique identifier of a link.","type":"string"},"type":{"description":"Link type.","type":"string"},"url":{"description":"URL of the link.","type":"string"}},"required":["id","type","url"]},"discountRestrictions":{"title":"Discount Restrictions","properties":{"validFrom":{"description":"The date from which the discount restriction is valid.","type":"string"},"validUntil":{"description":"The date from which the discount restriction is valid.","type":"string"},"minOrderValue":{"allOf":[{"$ref":"#/components/schemas/discountRestrictionsPrice"},{"type":"object","description":"The minimum order price for which the discount is valid."}]},"includedCategories":{"description":"List of included categories.","type":"array","items":{"type":"string"}},"excludedCategories":{"description":"List of excluded categories.","type":"array","items":{"type":"string"}}}},"discountRestrictionsPrice":{"title":"Discount Restrictions Price","properties":{"amount":{"description":"The amount of discount price","type":"number"},"currency":{"description":"The currency of the price","type":"string"}}},"customer":{"title":"Customer","description":"Customer data. \n\nOne of these properties needs to be provided:\n- `name` for business customers (B2B)\n- `firstName` and `lastName` for individual customers (B2C)\n","properties":{"id":{"description":"Customer's unique identifier.","type":"string","default":"ANONYMOUS"},"name":{"description":"Customer's name.","type":"string"},"title":{"description":"Customer's title.","type":"string"},"firstName":{"description":"Customer's first name.","type":"string"},"middleName":{"description":"Customer's middle name.","type":"string"},"lastName":{"description":"Customer's last name.","type":"string"},"company":{"description":"Company name.","type":"string"},"email":{"description":"Customer's email address.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Customer additional information.","type":"object","additionalProperties":true}},"required":["email"]},"address":{"title":"Address","description":"Customer's address.","type":"object","properties":{"contactName":{"description":"Customer's name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"street":{"description":"Street name.","type":"string"},"streetNumber":{"description":"Street number.","type":"string"},"streetAppendix":{"description":"Street appendix.","type":"string"},"extraLine1":{"description":"Additional address information.","type":"string"},"extraLine2":{"description":"Additional address information.","type":"string"},"extraLine3":{"description":"Additional address information.","type":"string"},"extraLine4":{"description":"Additional address information.","type":"string"},"zipCode":{"description":"Customer's address - zip code.","type":"string"},"city":{"description":"City name.","type":"string"},"state":{"description":"State name.","type":"string"},"country":{"description":"Country name.","type":"string"},"contactPhone":{"description":"Customer's contact phone.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Additional address information.","type":"object","additionalProperties":true}},"required":["contactName","street","city","zipCode","country"]},"payment":{"title":"Payment","description":"Payment details.","type":"object","properties":{"method":{"description":"Payment method.","type":"string"},"status":{"description":"Payment status.","allOf":[{"$ref":"#/components/schemas/paymentStatus"}]},"paymentResponse":{"description":"Payment response.","type":"string"},"paidAmount":{"description":"Paid amount.","type":"number"},"refundAmount":{"description":"Refund amount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"transactionId":{"description":"The ID of the payment transaction.","type":"string"},"redirectUrl":{"description":"Redirect url.","type":"string"},"authorizedAmount":{"description":"Authorized amount.","type":"number"},"provider":{"description":"Payment provider.","type":"string"}},"required":["method","paidAmount","currency"]},"paymentStatus":{"type":"string","enum":["PENDING","AUTHORIZATION_SUCCESS","AUTHORIZATION_FAILURE","CAPTURE_SUCCESS","CAPTURE_FAILURE","SUCCESS","FAILURE","CANCELLATION_SUCCESS","CANCELLATION_FAILURE","REFUND_SUCCESS","REFUND_FAILURE"],"default":"PENDING","description":"Status of the payment."},"shipping":{"description":"Shipping details.","title":"Shipping","type":"object","properties":{"total":{"description":"Total shipping amount.","type":"object","properties":{"amount":{"type":"number","description":"Shipping amount.","default":0},"currency":{"type":"string","description":"Currency of the shipping amount."}}},"lines":{"description":"Shipping line list.","type":"array","items":{"$ref":"#/components/schemas/shippingLine"}}},"required":["total"]},"shippingLine":{"title":"Shipping line","description":"Shipping line.","type":"object","properties":{"amount":{"type":"number","description":"Shipping line amount.","default":0},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Shipping line code.","type":"string"},"name":{"description":"Shipping line name.","type":"string"},"localizedName":{"description":"Shipping line name in a form of a map of translations.","type":"object","additionalProperties":{"type":"string"}},"discounts":{"description":"Shipping line discount.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"tax":{"$ref":"#/components/schemas/shippingTax"},"link":{"$ref":"#/components/schemas/reference"},"shippingTaxCode":{"type":"string"}},"required":["code"]},"shippingTax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"},"rate":{"description":"The rate of the shipping tax","type":"number"}},"required":["total"]},"deliveryWindow":{"title":"Delivery Window","type":"object","properties":{"id":{"type":"string","description":"Id of the delivery window"},"deliveryDate":{"type":"string","format":"date","description":"Delivery date."},"slotId":{"type":"string","description":"ID of the delivery slot"},"deliveryTimeRange":{"$ref":"#/components/schemas/deliveryTimeRange"},"deliveryCycle":{"type":"string","description":"Delivery cycle to which the order is assigned (containing date)"},"deliveryCycleName":{"type":"string","description":"Delivery cycle name to which the order is assigned"}}},"deliveryTimeRange":{"title":"Delivery Time Range","type":"object","properties":{"timeFrom":{"type":"string","format":"time","description":"Start Time"},"timeTo":{"type":"string","format":"time","description":"End Time"}}},"metadataMixins":{"title":"Metadata DTO","type":"object","additionalProperties":true,"properties":{"mixins":{"type":"object","additionalProperties":true},"version":{"type":"integer"}}},"orderCalculatedPrice":{"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 - `entries[].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 any 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 the 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."}}}]},"paymentFees":{"type":"array","description":"The list of payment fees applied to an order. Payment fees are not changed and are not discounted, even when a discount or coupon is applied to the total.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedPaymentFee"},{"type":"object","properties":{"id":{"type":"string","description":"Payment fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the payment fee. PERCENT for the fee’s `feePercentage`` multiplied by sum of line items `finalPrice` plus shipping cost. ABSOLUTE - monetary amount that is assigned to the payment method."},"price":{"description":"Calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"The monetary amount of the fee, depending on the fee type. ABSOLUTE for the value of defined fee’s `feeAbsolute.amount` attribute. The amount is treated as `netValue`. PERCENT, when defined on fee level percentage, `feePercentage` attribute, of sum of all item line’s `finalPrice.netValue` plus cart’s `calculatedPrice.totalShipping.netValue`. If the fee is taxable and has a tax code, the gross value is calculated. Otherwise, `grossValue` is equal to `netValue`."},"grossValue":{"type":"number","format":"double","description":"For a fee where `taxable=true` and a valid `taxCode` is provided, the tax rate associated with that tax code is used to calculate `grossValue`. If the fee is not taxable, `netValue` is equal to `grossValue`."},"taxValue":{"type":"number","format":"double","description":"Tax value of the payment fee, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the `taxCode` provided at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"The tax code defined at the fee level, for example STANDARD. The value must correspond to the available tax codes in the system configuration."}}}}}]}},"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 `entries[].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":{"type":"array","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."}}}]}}}}]},"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 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."}}}]}}}}]},"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":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total shipping cost is calculated by summing `entries[].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.**","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":{"type":"array","description":"A list of discounts applied to shipping.","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."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `entries[].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."}}}]}}}}}]}}},"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"$ref":"#/components/schemas/calculatedPrice"}},"title":"calculatedPaymentFee"},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A price calculation model that includes tax aggregate information.","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}}}]},"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"}},"responses":{"trait_billingAware_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_yaasAware_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_resourceLocation_409":{"description":"Creation failed because there was a conflict with another resource. Details of the error are included in the response payload.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/order-v2/{tenant}/salesorders":{"post":{"tags":["Orders (Tenant-managed)"],"summary":"Creating a new order","description":"Creates an order by the tenant employee, on behalf of a customer. \n\n**Note:** The `entries.originalAmount` is DEPRECATED. Use the `entries.originalPrice` field instead.\n","operationId":"POST-order-create-order-employee","responses":{"201":{"description":"The collection resource has been successfully created.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/resourceLocation"}}}},"400":{"$ref":"#/components/responses/trait_billingAware_400"},"403":{"$ref":"#/components/responses/trait_yaasAware_403"},"409":{"$ref":"#/components/responses/trait_resourceLocation_409"},"500":{"$ref":"#/components/responses/trait_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/salesOrderCreationDto"}}},"required":false}}}}}
```

## Retrieving the number of orders

> Retrieves the number of orders for the specified query and siteCode. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_read","order.order_read_by_vendor","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"responses":{"trait_billingAware_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"trait_queryable_q":{"name":"q","in":"query","description":"A standard query parameter is used to search for specific values.\n\n   + Searching for an item by string property: `q=currency:USD` where `currency` is the name of string field and `USD` is its required value.\n   + Searching for items by number-based property:\n     + Searching for items with specific value: `q=tax.total.amount:20`\n     + Searching for items with value greater than: `q=tax.total.amount:>20`\n     + Searching for items with value lower than: `q=tax.total.amount:<20`\n     + Searching for items with value greater or equal than: `q=tax.total.amount:>=20`\n     + Searching for items with value lower or equal than: `q=tax.total.amount:<=20`\n     + Searching for items with within a range of values: `q=tax.total.amount:(>=10 AND <=20)`\\\n   where `tax.total.amount` is name of number-based field and `20` is it's querying value.\n   + Searching for items by date property. All number-based property queries are valid also for dates. In that case the date should be placed within double quotes: `q=created:(>=\"2021-05-18T07:27:27.455Z\" AND <\"2021-05-20T07:27:27.455Z\")`\n   + Searching for items by boolean value: `q=customer.mixins.generalAttributes.invoiceNotDeliveryAddress:true` where `customer.mixins.generalAttributes.invoiceNotDeliveryAddress` is a name of boolean field and 'true' is it`s required value.\n   + Searching for items with non existing or empty property: `q=billingAddress.contactPhone:null` where `billingAddress.contactPhone` is a name of fields that has value `null`.\n   + Searching for items with existing property: `q=mixins.mixinName:exists` where the specific mixin named `mixinName` exists in the database.\n   + Searching for items by multiple specific values: `q=id:(order_id1,order_id2)` where `id` is name of field and strings within a bracket are it's required value.\n   + Searching for items by multiple fields: `q=id:order_id1 status:COMPLETED` where `id` and `status` are the names of fields. All documents that contain given values of these fields are returned. Multiple fields separated by space can be specified. Multiple values for each field can be also specified in a format presented above.\n","schema":{"type":"string"}}}},"paths":{"/order-v2/{tenant}/salesorders":{"head":{"tags":["Orders (Tenant-managed)"],"summary":"Retrieving the number of orders","description":"Retrieves the number of orders for the specified query and siteCode. To be used by tenant employees.\n","operationId":"GET-order-retrieve-specific-orders","responses":{"200":{"description":"The request was successful. Number of orders returned in header.","headers":{"X-Total-Count":{"schema":{"type":"number"},"description":"Number of orders matching the specified query\n"}}},"400":{"$ref":"#/components/responses/trait_billingAware_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"500":{"$ref":"#/components/responses/trait_500"}},"parameters":[{"$ref":"#/components/parameters/trait_queryable_q"}]}}}}
```

## Searching for orders

> Searches for tenant orders for administrative purposes. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_read","order.order_read_by_vendor","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"searchRequest":{"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"}}},"salesOrders":{"title":"Sales Orders","description":"The collection of orders created by employees.","type":"array","items":{"$ref":"#/components/schemas/salesOrder"}},"salesOrder":{"allOf":[{"type":"object","properties":{"id":{"description":"Order's unique identifier.","type":"string"},"quoteId":{"description":"Identifier of the quote from which the order has been created","type":"string"},"createdBy":{"description":"Order's creator name.","type":"string"},"assistedBuying":{"$ref":"#/components/schemas/assistedBuying"},"checkout":{"type":"boolean","description":"Indicates whether this order was created through checkout. Available in tenant-managed responses only.\n\nWhen set to `true`, only one order can be created per cart ID — enforcing that a checkout cart results in a single order.\nOrders created through the checkout flow have this flag set to `true` by default.\n"}}},{"$ref":"#/components/schemas/orderUpdateDto"}]},"assistedBuying":{"title":"assistedBuying","type":"object","properties":{"entries":{"type":"array","description":"List of operations done by an employee on behalf of a customer.","items":{"$ref":"#/components/schemas/assistedBuyingEntry"}}},"description":"The field is populated only if an assisted buying operation was performed. The field is read-only. There is no possibility to update it by PUT/PATCH operation."},"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"'Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`'","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}},"orderUpdateDto":{"title":"Order Update DTO","type":"object","allOf":[{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/channel"},"created":{"description":"Order's creation date.","type":"string"},"completed":{"description":"Order's completion date.","type":"string"},"lastStatusChange":{"description":"Order last status change date.","type":"string"},"shipments":{"description":"Shipment list.","type":"array","items":{"$ref":"#/components/schemas/shipment"}}}},{"$ref":"#/components/schemas/orderCommonDto"}]},"channel":{"title":"Channel","type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"}}},"shipment":{"title":"Shipment","description":"Shippment details.","type":"object","properties":{"shippedDate":{"description":"Shipped date.","type":"string"},"carrier":{"description":"Carrier.","type":"string"},"trackingNumber":{"description":"Tracking number.","type":"string"},"expectDeliveryOn":{"description":"Expected delivery date.","type":"string"}},"required":["shippedDate","carrier"]},"orderCommonDto":{"title":"Order Common DTO","description":"The base order fields. This object is inherited by all of other order objects as Order Creation DTO, Order Update DTO etc.","type":"object","properties":{"restriction":{"$ref":"#/components/schemas/restriction"},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `entries[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"status":{"$ref":"#/components/schemas/orderStatus"},"cartId":{"type":"string","description":"The identifier of a cart that was used to create this order."},"vendor":{"$ref":"#/components/schemas/vendor"},"orderType":{"$ref":"#/components/schemas/splitOrderType"},"masterOrder":{"type":"string","description":"The identifier of a master order. Available on suborders that have been created after splitting the master order."},"splitInfo":{"$ref":"#/components/schemas/splitInfo"},"subOrders":{"type":"array","description":"A list of string IDs for suborders created after a split. Available only on the master order from which the split originated."},"entries":{"description":"Ordered item list.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/orderEntry"}},"discounts":{"description":"Discount list.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"customer":{"$ref":"#/components/schemas/customer"},"siteCode":{"description":"Site's unique identifier. A site is a specific shop.","type":"string"},"countryCode":{"description":"Two-letter country code, compliant with the ISO 3166 standard.","type":"string"},"billingAddress":{"$ref":"#/components/schemas/address"},"shippingAddress":{"$ref":"#/components/schemas/address"},"payments":{"description":"Payment list.","type":"array","items":{"$ref":"#/components/schemas/payment"}},"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},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"subTotalPrice":{"type":"number","deprecated":true,"description":"Order sub total price. **This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"Order total price. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"totalAuthorizedAmount":{"type":"number","description":"The amount that should be authorized with payment provider. It's a sum of `calculatedPrice.finalPrice.grossValue` and `calculatedPrice.upliftValue.grossValue`."},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"orderCycle":{"description":"Order cycle date.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.deliveryCycle` attribute","deprecated":true,"type":"string"},"deliveryWindowId":{"description":"Delivery window's unique identifier.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.id` attribute","type":"string","deprecated":true},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"metadata":{"$ref":"#/components/schemas/metadataMixins"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderCalculatedPrice"},{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components. Can be skipped if deprecated`totalPrice` is provided to preserve backward compatibility"}]},"legalEntityId":{"type":"string","description":"The identifier of the legal entity on whose behalf the order was placed."}},"required":["entries","customer","calculatedPrice"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the order.\n\n**Purpose**: Restricts order visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access orders with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view orders 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**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `siteCode` property.\n"},"aggregateFee":{"type":"object","title":"Aggregate Fee","properties":{"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"elements":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"taxCode":{"type":"string","description":"Tax code of the fee."},"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"value":{"type":"number","description":"Value of the tax."},"rate":{"type":"number","description":"Rate of the tax."}}}}}}}},"required":["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"}}]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"vendor":{"type":"object","properties":{"id":{"type":"string","description":"An identifier of a vendor"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"splitOrderType":{"type":"string","enum":["MASTER_ORDER","SUB_ORDER"],"description":"Available on orders that have been split. For standard orders, the value is `null`. For the original order that was split, the value is `MASTER_ORDER`s, and for the created suborders, the value is `SUB_ORDER`."},"splitInfo":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders. Available only on suborders that had uniqueValue for the split. Not available on master order."}},"description":"Information about how the order was split from the master order."},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"orderEntry":{"title":"Order entry","description":"The ordered item.","type":"object","properties":{"id":{"description":"The ordered item ID.","type":"string"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"fees":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"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},"amount":{"description":"The amount of items.","type":"integer"},"orderedAmount":{"description":"The ordered amount of items.","type":"integer"},"packedAmountInPc":{"description":"The packed amount of items.","type":"integer"},"effectiveQuantity":{"description":"Effective quantity is q calculated average quantity customer is paying for.","type":"number","format":"double"},"originalAmount":{"description":"The original amount. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"originalPrice":{"description":"The original price. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"unitPrice":{"type":"number","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality."},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product's unit price with tax values, can be skipped if deprecated `unitPrice` is provided for backward compatibility."}]},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"},"link":{"description":"Link to product.","type":"string"},"discounts":{"deprecated":true,"description":"The discount list. **This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"The total price of items. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"authorizedAmount":{"description":"The authorized amount. **This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much payment authorization should be increased for given item.","deprecated":true,"type":"number"},"product":{"$ref":"#/components/schemas/product"},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"price":{"$ref":"#/components/schemas/price"},"metadata":{"$ref":"#/components/schemas/mixinsMetadata"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderEntryCalculatedPrice"},{"type":"object","description":"Detailed price calculation for a single line item with all pricing components. Can be skipped if deprecated `totalPrice` is provided for backward compatibility."}]},"priceMatchDetails":{"$ref":"#/components/schemas/priceMatchDetails"},"externalDiscounts":{"type":"array","description":"External discounts applied to this order entry.","items":{"$ref":"#/components/schemas/externalDiscount"}},"externalFees":{"type":"array","description":"External fees applied to this order entry.","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["amount","calculatedUnitPrice","calculatedPrice"]},"YRN":{"type":"string","title":"YRN","description":"In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.\n\nIt is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.","minLength":1},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details.","required":["netValue","grossValue","taxValue"]},"measurementUnit":{"title":"Measurement Unit","description":"The entry measurement unit","type":"object","properties":{"unit":{"description":"Code of the unit, like `kg` or `l`.","type":"string"},"value":{"description":"Quantity of given unit.","type":"number"}},"required":["value"]},"product":{"title":"Product","description":"Product details.","type":"object","properties":{"id":{"description":"Unique identifier of a product.","type":"string"},"sku":{"description":"Product sku.","type":"string"},"code":{"description":"Unique code of a product.","type":"string"},"name":{"description":"Unique name of a product.","type":"string"},"localizedName":{"description":"A product's name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"description":"Product description.","type":"string"},"published":{"description":"Product published flag.","type":"boolean"},"productType":{"description":"Type of the product (BASIC, VARIANT, BUNDLE).","type":"string","enum":["BASIC","VARIANT","BUNDLE"]},"bundledProducts":{"description":"The collection of products assigned to the bundle.","type":"array","items":{"$ref":"#/components/schemas/bundleProduct"}},"images":{"description":"Product images.","type":"array","items":{"$ref":"#/components/schemas/media"}},"vendor":{"$ref":"#/components/schemas/vendor"},"mixins":{"description":"Product additional information.","type":"object","additionalProperties":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"The metadata of the product."}]}}},"bundleProduct":{"title":"Bundle Product","description":"Represents the product used in a bundle.","type":"object","properties":{"amount":{"description":"The number of given products assigned to the bundle.","type":"number"},"productId":{"description":"Id of the product assigned to the bundle.","type":"string"}}},"media":{"title":"Media","description":"The media.","type":"object","properties":{"id":{"description":"Unique identifier of a media file.","type":"string"},"url":{"description":"Media URL.","type":"string"},"stored":{"description":"Media stored flag.","type":"boolean","default":false}}},"mixinsMetadata":{"title":"Product Metadata","description":"Product Metadata","type":"object","additionalProperties":true,"properties":{"mixins":{"description":"A key-value map of mixins, where the mixin name is a key and schema url is a value","type":"object","additionalProperties":true},"version":{"description":"The document version number.","type":"integer"}}},"tax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"}},"required":["total"]},"taxLine":{"title":"taxLine","description":"Tax line details.","type":"object","properties":{"amount":{"description":"Tax line amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Tax code.","type":"string"},"name":{"description":"Tax name.","type":"string"},"rate":{"description":"Tax rate.","type":"number","default":0},"taxable":{"description":"Order's taxable amount.","type":"number"},"sequenceId":{"description":"Sequence ID.","type":"integer","default":0},"inclusive":{"description":"Inclusive flag.","type":"boolean","default":false}},"required":["amount","currency","sequenceId","inclusive"]},"taxTotal":{"title":"Tax total","description":"The tax total tax amount.","type":"object","properties":{"amount":{"description":"Total tax amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"inclusive":{"description":"Total tax inclusive flag.","default":false,"type":"boolean"}},"required":["amount","currency","inclusive"]},"price":{"title":"Price","description":"Price details.","type":"object","properties":{"priceId":{"description":"Id of the price related to order entry.","type":"string"},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the returned prices belongs to any price list."},"effectiveAmount":{"description":"Effective amount is a calculated average item price after a discount.","type":"number"},"originalAmount":{"description":"Oryginal amount is a price set by the merchant.","type":"number"},"currency":{"description":"Currency of the entry price.","type":"string"},"salePrice":{"allOf":[{"$ref":"#/components/schemas/salePrice"},{"type":"object","description":"Attributes of the sale price."}]}}},"salePrice":{"title":"Sale Price","description":"The sale price.","type":"object","properties":{"discountAmount":{"description":"Amount of the discount for sale price promotion.","type":"number"},"discountRate":{"description":"Rate of the discount for sale price promotion.","type":"number"},"description":{"description":"The sale price description.","type":"string"}}},"orderEntryCalculatedPrice":{"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"],"description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the order."},"name":{"type":"object","description":"Fee name."},"price":{"type":"object","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.","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 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/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."}}}]}},"required":["finalPrice"]},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}}]},"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."},"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."},"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."},"origin":{"enum":["INTERNAL","EXTERNAL"],"description":"origin of the fee, `INTERNAL` defined in commerce engine, `EXTERNAL` specified when item is added to the cart."},"price":{"$ref":"#/components/schemas/calculatedPrice"},"discountedPrice":{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"}}},"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.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"priceMatchDetails":{"title":"priceMatchDetails","type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value of the matched price"},"grossValue":{"type":"number","format":"double","description":"The gross value of the matched price"},"taxValue":{"type":"number","format":"double","description":"The calculated tax value"},"taxCode":{"type":"string","description":"The applied tax code"},"taxRate":{"type":"number","format":"double","description":"The applied tax rate"},"taxCountry":{"type":"string","description":"The tax country for which the price was matched"}},"description":"This model represents the price value retrieved from the price service"},"externalDiscount":{"type":"object","description":"External discount that was applied to order 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). For discountType=`PERCENT`, maximum is 100.0; for ABSOLUTE, there is no limit."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount is 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":"#/components/schemas/localizedValue"}],"description":"Fee name."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of the fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of the 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 the fee absolute."},"amount":{"type":"number","description":"Value of the fee absolute."}}},"taxable":{"type":"boolean","description":"It marks whether tax should be included to the fee or not. A taxable fee must have the `taxCode` attribute provided."},"taxCode":{"type":"string","description":"Tax code of the fee."}}},"discount":{"title":"Discount","properties":{"code":{"description":"Discount's code.","type":"string"},"amount":{"description":"Amount of discount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"name":{"description":"Discount's name.","type":"string"},"discountRate":{"description":"Discount's rate.","type":"number"},"calculationType":{"description":"Discount's code.calculation type.","type":"string"},"discountCalculationType":{"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","type":"string","enum":["SUBTOTAL","TOTAL"]},"discountType":{"description":"Discount's type.","type":"string"},"sequenceId":{"description":"Discount's unique sequence ID identifier.","type":"integer"},"link":{"allOf":[{"$ref":"#/components/schemas/reference"},{"type":"object","description":"Link to discount."}]},"categoryRestricted":{"description":"This flag indicates if discount is category restricted.","type":"boolean"},"restrictions":{"allOf":[{"$ref":"#/components/schemas/discountRestrictions"},{"type":"object","description":"The restrictions based on which the discount can be applied."}]}},"required":["code","currency"]},"reference":{"title":"Link","properties":{"id":{"description":"Unique identifier of a link.","type":"string"},"type":{"description":"Link type.","type":"string"},"url":{"description":"URL of the link.","type":"string"}},"required":["id","type","url"]},"discountRestrictions":{"title":"Discount Restrictions","properties":{"validFrom":{"description":"The date from which the discount restriction is valid.","type":"string"},"validUntil":{"description":"The date from which the discount restriction is valid.","type":"string"},"minOrderValue":{"allOf":[{"$ref":"#/components/schemas/discountRestrictionsPrice"},{"type":"object","description":"The minimum order price for which the discount is valid."}]},"includedCategories":{"description":"List of included categories.","type":"array","items":{"type":"string"}},"excludedCategories":{"description":"List of excluded categories.","type":"array","items":{"type":"string"}}}},"discountRestrictionsPrice":{"title":"Discount Restrictions Price","properties":{"amount":{"description":"The amount of discount price","type":"number"},"currency":{"description":"The currency of the price","type":"string"}}},"customer":{"title":"Customer","description":"Customer data. \n\nOne of these properties needs to be provided:\n- `name` for business customers (B2B)\n- `firstName` and `lastName` for individual customers (B2C)\n","properties":{"id":{"description":"Customer's unique identifier.","type":"string","default":"ANONYMOUS"},"name":{"description":"Customer's name.","type":"string"},"title":{"description":"Customer's title.","type":"string"},"firstName":{"description":"Customer's first name.","type":"string"},"middleName":{"description":"Customer's middle name.","type":"string"},"lastName":{"description":"Customer's last name.","type":"string"},"company":{"description":"Company name.","type":"string"},"email":{"description":"Customer's email address.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Customer additional information.","type":"object","additionalProperties":true}},"required":["email"]},"address":{"title":"Address","description":"Customer's address.","type":"object","properties":{"contactName":{"description":"Customer's name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"street":{"description":"Street name.","type":"string"},"streetNumber":{"description":"Street number.","type":"string"},"streetAppendix":{"description":"Street appendix.","type":"string"},"extraLine1":{"description":"Additional address information.","type":"string"},"extraLine2":{"description":"Additional address information.","type":"string"},"extraLine3":{"description":"Additional address information.","type":"string"},"extraLine4":{"description":"Additional address information.","type":"string"},"zipCode":{"description":"Customer's address - zip code.","type":"string"},"city":{"description":"City name.","type":"string"},"state":{"description":"State name.","type":"string"},"country":{"description":"Country name.","type":"string"},"contactPhone":{"description":"Customer's contact phone.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Additional address information.","type":"object","additionalProperties":true}},"required":["contactName","street","city","zipCode","country"]},"payment":{"title":"Payment","description":"Payment details.","type":"object","properties":{"method":{"description":"Payment method.","type":"string"},"status":{"description":"Payment status.","allOf":[{"$ref":"#/components/schemas/paymentStatus"}]},"paymentResponse":{"description":"Payment response.","type":"string"},"paidAmount":{"description":"Paid amount.","type":"number"},"refundAmount":{"description":"Refund amount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"transactionId":{"description":"The ID of the payment transaction.","type":"string"},"redirectUrl":{"description":"Redirect url.","type":"string"},"authorizedAmount":{"description":"Authorized amount.","type":"number"},"provider":{"description":"Payment provider.","type":"string"}},"required":["method","paidAmount","currency"]},"paymentStatus":{"type":"string","enum":["PENDING","AUTHORIZATION_SUCCESS","AUTHORIZATION_FAILURE","CAPTURE_SUCCESS","CAPTURE_FAILURE","SUCCESS","FAILURE","CANCELLATION_SUCCESS","CANCELLATION_FAILURE","REFUND_SUCCESS","REFUND_FAILURE"],"default":"PENDING","description":"Status of the payment."},"shipping":{"description":"Shipping details.","title":"Shipping","type":"object","properties":{"total":{"description":"Total shipping amount.","type":"object","properties":{"amount":{"type":"number","description":"Shipping amount.","default":0},"currency":{"type":"string","description":"Currency of the shipping amount."}}},"lines":{"description":"Shipping line list.","type":"array","items":{"$ref":"#/components/schemas/shippingLine"}}},"required":["total"]},"shippingLine":{"title":"Shipping line","description":"Shipping line.","type":"object","properties":{"amount":{"type":"number","description":"Shipping line amount.","default":0},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Shipping line code.","type":"string"},"name":{"description":"Shipping line name.","type":"string"},"localizedName":{"description":"Shipping line name in a form of a map of translations.","type":"object","additionalProperties":{"type":"string"}},"discounts":{"description":"Shipping line discount.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"tax":{"$ref":"#/components/schemas/shippingTax"},"link":{"$ref":"#/components/schemas/reference"},"shippingTaxCode":{"type":"string"}},"required":["code"]},"shippingTax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"},"rate":{"description":"The rate of the shipping tax","type":"number"}},"required":["total"]},"deliveryWindow":{"title":"Delivery Window","type":"object","properties":{"id":{"type":"string","description":"Id of the delivery window"},"deliveryDate":{"type":"string","format":"date","description":"Delivery date."},"slotId":{"type":"string","description":"ID of the delivery slot"},"deliveryTimeRange":{"$ref":"#/components/schemas/deliveryTimeRange"},"deliveryCycle":{"type":"string","description":"Delivery cycle to which the order is assigned (containing date)"},"deliveryCycleName":{"type":"string","description":"Delivery cycle name to which the order is assigned"}}},"deliveryTimeRange":{"title":"Delivery Time Range","type":"object","properties":{"timeFrom":{"type":"string","format":"time","description":"Start Time"},"timeTo":{"type":"string","format":"time","description":"End Time"}}},"metadataMixins":{"title":"Metadata DTO","type":"object","additionalProperties":true,"properties":{"mixins":{"type":"object","additionalProperties":true},"version":{"type":"integer"}}},"orderCalculatedPrice":{"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 - `entries[].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 any 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 the 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."}}}]},"paymentFees":{"type":"array","description":"The list of payment fees applied to an order. Payment fees are not changed and are not discounted, even when a discount or coupon is applied to the total.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedPaymentFee"},{"type":"object","properties":{"id":{"type":"string","description":"Payment fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the payment fee. PERCENT for the fee’s `feePercentage`` multiplied by sum of line items `finalPrice` plus shipping cost. ABSOLUTE - monetary amount that is assigned to the payment method."},"price":{"description":"Calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"The monetary amount of the fee, depending on the fee type. ABSOLUTE for the value of defined fee’s `feeAbsolute.amount` attribute. The amount is treated as `netValue`. PERCENT, when defined on fee level percentage, `feePercentage` attribute, of sum of all item line’s `finalPrice.netValue` plus cart’s `calculatedPrice.totalShipping.netValue`. If the fee is taxable and has a tax code, the gross value is calculated. Otherwise, `grossValue` is equal to `netValue`."},"grossValue":{"type":"number","format":"double","description":"For a fee where `taxable=true` and a valid `taxCode` is provided, the tax rate associated with that tax code is used to calculate `grossValue`. If the fee is not taxable, `netValue` is equal to `grossValue`."},"taxValue":{"type":"number","format":"double","description":"Tax value of the payment fee, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the `taxCode` provided at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"The tax code defined at the fee level, for example STANDARD. The value must correspond to the available tax codes in the system configuration."}}}}}]}},"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 `entries[].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":{"type":"array","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."}}}]}}}}]},"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 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."}}}]}}}}]},"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":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total shipping cost is calculated by summing `entries[].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.**","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":{"type":"array","description":"A list of discounts applied to shipping.","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."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `entries[].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."}}}]}}}}}]}}},"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"$ref":"#/components/schemas/calculatedPrice"}},"title":"calculatedPaymentFee"},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A price calculation model that includes tax aggregate information.","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}}}]},"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"}},"responses":{"trait_paged_400":{"description":"Request was syntactically incorrect. Details of the error are included in the response payload.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"trait_sortable_sort":{"name":"sort","in":"query","description":"The list of comma-separated properties used to sort the results.\nBy default, the column values are sorted in ascending order.\nCan either be in the form of fieldName or fieldName:asc,fieldName:desc.\nIf you want to sort by localized attributes, you must use the following form:\nfieldName.language or fieldName.language:asc,fieldName.language:desc.\n","schema":{"type":"string"}},"trait_paged_pageNumber":{"name":"pageNumber","in":"query","description":"The page number to be retrieved where the size of the pages must be specified by the pageSize parameter.\nThe number of the first page is 1.\n","schema":{"default":1,"minimum":1,"type":"integer"}},"trait_paged_pageSize":{"name":"pageSize","in":"query","description":"The number of documents being retrieved on the page.\n","schema":{"default":16,"minimum":1,"type":"integer"}},"trait_fields":{"name":"fields","in":"query","description":"A list of comma-separated fields names of the Order. If the field is empty then full order is returned. Otherwise, only the indicated fields will be populated in a response.\n","schema":{"type":"string"}},"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"The tenant that the caller is acting upon.\n\nPlease note that this value is always lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/order-v2/{tenant}/salesorders/search":{"post":{"tags":["Orders (Tenant-managed)"],"summary":"Searching for orders","description":"Searches for tenant orders for administrative purposes. To be used by tenant employees.\n","operationId":"POST-order-tenant-orders-search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/searchRequest"}}}},"responses":{"200":{"description":"The request was successful. List of orders with details has been returned.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/salesOrders"}}}},"400":{"$ref":"#/components/responses/trait_paged_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"500":{"$ref":"#/components/responses/trait_500"}},"parameters":[{"$ref":"#/components/parameters/trait_sortable_sort"},{"$ref":"#/components/parameters/trait_paged_pageNumber"},{"$ref":"#/components/parameters/trait_paged_pageSize"},{"$ref":"#/components/parameters/trait_fields"},{"$ref":"#/components/parameters/trait_tenant"}]}}}}
```

## Retrieving a specific order by ID

> Retrieves a specific order by order ID. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_read","order.order_read_by_vendor","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"salesOrder":{"allOf":[{"type":"object","properties":{"id":{"description":"Order's unique identifier.","type":"string"},"quoteId":{"description":"Identifier of the quote from which the order has been created","type":"string"},"createdBy":{"description":"Order's creator name.","type":"string"},"assistedBuying":{"$ref":"#/components/schemas/assistedBuying"},"checkout":{"type":"boolean","description":"Indicates whether this order was created through checkout. Available in tenant-managed responses only.\n\nWhen set to `true`, only one order can be created per cart ID — enforcing that a checkout cart results in a single order.\nOrders created through the checkout flow have this flag set to `true` by default.\n"}}},{"$ref":"#/components/schemas/orderUpdateDto"}]},"assistedBuying":{"title":"assistedBuying","type":"object","properties":{"entries":{"type":"array","description":"List of operations done by an employee on behalf of a customer.","items":{"$ref":"#/components/schemas/assistedBuyingEntry"}}},"description":"The field is populated only if an assisted buying operation was performed. The field is read-only. There is no possibility to update it by PUT/PATCH operation."},"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"'Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`'","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}},"orderUpdateDto":{"title":"Order Update DTO","type":"object","allOf":[{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/channel"},"created":{"description":"Order's creation date.","type":"string"},"completed":{"description":"Order's completion date.","type":"string"},"lastStatusChange":{"description":"Order last status change date.","type":"string"},"shipments":{"description":"Shipment list.","type":"array","items":{"$ref":"#/components/schemas/shipment"}}}},{"$ref":"#/components/schemas/orderCommonDto"}]},"channel":{"title":"Channel","type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"}}},"shipment":{"title":"Shipment","description":"Shippment details.","type":"object","properties":{"shippedDate":{"description":"Shipped date.","type":"string"},"carrier":{"description":"Carrier.","type":"string"},"trackingNumber":{"description":"Tracking number.","type":"string"},"expectDeliveryOn":{"description":"Expected delivery date.","type":"string"}},"required":["shippedDate","carrier"]},"orderCommonDto":{"title":"Order Common DTO","description":"The base order fields. This object is inherited by all of other order objects as Order Creation DTO, Order Update DTO etc.","type":"object","properties":{"restriction":{"$ref":"#/components/schemas/restriction"},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `entries[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"status":{"$ref":"#/components/schemas/orderStatus"},"cartId":{"type":"string","description":"The identifier of a cart that was used to create this order."},"vendor":{"$ref":"#/components/schemas/vendor"},"orderType":{"$ref":"#/components/schemas/splitOrderType"},"masterOrder":{"type":"string","description":"The identifier of a master order. Available on suborders that have been created after splitting the master order."},"splitInfo":{"$ref":"#/components/schemas/splitInfo"},"subOrders":{"type":"array","description":"A list of string IDs for suborders created after a split. Available only on the master order from which the split originated."},"entries":{"description":"Ordered item list.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/orderEntry"}},"discounts":{"description":"Discount list.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"customer":{"$ref":"#/components/schemas/customer"},"siteCode":{"description":"Site's unique identifier. A site is a specific shop.","type":"string"},"countryCode":{"description":"Two-letter country code, compliant with the ISO 3166 standard.","type":"string"},"billingAddress":{"$ref":"#/components/schemas/address"},"shippingAddress":{"$ref":"#/components/schemas/address"},"payments":{"description":"Payment list.","type":"array","items":{"$ref":"#/components/schemas/payment"}},"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},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"subTotalPrice":{"type":"number","deprecated":true,"description":"Order sub total price. **This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"Order total price. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"totalAuthorizedAmount":{"type":"number","description":"The amount that should be authorized with payment provider. It's a sum of `calculatedPrice.finalPrice.grossValue` and `calculatedPrice.upliftValue.grossValue`."},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"orderCycle":{"description":"Order cycle date.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.deliveryCycle` attribute","deprecated":true,"type":"string"},"deliveryWindowId":{"description":"Delivery window's unique identifier.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.id` attribute","type":"string","deprecated":true},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"metadata":{"$ref":"#/components/schemas/metadataMixins"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderCalculatedPrice"},{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components. Can be skipped if deprecated`totalPrice` is provided to preserve backward compatibility"}]},"legalEntityId":{"type":"string","description":"The identifier of the legal entity on whose behalf the order was placed."}},"required":["entries","customer","calculatedPrice"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the order.\n\n**Purpose**: Restricts order visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access orders with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view orders 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**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `siteCode` property.\n"},"aggregateFee":{"type":"object","title":"Aggregate Fee","properties":{"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"elements":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"taxCode":{"type":"string","description":"Tax code of the fee."},"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"value":{"type":"number","description":"Value of the tax."},"rate":{"type":"number","description":"Rate of the tax."}}}}}}}},"required":["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"}}]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"vendor":{"type":"object","properties":{"id":{"type":"string","description":"An identifier of a vendor"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"splitOrderType":{"type":"string","enum":["MASTER_ORDER","SUB_ORDER"],"description":"Available on orders that have been split. For standard orders, the value is `null`. For the original order that was split, the value is `MASTER_ORDER`s, and for the created suborders, the value is `SUB_ORDER`."},"splitInfo":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders. Available only on suborders that had uniqueValue for the split. Not available on master order."}},"description":"Information about how the order was split from the master order."},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"orderEntry":{"title":"Order entry","description":"The ordered item.","type":"object","properties":{"id":{"description":"The ordered item ID.","type":"string"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"fees":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"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},"amount":{"description":"The amount of items.","type":"integer"},"orderedAmount":{"description":"The ordered amount of items.","type":"integer"},"packedAmountInPc":{"description":"The packed amount of items.","type":"integer"},"effectiveQuantity":{"description":"Effective quantity is q calculated average quantity customer is paying for.","type":"number","format":"double"},"originalAmount":{"description":"The original amount. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"originalPrice":{"description":"The original price. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"unitPrice":{"type":"number","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality."},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product's unit price with tax values, can be skipped if deprecated `unitPrice` is provided for backward compatibility."}]},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"},"link":{"description":"Link to product.","type":"string"},"discounts":{"deprecated":true,"description":"The discount list. **This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"The total price of items. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"authorizedAmount":{"description":"The authorized amount. **This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much payment authorization should be increased for given item.","deprecated":true,"type":"number"},"product":{"$ref":"#/components/schemas/product"},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"price":{"$ref":"#/components/schemas/price"},"metadata":{"$ref":"#/components/schemas/mixinsMetadata"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderEntryCalculatedPrice"},{"type":"object","description":"Detailed price calculation for a single line item with all pricing components. Can be skipped if deprecated `totalPrice` is provided for backward compatibility."}]},"priceMatchDetails":{"$ref":"#/components/schemas/priceMatchDetails"},"externalDiscounts":{"type":"array","description":"External discounts applied to this order entry.","items":{"$ref":"#/components/schemas/externalDiscount"}},"externalFees":{"type":"array","description":"External fees applied to this order entry.","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["amount","calculatedUnitPrice","calculatedPrice"]},"YRN":{"type":"string","title":"YRN","description":"In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.\n\nIt is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.","minLength":1},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details.","required":["netValue","grossValue","taxValue"]},"measurementUnit":{"title":"Measurement Unit","description":"The entry measurement unit","type":"object","properties":{"unit":{"description":"Code of the unit, like `kg` or `l`.","type":"string"},"value":{"description":"Quantity of given unit.","type":"number"}},"required":["value"]},"product":{"title":"Product","description":"Product details.","type":"object","properties":{"id":{"description":"Unique identifier of a product.","type":"string"},"sku":{"description":"Product sku.","type":"string"},"code":{"description":"Unique code of a product.","type":"string"},"name":{"description":"Unique name of a product.","type":"string"},"localizedName":{"description":"A product's name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"description":"Product description.","type":"string"},"published":{"description":"Product published flag.","type":"boolean"},"productType":{"description":"Type of the product (BASIC, VARIANT, BUNDLE).","type":"string","enum":["BASIC","VARIANT","BUNDLE"]},"bundledProducts":{"description":"The collection of products assigned to the bundle.","type":"array","items":{"$ref":"#/components/schemas/bundleProduct"}},"images":{"description":"Product images.","type":"array","items":{"$ref":"#/components/schemas/media"}},"vendor":{"$ref":"#/components/schemas/vendor"},"mixins":{"description":"Product additional information.","type":"object","additionalProperties":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"The metadata of the product."}]}}},"bundleProduct":{"title":"Bundle Product","description":"Represents the product used in a bundle.","type":"object","properties":{"amount":{"description":"The number of given products assigned to the bundle.","type":"number"},"productId":{"description":"Id of the product assigned to the bundle.","type":"string"}}},"media":{"title":"Media","description":"The media.","type":"object","properties":{"id":{"description":"Unique identifier of a media file.","type":"string"},"url":{"description":"Media URL.","type":"string"},"stored":{"description":"Media stored flag.","type":"boolean","default":false}}},"mixinsMetadata":{"title":"Product Metadata","description":"Product Metadata","type":"object","additionalProperties":true,"properties":{"mixins":{"description":"A key-value map of mixins, where the mixin name is a key and schema url is a value","type":"object","additionalProperties":true},"version":{"description":"The document version number.","type":"integer"}}},"tax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"}},"required":["total"]},"taxLine":{"title":"taxLine","description":"Tax line details.","type":"object","properties":{"amount":{"description":"Tax line amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Tax code.","type":"string"},"name":{"description":"Tax name.","type":"string"},"rate":{"description":"Tax rate.","type":"number","default":0},"taxable":{"description":"Order's taxable amount.","type":"number"},"sequenceId":{"description":"Sequence ID.","type":"integer","default":0},"inclusive":{"description":"Inclusive flag.","type":"boolean","default":false}},"required":["amount","currency","sequenceId","inclusive"]},"taxTotal":{"title":"Tax total","description":"The tax total tax amount.","type":"object","properties":{"amount":{"description":"Total tax amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"inclusive":{"description":"Total tax inclusive flag.","default":false,"type":"boolean"}},"required":["amount","currency","inclusive"]},"price":{"title":"Price","description":"Price details.","type":"object","properties":{"priceId":{"description":"Id of the price related to order entry.","type":"string"},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the returned prices belongs to any price list."},"effectiveAmount":{"description":"Effective amount is a calculated average item price after a discount.","type":"number"},"originalAmount":{"description":"Oryginal amount is a price set by the merchant.","type":"number"},"currency":{"description":"Currency of the entry price.","type":"string"},"salePrice":{"allOf":[{"$ref":"#/components/schemas/salePrice"},{"type":"object","description":"Attributes of the sale price."}]}}},"salePrice":{"title":"Sale Price","description":"The sale price.","type":"object","properties":{"discountAmount":{"description":"Amount of the discount for sale price promotion.","type":"number"},"discountRate":{"description":"Rate of the discount for sale price promotion.","type":"number"},"description":{"description":"The sale price description.","type":"string"}}},"orderEntryCalculatedPrice":{"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"],"description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the order."},"name":{"type":"object","description":"Fee name."},"price":{"type":"object","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.","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 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/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."}}}]}},"required":["finalPrice"]},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}}]},"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."},"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."},"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."},"origin":{"enum":["INTERNAL","EXTERNAL"],"description":"origin of the fee, `INTERNAL` defined in commerce engine, `EXTERNAL` specified when item is added to the cart."},"price":{"$ref":"#/components/schemas/calculatedPrice"},"discountedPrice":{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"}}},"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.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"priceMatchDetails":{"title":"priceMatchDetails","type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value of the matched price"},"grossValue":{"type":"number","format":"double","description":"The gross value of the matched price"},"taxValue":{"type":"number","format":"double","description":"The calculated tax value"},"taxCode":{"type":"string","description":"The applied tax code"},"taxRate":{"type":"number","format":"double","description":"The applied tax rate"},"taxCountry":{"type":"string","description":"The tax country for which the price was matched"}},"description":"This model represents the price value retrieved from the price service"},"externalDiscount":{"type":"object","description":"External discount that was applied to order 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). For discountType=`PERCENT`, maximum is 100.0; for ABSOLUTE, there is no limit."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount is 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":"#/components/schemas/localizedValue"}],"description":"Fee name."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of the fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of the 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 the fee absolute."},"amount":{"type":"number","description":"Value of the fee absolute."}}},"taxable":{"type":"boolean","description":"It marks whether tax should be included to the fee or not. A taxable fee must have the `taxCode` attribute provided."},"taxCode":{"type":"string","description":"Tax code of the fee."}}},"discount":{"title":"Discount","properties":{"code":{"description":"Discount's code.","type":"string"},"amount":{"description":"Amount of discount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"name":{"description":"Discount's name.","type":"string"},"discountRate":{"description":"Discount's rate.","type":"number"},"calculationType":{"description":"Discount's code.calculation type.","type":"string"},"discountCalculationType":{"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","type":"string","enum":["SUBTOTAL","TOTAL"]},"discountType":{"description":"Discount's type.","type":"string"},"sequenceId":{"description":"Discount's unique sequence ID identifier.","type":"integer"},"link":{"allOf":[{"$ref":"#/components/schemas/reference"},{"type":"object","description":"Link to discount."}]},"categoryRestricted":{"description":"This flag indicates if discount is category restricted.","type":"boolean"},"restrictions":{"allOf":[{"$ref":"#/components/schemas/discountRestrictions"},{"type":"object","description":"The restrictions based on which the discount can be applied."}]}},"required":["code","currency"]},"reference":{"title":"Link","properties":{"id":{"description":"Unique identifier of a link.","type":"string"},"type":{"description":"Link type.","type":"string"},"url":{"description":"URL of the link.","type":"string"}},"required":["id","type","url"]},"discountRestrictions":{"title":"Discount Restrictions","properties":{"validFrom":{"description":"The date from which the discount restriction is valid.","type":"string"},"validUntil":{"description":"The date from which the discount restriction is valid.","type":"string"},"minOrderValue":{"allOf":[{"$ref":"#/components/schemas/discountRestrictionsPrice"},{"type":"object","description":"The minimum order price for which the discount is valid."}]},"includedCategories":{"description":"List of included categories.","type":"array","items":{"type":"string"}},"excludedCategories":{"description":"List of excluded categories.","type":"array","items":{"type":"string"}}}},"discountRestrictionsPrice":{"title":"Discount Restrictions Price","properties":{"amount":{"description":"The amount of discount price","type":"number"},"currency":{"description":"The currency of the price","type":"string"}}},"customer":{"title":"Customer","description":"Customer data. \n\nOne of these properties needs to be provided:\n- `name` for business customers (B2B)\n- `firstName` and `lastName` for individual customers (B2C)\n","properties":{"id":{"description":"Customer's unique identifier.","type":"string","default":"ANONYMOUS"},"name":{"description":"Customer's name.","type":"string"},"title":{"description":"Customer's title.","type":"string"},"firstName":{"description":"Customer's first name.","type":"string"},"middleName":{"description":"Customer's middle name.","type":"string"},"lastName":{"description":"Customer's last name.","type":"string"},"company":{"description":"Company name.","type":"string"},"email":{"description":"Customer's email address.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Customer additional information.","type":"object","additionalProperties":true}},"required":["email"]},"address":{"title":"Address","description":"Customer's address.","type":"object","properties":{"contactName":{"description":"Customer's name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"street":{"description":"Street name.","type":"string"},"streetNumber":{"description":"Street number.","type":"string"},"streetAppendix":{"description":"Street appendix.","type":"string"},"extraLine1":{"description":"Additional address information.","type":"string"},"extraLine2":{"description":"Additional address information.","type":"string"},"extraLine3":{"description":"Additional address information.","type":"string"},"extraLine4":{"description":"Additional address information.","type":"string"},"zipCode":{"description":"Customer's address - zip code.","type":"string"},"city":{"description":"City name.","type":"string"},"state":{"description":"State name.","type":"string"},"country":{"description":"Country name.","type":"string"},"contactPhone":{"description":"Customer's contact phone.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Additional address information.","type":"object","additionalProperties":true}},"required":["contactName","street","city","zipCode","country"]},"payment":{"title":"Payment","description":"Payment details.","type":"object","properties":{"method":{"description":"Payment method.","type":"string"},"status":{"description":"Payment status.","allOf":[{"$ref":"#/components/schemas/paymentStatus"}]},"paymentResponse":{"description":"Payment response.","type":"string"},"paidAmount":{"description":"Paid amount.","type":"number"},"refundAmount":{"description":"Refund amount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"transactionId":{"description":"The ID of the payment transaction.","type":"string"},"redirectUrl":{"description":"Redirect url.","type":"string"},"authorizedAmount":{"description":"Authorized amount.","type":"number"},"provider":{"description":"Payment provider.","type":"string"}},"required":["method","paidAmount","currency"]},"paymentStatus":{"type":"string","enum":["PENDING","AUTHORIZATION_SUCCESS","AUTHORIZATION_FAILURE","CAPTURE_SUCCESS","CAPTURE_FAILURE","SUCCESS","FAILURE","CANCELLATION_SUCCESS","CANCELLATION_FAILURE","REFUND_SUCCESS","REFUND_FAILURE"],"default":"PENDING","description":"Status of the payment."},"shipping":{"description":"Shipping details.","title":"Shipping","type":"object","properties":{"total":{"description":"Total shipping amount.","type":"object","properties":{"amount":{"type":"number","description":"Shipping amount.","default":0},"currency":{"type":"string","description":"Currency of the shipping amount."}}},"lines":{"description":"Shipping line list.","type":"array","items":{"$ref":"#/components/schemas/shippingLine"}}},"required":["total"]},"shippingLine":{"title":"Shipping line","description":"Shipping line.","type":"object","properties":{"amount":{"type":"number","description":"Shipping line amount.","default":0},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Shipping line code.","type":"string"},"name":{"description":"Shipping line name.","type":"string"},"localizedName":{"description":"Shipping line name in a form of a map of translations.","type":"object","additionalProperties":{"type":"string"}},"discounts":{"description":"Shipping line discount.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"tax":{"$ref":"#/components/schemas/shippingTax"},"link":{"$ref":"#/components/schemas/reference"},"shippingTaxCode":{"type":"string"}},"required":["code"]},"shippingTax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"},"rate":{"description":"The rate of the shipping tax","type":"number"}},"required":["total"]},"deliveryWindow":{"title":"Delivery Window","type":"object","properties":{"id":{"type":"string","description":"Id of the delivery window"},"deliveryDate":{"type":"string","format":"date","description":"Delivery date."},"slotId":{"type":"string","description":"ID of the delivery slot"},"deliveryTimeRange":{"$ref":"#/components/schemas/deliveryTimeRange"},"deliveryCycle":{"type":"string","description":"Delivery cycle to which the order is assigned (containing date)"},"deliveryCycleName":{"type":"string","description":"Delivery cycle name to which the order is assigned"}}},"deliveryTimeRange":{"title":"Delivery Time Range","type":"object","properties":{"timeFrom":{"type":"string","format":"time","description":"Start Time"},"timeTo":{"type":"string","format":"time","description":"End Time"}}},"metadataMixins":{"title":"Metadata DTO","type":"object","additionalProperties":true,"properties":{"mixins":{"type":"object","additionalProperties":true},"version":{"type":"integer"}}},"orderCalculatedPrice":{"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 - `entries[].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 any 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 the 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."}}}]},"paymentFees":{"type":"array","description":"The list of payment fees applied to an order. Payment fees are not changed and are not discounted, even when a discount or coupon is applied to the total.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedPaymentFee"},{"type":"object","properties":{"id":{"type":"string","description":"Payment fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the payment fee. PERCENT for the fee’s `feePercentage`` multiplied by sum of line items `finalPrice` plus shipping cost. ABSOLUTE - monetary amount that is assigned to the payment method."},"price":{"description":"Calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"The monetary amount of the fee, depending on the fee type. ABSOLUTE for the value of defined fee’s `feeAbsolute.amount` attribute. The amount is treated as `netValue`. PERCENT, when defined on fee level percentage, `feePercentage` attribute, of sum of all item line’s `finalPrice.netValue` plus cart’s `calculatedPrice.totalShipping.netValue`. If the fee is taxable and has a tax code, the gross value is calculated. Otherwise, `grossValue` is equal to `netValue`."},"grossValue":{"type":"number","format":"double","description":"For a fee where `taxable=true` and a valid `taxCode` is provided, the tax rate associated with that tax code is used to calculate `grossValue`. If the fee is not taxable, `netValue` is equal to `grossValue`."},"taxValue":{"type":"number","format":"double","description":"Tax value of the payment fee, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the `taxCode` provided at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"The tax code defined at the fee level, for example STANDARD. The value must correspond to the available tax codes in the system configuration."}}}}}]}},"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 `entries[].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":{"type":"array","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."}}}]}}}}]},"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 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."}}}]}}}}]},"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":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total shipping cost is calculated by summing `entries[].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.**","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":{"type":"array","description":"A list of discounts applied to shipping.","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."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `entries[].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."}}}]}}}}}]}}},"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"$ref":"#/components/schemas/calculatedPrice"}},"title":"calculatedPaymentFee"},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A price calculation model that includes tax aggregate information.","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}}}]},"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"}},"responses":{"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}":{"get":{"tags":["Orders (Tenant-managed)"],"summary":"Retrieving a specific order by ID","description":"Retrieves a specific order by order ID. To be used by tenant employees.\n","operationId":"GET-order-retrieve-order-employee","responses":{"200":{"description":"The request was successful. Given order details have been returned.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/salesOrder"}}}},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}}}}}}
```

## Updating an order

> Updates an order with the specified order ID. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_update","order.order_update_completed","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"responses":{"trait_billingAware_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_order_409":{"description":"Optimistic locking failed. User sends metadata/version attribute which is outdated (someone else updated order in the time user was performing his changes). User should retrieve the latest order data and retry the request.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"schemas":{"orderUpdateDto":{"title":"Order Update DTO","type":"object","allOf":[{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/channel"},"created":{"description":"Order's creation date.","type":"string"},"completed":{"description":"Order's completion date.","type":"string"},"lastStatusChange":{"description":"Order last status change date.","type":"string"},"shipments":{"description":"Shipment list.","type":"array","items":{"$ref":"#/components/schemas/shipment"}}}},{"$ref":"#/components/schemas/orderCommonDto"}]},"channel":{"title":"Channel","type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"}}},"shipment":{"title":"Shipment","description":"Shippment details.","type":"object","properties":{"shippedDate":{"description":"Shipped date.","type":"string"},"carrier":{"description":"Carrier.","type":"string"},"trackingNumber":{"description":"Tracking number.","type":"string"},"expectDeliveryOn":{"description":"Expected delivery date.","type":"string"}},"required":["shippedDate","carrier"]},"orderCommonDto":{"title":"Order Common DTO","description":"The base order fields. This object is inherited by all of other order objects as Order Creation DTO, Order Update DTO etc.","type":"object","properties":{"restriction":{"$ref":"#/components/schemas/restriction"},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `entries[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"status":{"$ref":"#/components/schemas/orderStatus"},"cartId":{"type":"string","description":"The identifier of a cart that was used to create this order."},"vendor":{"$ref":"#/components/schemas/vendor"},"orderType":{"$ref":"#/components/schemas/splitOrderType"},"masterOrder":{"type":"string","description":"The identifier of a master order. Available on suborders that have been created after splitting the master order."},"splitInfo":{"$ref":"#/components/schemas/splitInfo"},"subOrders":{"type":"array","description":"A list of string IDs for suborders created after a split. Available only on the master order from which the split originated."},"entries":{"description":"Ordered item list.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/orderEntry"}},"discounts":{"description":"Discount list.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"customer":{"$ref":"#/components/schemas/customer"},"siteCode":{"description":"Site's unique identifier. A site is a specific shop.","type":"string"},"countryCode":{"description":"Two-letter country code, compliant with the ISO 3166 standard.","type":"string"},"billingAddress":{"$ref":"#/components/schemas/address"},"shippingAddress":{"$ref":"#/components/schemas/address"},"payments":{"description":"Payment list.","type":"array","items":{"$ref":"#/components/schemas/payment"}},"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},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"subTotalPrice":{"type":"number","deprecated":true,"description":"Order sub total price. **This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"Order total price. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"totalAuthorizedAmount":{"type":"number","description":"The amount that should be authorized with payment provider. It's a sum of `calculatedPrice.finalPrice.grossValue` and `calculatedPrice.upliftValue.grossValue`."},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"orderCycle":{"description":"Order cycle date.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.deliveryCycle` attribute","deprecated":true,"type":"string"},"deliveryWindowId":{"description":"Delivery window's unique identifier.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.id` attribute","type":"string","deprecated":true},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"metadata":{"$ref":"#/components/schemas/metadataMixins"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderCalculatedPrice"},{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components. Can be skipped if deprecated`totalPrice` is provided to preserve backward compatibility"}]},"legalEntityId":{"type":"string","description":"The identifier of the legal entity on whose behalf the order was placed."}},"required":["entries","customer","calculatedPrice"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the order.\n\n**Purpose**: Restricts order visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access orders with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view orders 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**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `siteCode` property.\n"},"aggregateFee":{"type":"object","title":"Aggregate Fee","properties":{"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"elements":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"taxCode":{"type":"string","description":"Tax code of the fee."},"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"value":{"type":"number","description":"Value of the tax."},"rate":{"type":"number","description":"Rate of the tax."}}}}}}}},"required":["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"}}]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"vendor":{"type":"object","properties":{"id":{"type":"string","description":"An identifier of a vendor"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"splitOrderType":{"type":"string","enum":["MASTER_ORDER","SUB_ORDER"],"description":"Available on orders that have been split. For standard orders, the value is `null`. For the original order that was split, the value is `MASTER_ORDER`s, and for the created suborders, the value is `SUB_ORDER`."},"splitInfo":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders. Available only on suborders that had uniqueValue for the split. Not available on master order."}},"description":"Information about how the order was split from the master order."},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"orderEntry":{"title":"Order entry","description":"The ordered item.","type":"object","properties":{"id":{"description":"The ordered item ID.","type":"string"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"fees":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"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},"amount":{"description":"The amount of items.","type":"integer"},"orderedAmount":{"description":"The ordered amount of items.","type":"integer"},"packedAmountInPc":{"description":"The packed amount of items.","type":"integer"},"effectiveQuantity":{"description":"Effective quantity is q calculated average quantity customer is paying for.","type":"number","format":"double"},"originalAmount":{"description":"The original amount. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"originalPrice":{"description":"The original price. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"unitPrice":{"type":"number","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality."},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product's unit price with tax values, can be skipped if deprecated `unitPrice` is provided for backward compatibility."}]},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"},"link":{"description":"Link to product.","type":"string"},"discounts":{"deprecated":true,"description":"The discount list. **This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"The total price of items. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"authorizedAmount":{"description":"The authorized amount. **This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much payment authorization should be increased for given item.","deprecated":true,"type":"number"},"product":{"$ref":"#/components/schemas/product"},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"price":{"$ref":"#/components/schemas/price"},"metadata":{"$ref":"#/components/schemas/mixinsMetadata"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderEntryCalculatedPrice"},{"type":"object","description":"Detailed price calculation for a single line item with all pricing components. Can be skipped if deprecated `totalPrice` is provided for backward compatibility."}]},"priceMatchDetails":{"$ref":"#/components/schemas/priceMatchDetails"},"externalDiscounts":{"type":"array","description":"External discounts applied to this order entry.","items":{"$ref":"#/components/schemas/externalDiscount"}},"externalFees":{"type":"array","description":"External fees applied to this order entry.","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["amount","calculatedUnitPrice","calculatedPrice"]},"YRN":{"type":"string","title":"YRN","description":"In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.\n\nIt is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.","minLength":1},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details.","required":["netValue","grossValue","taxValue"]},"measurementUnit":{"title":"Measurement Unit","description":"The entry measurement unit","type":"object","properties":{"unit":{"description":"Code of the unit, like `kg` or `l`.","type":"string"},"value":{"description":"Quantity of given unit.","type":"number"}},"required":["value"]},"product":{"title":"Product","description":"Product details.","type":"object","properties":{"id":{"description":"Unique identifier of a product.","type":"string"},"sku":{"description":"Product sku.","type":"string"},"code":{"description":"Unique code of a product.","type":"string"},"name":{"description":"Unique name of a product.","type":"string"},"localizedName":{"description":"A product's name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"description":"Product description.","type":"string"},"published":{"description":"Product published flag.","type":"boolean"},"productType":{"description":"Type of the product (BASIC, VARIANT, BUNDLE).","type":"string","enum":["BASIC","VARIANT","BUNDLE"]},"bundledProducts":{"description":"The collection of products assigned to the bundle.","type":"array","items":{"$ref":"#/components/schemas/bundleProduct"}},"images":{"description":"Product images.","type":"array","items":{"$ref":"#/components/schemas/media"}},"vendor":{"$ref":"#/components/schemas/vendor"},"mixins":{"description":"Product additional information.","type":"object","additionalProperties":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"The metadata of the product."}]}}},"bundleProduct":{"title":"Bundle Product","description":"Represents the product used in a bundle.","type":"object","properties":{"amount":{"description":"The number of given products assigned to the bundle.","type":"number"},"productId":{"description":"Id of the product assigned to the bundle.","type":"string"}}},"media":{"title":"Media","description":"The media.","type":"object","properties":{"id":{"description":"Unique identifier of a media file.","type":"string"},"url":{"description":"Media URL.","type":"string"},"stored":{"description":"Media stored flag.","type":"boolean","default":false}}},"mixinsMetadata":{"title":"Product Metadata","description":"Product Metadata","type":"object","additionalProperties":true,"properties":{"mixins":{"description":"A key-value map of mixins, where the mixin name is a key and schema url is a value","type":"object","additionalProperties":true},"version":{"description":"The document version number.","type":"integer"}}},"tax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"}},"required":["total"]},"taxLine":{"title":"taxLine","description":"Tax line details.","type":"object","properties":{"amount":{"description":"Tax line amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Tax code.","type":"string"},"name":{"description":"Tax name.","type":"string"},"rate":{"description":"Tax rate.","type":"number","default":0},"taxable":{"description":"Order's taxable amount.","type":"number"},"sequenceId":{"description":"Sequence ID.","type":"integer","default":0},"inclusive":{"description":"Inclusive flag.","type":"boolean","default":false}},"required":["amount","currency","sequenceId","inclusive"]},"taxTotal":{"title":"Tax total","description":"The tax total tax amount.","type":"object","properties":{"amount":{"description":"Total tax amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"inclusive":{"description":"Total tax inclusive flag.","default":false,"type":"boolean"}},"required":["amount","currency","inclusive"]},"price":{"title":"Price","description":"Price details.","type":"object","properties":{"priceId":{"description":"Id of the price related to order entry.","type":"string"},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the returned prices belongs to any price list."},"effectiveAmount":{"description":"Effective amount is a calculated average item price after a discount.","type":"number"},"originalAmount":{"description":"Oryginal amount is a price set by the merchant.","type":"number"},"currency":{"description":"Currency of the entry price.","type":"string"},"salePrice":{"allOf":[{"$ref":"#/components/schemas/salePrice"},{"type":"object","description":"Attributes of the sale price."}]}}},"salePrice":{"title":"Sale Price","description":"The sale price.","type":"object","properties":{"discountAmount":{"description":"Amount of the discount for sale price promotion.","type":"number"},"discountRate":{"description":"Rate of the discount for sale price promotion.","type":"number"},"description":{"description":"The sale price description.","type":"string"}}},"orderEntryCalculatedPrice":{"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"],"description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the order."},"name":{"type":"object","description":"Fee name."},"price":{"type":"object","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.","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 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/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."}}}]}},"required":["finalPrice"]},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}}]},"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."},"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."},"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."},"origin":{"enum":["INTERNAL","EXTERNAL"],"description":"origin of the fee, `INTERNAL` defined in commerce engine, `EXTERNAL` specified when item is added to the cart."},"price":{"$ref":"#/components/schemas/calculatedPrice"},"discountedPrice":{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"}}},"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.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"priceMatchDetails":{"title":"priceMatchDetails","type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value of the matched price"},"grossValue":{"type":"number","format":"double","description":"The gross value of the matched price"},"taxValue":{"type":"number","format":"double","description":"The calculated tax value"},"taxCode":{"type":"string","description":"The applied tax code"},"taxRate":{"type":"number","format":"double","description":"The applied tax rate"},"taxCountry":{"type":"string","description":"The tax country for which the price was matched"}},"description":"This model represents the price value retrieved from the price service"},"externalDiscount":{"type":"object","description":"External discount that was applied to order 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). For discountType=`PERCENT`, maximum is 100.0; for ABSOLUTE, there is no limit."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount is 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":"#/components/schemas/localizedValue"}],"description":"Fee name."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of the fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of the 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 the fee absolute."},"amount":{"type":"number","description":"Value of the fee absolute."}}},"taxable":{"type":"boolean","description":"It marks whether tax should be included to the fee or not. A taxable fee must have the `taxCode` attribute provided."},"taxCode":{"type":"string","description":"Tax code of the fee."}}},"discount":{"title":"Discount","properties":{"code":{"description":"Discount's code.","type":"string"},"amount":{"description":"Amount of discount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"name":{"description":"Discount's name.","type":"string"},"discountRate":{"description":"Discount's rate.","type":"number"},"calculationType":{"description":"Discount's code.calculation type.","type":"string"},"discountCalculationType":{"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","type":"string","enum":["SUBTOTAL","TOTAL"]},"discountType":{"description":"Discount's type.","type":"string"},"sequenceId":{"description":"Discount's unique sequence ID identifier.","type":"integer"},"link":{"allOf":[{"$ref":"#/components/schemas/reference"},{"type":"object","description":"Link to discount."}]},"categoryRestricted":{"description":"This flag indicates if discount is category restricted.","type":"boolean"},"restrictions":{"allOf":[{"$ref":"#/components/schemas/discountRestrictions"},{"type":"object","description":"The restrictions based on which the discount can be applied."}]}},"required":["code","currency"]},"reference":{"title":"Link","properties":{"id":{"description":"Unique identifier of a link.","type":"string"},"type":{"description":"Link type.","type":"string"},"url":{"description":"URL of the link.","type":"string"}},"required":["id","type","url"]},"discountRestrictions":{"title":"Discount Restrictions","properties":{"validFrom":{"description":"The date from which the discount restriction is valid.","type":"string"},"validUntil":{"description":"The date from which the discount restriction is valid.","type":"string"},"minOrderValue":{"allOf":[{"$ref":"#/components/schemas/discountRestrictionsPrice"},{"type":"object","description":"The minimum order price for which the discount is valid."}]},"includedCategories":{"description":"List of included categories.","type":"array","items":{"type":"string"}},"excludedCategories":{"description":"List of excluded categories.","type":"array","items":{"type":"string"}}}},"discountRestrictionsPrice":{"title":"Discount Restrictions Price","properties":{"amount":{"description":"The amount of discount price","type":"number"},"currency":{"description":"The currency of the price","type":"string"}}},"customer":{"title":"Customer","description":"Customer data. \n\nOne of these properties needs to be provided:\n- `name` for business customers (B2B)\n- `firstName` and `lastName` for individual customers (B2C)\n","properties":{"id":{"description":"Customer's unique identifier.","type":"string","default":"ANONYMOUS"},"name":{"description":"Customer's name.","type":"string"},"title":{"description":"Customer's title.","type":"string"},"firstName":{"description":"Customer's first name.","type":"string"},"middleName":{"description":"Customer's middle name.","type":"string"},"lastName":{"description":"Customer's last name.","type":"string"},"company":{"description":"Company name.","type":"string"},"email":{"description":"Customer's email address.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Customer additional information.","type":"object","additionalProperties":true}},"required":["email"]},"address":{"title":"Address","description":"Customer's address.","type":"object","properties":{"contactName":{"description":"Customer's name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"street":{"description":"Street name.","type":"string"},"streetNumber":{"description":"Street number.","type":"string"},"streetAppendix":{"description":"Street appendix.","type":"string"},"extraLine1":{"description":"Additional address information.","type":"string"},"extraLine2":{"description":"Additional address information.","type":"string"},"extraLine3":{"description":"Additional address information.","type":"string"},"extraLine4":{"description":"Additional address information.","type":"string"},"zipCode":{"description":"Customer's address - zip code.","type":"string"},"city":{"description":"City name.","type":"string"},"state":{"description":"State name.","type":"string"},"country":{"description":"Country name.","type":"string"},"contactPhone":{"description":"Customer's contact phone.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Additional address information.","type":"object","additionalProperties":true}},"required":["contactName","street","city","zipCode","country"]},"payment":{"title":"Payment","description":"Payment details.","type":"object","properties":{"method":{"description":"Payment method.","type":"string"},"status":{"description":"Payment status.","allOf":[{"$ref":"#/components/schemas/paymentStatus"}]},"paymentResponse":{"description":"Payment response.","type":"string"},"paidAmount":{"description":"Paid amount.","type":"number"},"refundAmount":{"description":"Refund amount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"transactionId":{"description":"The ID of the payment transaction.","type":"string"},"redirectUrl":{"description":"Redirect url.","type":"string"},"authorizedAmount":{"description":"Authorized amount.","type":"number"},"provider":{"description":"Payment provider.","type":"string"}},"required":["method","paidAmount","currency"]},"paymentStatus":{"type":"string","enum":["PENDING","AUTHORIZATION_SUCCESS","AUTHORIZATION_FAILURE","CAPTURE_SUCCESS","CAPTURE_FAILURE","SUCCESS","FAILURE","CANCELLATION_SUCCESS","CANCELLATION_FAILURE","REFUND_SUCCESS","REFUND_FAILURE"],"default":"PENDING","description":"Status of the payment."},"shipping":{"description":"Shipping details.","title":"Shipping","type":"object","properties":{"total":{"description":"Total shipping amount.","type":"object","properties":{"amount":{"type":"number","description":"Shipping amount.","default":0},"currency":{"type":"string","description":"Currency of the shipping amount."}}},"lines":{"description":"Shipping line list.","type":"array","items":{"$ref":"#/components/schemas/shippingLine"}}},"required":["total"]},"shippingLine":{"title":"Shipping line","description":"Shipping line.","type":"object","properties":{"amount":{"type":"number","description":"Shipping line amount.","default":0},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Shipping line code.","type":"string"},"name":{"description":"Shipping line name.","type":"string"},"localizedName":{"description":"Shipping line name in a form of a map of translations.","type":"object","additionalProperties":{"type":"string"}},"discounts":{"description":"Shipping line discount.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"tax":{"$ref":"#/components/schemas/shippingTax"},"link":{"$ref":"#/components/schemas/reference"},"shippingTaxCode":{"type":"string"}},"required":["code"]},"shippingTax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"},"rate":{"description":"The rate of the shipping tax","type":"number"}},"required":["total"]},"deliveryWindow":{"title":"Delivery Window","type":"object","properties":{"id":{"type":"string","description":"Id of the delivery window"},"deliveryDate":{"type":"string","format":"date","description":"Delivery date."},"slotId":{"type":"string","description":"ID of the delivery slot"},"deliveryTimeRange":{"$ref":"#/components/schemas/deliveryTimeRange"},"deliveryCycle":{"type":"string","description":"Delivery cycle to which the order is assigned (containing date)"},"deliveryCycleName":{"type":"string","description":"Delivery cycle name to which the order is assigned"}}},"deliveryTimeRange":{"title":"Delivery Time Range","type":"object","properties":{"timeFrom":{"type":"string","format":"time","description":"Start Time"},"timeTo":{"type":"string","format":"time","description":"End Time"}}},"metadataMixins":{"title":"Metadata DTO","type":"object","additionalProperties":true,"properties":{"mixins":{"type":"object","additionalProperties":true},"version":{"type":"integer"}}},"orderCalculatedPrice":{"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 - `entries[].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 any 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 the 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."}}}]},"paymentFees":{"type":"array","description":"The list of payment fees applied to an order. Payment fees are not changed and are not discounted, even when a discount or coupon is applied to the total.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedPaymentFee"},{"type":"object","properties":{"id":{"type":"string","description":"Payment fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the payment fee. PERCENT for the fee’s `feePercentage`` multiplied by sum of line items `finalPrice` plus shipping cost. ABSOLUTE - monetary amount that is assigned to the payment method."},"price":{"description":"Calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"The monetary amount of the fee, depending on the fee type. ABSOLUTE for the value of defined fee’s `feeAbsolute.amount` attribute. The amount is treated as `netValue`. PERCENT, when defined on fee level percentage, `feePercentage` attribute, of sum of all item line’s `finalPrice.netValue` plus cart’s `calculatedPrice.totalShipping.netValue`. If the fee is taxable and has a tax code, the gross value is calculated. Otherwise, `grossValue` is equal to `netValue`."},"grossValue":{"type":"number","format":"double","description":"For a fee where `taxable=true` and a valid `taxCode` is provided, the tax rate associated with that tax code is used to calculate `grossValue`. If the fee is not taxable, `netValue` is equal to `grossValue`."},"taxValue":{"type":"number","format":"double","description":"Tax value of the payment fee, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the `taxCode` provided at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"The tax code defined at the fee level, for example STANDARD. The value must correspond to the available tax codes in the system configuration."}}}}}]}},"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 `entries[].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":{"type":"array","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."}}}]}}}}]},"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 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."}}}]}}}}]},"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":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total shipping cost is calculated by summing `entries[].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.**","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":{"type":"array","description":"A list of discounts applied to shipping.","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."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `entries[].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."}}}]}}}}}]}}},"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"$ref":"#/components/schemas/calculatedPrice"}},"title":"calculatedPaymentFee"},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A price calculation model that includes tax aggregate information.","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}}}]},"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"}},"parameters":{"trait_recalculate":{"name":"recalculate","in":"query","description":"Flag that enforces order recalculation. If set to `true`, the whole order, including the coupon discounts, will be recalculated.\n","schema":{"default":false,"type":"boolean"}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}":{"put":{"tags":["Orders (Tenant-managed)"],"summary":"Updating an order","description":"Updates an order with the specified order ID. To be used by tenant employees.\n","operationId":"PUT-order-update-order","responses":{"204":{"description":"Successful order update"},"400":{"$ref":"#/components/responses/trait_billingAware_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"409":{"$ref":"#/components/responses/trait_order_409"},"500":{"$ref":"#/components/responses/trait_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderUpdateDto"}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_recalculate"}]}}}}
```

## Deleting an order

> Deletes order with the specified ID. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_delete"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"responses":{"trait_billingAware_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}":{"delete":{"tags":["Orders (Tenant-managed)"],"summary":"Deleting an order","description":"Deletes order with the specified ID. To be used by tenant employees.\n","operationId":"DELETE-order-remove-order","responses":{"204":{"description":"Successful deletion"},"400":{"$ref":"#/components/responses/trait_billingAware_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}}}}}}
```

## Partially updating an order

> Updates partially an order with the specified order ID. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_update","order.order_update_completed","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"responses":{"trait_billingAware_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_order_409":{"description":"Optimistic locking failed. User sends metadata/version attribute which is outdated (someone else updated order in the time user was performing his changes). User should retrieve the latest order data and retry the request.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"schemas":{"orderUpdateDto":{"title":"Order Update DTO","type":"object","allOf":[{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/channel"},"created":{"description":"Order's creation date.","type":"string"},"completed":{"description":"Order's completion date.","type":"string"},"lastStatusChange":{"description":"Order last status change date.","type":"string"},"shipments":{"description":"Shipment list.","type":"array","items":{"$ref":"#/components/schemas/shipment"}}}},{"$ref":"#/components/schemas/orderCommonDto"}]},"channel":{"title":"Channel","type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"}}},"shipment":{"title":"Shipment","description":"Shippment details.","type":"object","properties":{"shippedDate":{"description":"Shipped date.","type":"string"},"carrier":{"description":"Carrier.","type":"string"},"trackingNumber":{"description":"Tracking number.","type":"string"},"expectDeliveryOn":{"description":"Expected delivery date.","type":"string"}},"required":["shippedDate","carrier"]},"orderCommonDto":{"title":"Order Common DTO","description":"The base order fields. This object is inherited by all of other order objects as Order Creation DTO, Order Update DTO etc.","type":"object","properties":{"restriction":{"$ref":"#/components/schemas/restriction"},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `entries[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"status":{"$ref":"#/components/schemas/orderStatus"},"cartId":{"type":"string","description":"The identifier of a cart that was used to create this order."},"vendor":{"$ref":"#/components/schemas/vendor"},"orderType":{"$ref":"#/components/schemas/splitOrderType"},"masterOrder":{"type":"string","description":"The identifier of a master order. Available on suborders that have been created after splitting the master order."},"splitInfo":{"$ref":"#/components/schemas/splitInfo"},"subOrders":{"type":"array","description":"A list of string IDs for suborders created after a split. Available only on the master order from which the split originated."},"entries":{"description":"Ordered item list.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/orderEntry"}},"discounts":{"description":"Discount list.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"customer":{"$ref":"#/components/schemas/customer"},"siteCode":{"description":"Site's unique identifier. A site is a specific shop.","type":"string"},"countryCode":{"description":"Two-letter country code, compliant with the ISO 3166 standard.","type":"string"},"billingAddress":{"$ref":"#/components/schemas/address"},"shippingAddress":{"$ref":"#/components/schemas/address"},"payments":{"description":"Payment list.","type":"array","items":{"$ref":"#/components/schemas/payment"}},"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},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"subTotalPrice":{"type":"number","deprecated":true,"description":"Order sub total price. **This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"Order total price. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"totalAuthorizedAmount":{"type":"number","description":"The amount that should be authorized with payment provider. It's a sum of `calculatedPrice.finalPrice.grossValue` and `calculatedPrice.upliftValue.grossValue`."},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"orderCycle":{"description":"Order cycle date.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.deliveryCycle` attribute","deprecated":true,"type":"string"},"deliveryWindowId":{"description":"Delivery window's unique identifier.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.id` attribute","type":"string","deprecated":true},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"metadata":{"$ref":"#/components/schemas/metadataMixins"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderCalculatedPrice"},{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components. Can be skipped if deprecated`totalPrice` is provided to preserve backward compatibility"}]},"legalEntityId":{"type":"string","description":"The identifier of the legal entity on whose behalf the order was placed."}},"required":["entries","customer","calculatedPrice"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the order.\n\n**Purpose**: Restricts order visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access orders with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view orders 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**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `siteCode` property.\n"},"aggregateFee":{"type":"object","title":"Aggregate Fee","properties":{"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"elements":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"taxCode":{"type":"string","description":"Tax code of the fee."},"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"value":{"type":"number","description":"Value of the tax."},"rate":{"type":"number","description":"Rate of the tax."}}}}}}}},"required":["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"}}]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"vendor":{"type":"object","properties":{"id":{"type":"string","description":"An identifier of a vendor"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"splitOrderType":{"type":"string","enum":["MASTER_ORDER","SUB_ORDER"],"description":"Available on orders that have been split. For standard orders, the value is `null`. For the original order that was split, the value is `MASTER_ORDER`s, and for the created suborders, the value is `SUB_ORDER`."},"splitInfo":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders. Available only on suborders that had uniqueValue for the split. Not available on master order."}},"description":"Information about how the order was split from the master order."},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"orderEntry":{"title":"Order entry","description":"The ordered item.","type":"object","properties":{"id":{"description":"The ordered item ID.","type":"string"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"fees":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"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},"amount":{"description":"The amount of items.","type":"integer"},"orderedAmount":{"description":"The ordered amount of items.","type":"integer"},"packedAmountInPc":{"description":"The packed amount of items.","type":"integer"},"effectiveQuantity":{"description":"Effective quantity is q calculated average quantity customer is paying for.","type":"number","format":"double"},"originalAmount":{"description":"The original amount. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"originalPrice":{"description":"The original price. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"unitPrice":{"type":"number","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality."},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product's unit price with tax values, can be skipped if deprecated `unitPrice` is provided for backward compatibility."}]},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"},"link":{"description":"Link to product.","type":"string"},"discounts":{"deprecated":true,"description":"The discount list. **This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"The total price of items. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"authorizedAmount":{"description":"The authorized amount. **This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much payment authorization should be increased for given item.","deprecated":true,"type":"number"},"product":{"$ref":"#/components/schemas/product"},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"price":{"$ref":"#/components/schemas/price"},"metadata":{"$ref":"#/components/schemas/mixinsMetadata"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderEntryCalculatedPrice"},{"type":"object","description":"Detailed price calculation for a single line item with all pricing components. Can be skipped if deprecated `totalPrice` is provided for backward compatibility."}]},"priceMatchDetails":{"$ref":"#/components/schemas/priceMatchDetails"},"externalDiscounts":{"type":"array","description":"External discounts applied to this order entry.","items":{"$ref":"#/components/schemas/externalDiscount"}},"externalFees":{"type":"array","description":"External fees applied to this order entry.","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["amount","calculatedUnitPrice","calculatedPrice"]},"YRN":{"type":"string","title":"YRN","description":"In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.\n\nIt is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.","minLength":1},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details.","required":["netValue","grossValue","taxValue"]},"measurementUnit":{"title":"Measurement Unit","description":"The entry measurement unit","type":"object","properties":{"unit":{"description":"Code of the unit, like `kg` or `l`.","type":"string"},"value":{"description":"Quantity of given unit.","type":"number"}},"required":["value"]},"product":{"title":"Product","description":"Product details.","type":"object","properties":{"id":{"description":"Unique identifier of a product.","type":"string"},"sku":{"description":"Product sku.","type":"string"},"code":{"description":"Unique code of a product.","type":"string"},"name":{"description":"Unique name of a product.","type":"string"},"localizedName":{"description":"A product's name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"description":"Product description.","type":"string"},"published":{"description":"Product published flag.","type":"boolean"},"productType":{"description":"Type of the product (BASIC, VARIANT, BUNDLE).","type":"string","enum":["BASIC","VARIANT","BUNDLE"]},"bundledProducts":{"description":"The collection of products assigned to the bundle.","type":"array","items":{"$ref":"#/components/schemas/bundleProduct"}},"images":{"description":"Product images.","type":"array","items":{"$ref":"#/components/schemas/media"}},"vendor":{"$ref":"#/components/schemas/vendor"},"mixins":{"description":"Product additional information.","type":"object","additionalProperties":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"The metadata of the product."}]}}},"bundleProduct":{"title":"Bundle Product","description":"Represents the product used in a bundle.","type":"object","properties":{"amount":{"description":"The number of given products assigned to the bundle.","type":"number"},"productId":{"description":"Id of the product assigned to the bundle.","type":"string"}}},"media":{"title":"Media","description":"The media.","type":"object","properties":{"id":{"description":"Unique identifier of a media file.","type":"string"},"url":{"description":"Media URL.","type":"string"},"stored":{"description":"Media stored flag.","type":"boolean","default":false}}},"mixinsMetadata":{"title":"Product Metadata","description":"Product Metadata","type":"object","additionalProperties":true,"properties":{"mixins":{"description":"A key-value map of mixins, where the mixin name is a key and schema url is a value","type":"object","additionalProperties":true},"version":{"description":"The document version number.","type":"integer"}}},"tax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"}},"required":["total"]},"taxLine":{"title":"taxLine","description":"Tax line details.","type":"object","properties":{"amount":{"description":"Tax line amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Tax code.","type":"string"},"name":{"description":"Tax name.","type":"string"},"rate":{"description":"Tax rate.","type":"number","default":0},"taxable":{"description":"Order's taxable amount.","type":"number"},"sequenceId":{"description":"Sequence ID.","type":"integer","default":0},"inclusive":{"description":"Inclusive flag.","type":"boolean","default":false}},"required":["amount","currency","sequenceId","inclusive"]},"taxTotal":{"title":"Tax total","description":"The tax total tax amount.","type":"object","properties":{"amount":{"description":"Total tax amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"inclusive":{"description":"Total tax inclusive flag.","default":false,"type":"boolean"}},"required":["amount","currency","inclusive"]},"price":{"title":"Price","description":"Price details.","type":"object","properties":{"priceId":{"description":"Id of the price related to order entry.","type":"string"},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the returned prices belongs to any price list."},"effectiveAmount":{"description":"Effective amount is a calculated average item price after a discount.","type":"number"},"originalAmount":{"description":"Oryginal amount is a price set by the merchant.","type":"number"},"currency":{"description":"Currency of the entry price.","type":"string"},"salePrice":{"allOf":[{"$ref":"#/components/schemas/salePrice"},{"type":"object","description":"Attributes of the sale price."}]}}},"salePrice":{"title":"Sale Price","description":"The sale price.","type":"object","properties":{"discountAmount":{"description":"Amount of the discount for sale price promotion.","type":"number"},"discountRate":{"description":"Rate of the discount for sale price promotion.","type":"number"},"description":{"description":"The sale price description.","type":"string"}}},"orderEntryCalculatedPrice":{"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"],"description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the order."},"name":{"type":"object","description":"Fee name."},"price":{"type":"object","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.","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 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/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."}}}]}},"required":["finalPrice"]},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}}]},"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."},"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."},"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."},"origin":{"enum":["INTERNAL","EXTERNAL"],"description":"origin of the fee, `INTERNAL` defined in commerce engine, `EXTERNAL` specified when item is added to the cart."},"price":{"$ref":"#/components/schemas/calculatedPrice"},"discountedPrice":{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"}}},"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.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"priceMatchDetails":{"title":"priceMatchDetails","type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value of the matched price"},"grossValue":{"type":"number","format":"double","description":"The gross value of the matched price"},"taxValue":{"type":"number","format":"double","description":"The calculated tax value"},"taxCode":{"type":"string","description":"The applied tax code"},"taxRate":{"type":"number","format":"double","description":"The applied tax rate"},"taxCountry":{"type":"string","description":"The tax country for which the price was matched"}},"description":"This model represents the price value retrieved from the price service"},"externalDiscount":{"type":"object","description":"External discount that was applied to order 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). For discountType=`PERCENT`, maximum is 100.0; for ABSOLUTE, there is no limit."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount is 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":"#/components/schemas/localizedValue"}],"description":"Fee name."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of the fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of the 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 the fee absolute."},"amount":{"type":"number","description":"Value of the fee absolute."}}},"taxable":{"type":"boolean","description":"It marks whether tax should be included to the fee or not. A taxable fee must have the `taxCode` attribute provided."},"taxCode":{"type":"string","description":"Tax code of the fee."}}},"discount":{"title":"Discount","properties":{"code":{"description":"Discount's code.","type":"string"},"amount":{"description":"Amount of discount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"name":{"description":"Discount's name.","type":"string"},"discountRate":{"description":"Discount's rate.","type":"number"},"calculationType":{"description":"Discount's code.calculation type.","type":"string"},"discountCalculationType":{"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","type":"string","enum":["SUBTOTAL","TOTAL"]},"discountType":{"description":"Discount's type.","type":"string"},"sequenceId":{"description":"Discount's unique sequence ID identifier.","type":"integer"},"link":{"allOf":[{"$ref":"#/components/schemas/reference"},{"type":"object","description":"Link to discount."}]},"categoryRestricted":{"description":"This flag indicates if discount is category restricted.","type":"boolean"},"restrictions":{"allOf":[{"$ref":"#/components/schemas/discountRestrictions"},{"type":"object","description":"The restrictions based on which the discount can be applied."}]}},"required":["code","currency"]},"reference":{"title":"Link","properties":{"id":{"description":"Unique identifier of a link.","type":"string"},"type":{"description":"Link type.","type":"string"},"url":{"description":"URL of the link.","type":"string"}},"required":["id","type","url"]},"discountRestrictions":{"title":"Discount Restrictions","properties":{"validFrom":{"description":"The date from which the discount restriction is valid.","type":"string"},"validUntil":{"description":"The date from which the discount restriction is valid.","type":"string"},"minOrderValue":{"allOf":[{"$ref":"#/components/schemas/discountRestrictionsPrice"},{"type":"object","description":"The minimum order price for which the discount is valid."}]},"includedCategories":{"description":"List of included categories.","type":"array","items":{"type":"string"}},"excludedCategories":{"description":"List of excluded categories.","type":"array","items":{"type":"string"}}}},"discountRestrictionsPrice":{"title":"Discount Restrictions Price","properties":{"amount":{"description":"The amount of discount price","type":"number"},"currency":{"description":"The currency of the price","type":"string"}}},"customer":{"title":"Customer","description":"Customer data. \n\nOne of these properties needs to be provided:\n- `name` for business customers (B2B)\n- `firstName` and `lastName` for individual customers (B2C)\n","properties":{"id":{"description":"Customer's unique identifier.","type":"string","default":"ANONYMOUS"},"name":{"description":"Customer's name.","type":"string"},"title":{"description":"Customer's title.","type":"string"},"firstName":{"description":"Customer's first name.","type":"string"},"middleName":{"description":"Customer's middle name.","type":"string"},"lastName":{"description":"Customer's last name.","type":"string"},"company":{"description":"Company name.","type":"string"},"email":{"description":"Customer's email address.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Customer additional information.","type":"object","additionalProperties":true}},"required":["email"]},"address":{"title":"Address","description":"Customer's address.","type":"object","properties":{"contactName":{"description":"Customer's name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"street":{"description":"Street name.","type":"string"},"streetNumber":{"description":"Street number.","type":"string"},"streetAppendix":{"description":"Street appendix.","type":"string"},"extraLine1":{"description":"Additional address information.","type":"string"},"extraLine2":{"description":"Additional address information.","type":"string"},"extraLine3":{"description":"Additional address information.","type":"string"},"extraLine4":{"description":"Additional address information.","type":"string"},"zipCode":{"description":"Customer's address - zip code.","type":"string"},"city":{"description":"City name.","type":"string"},"state":{"description":"State name.","type":"string"},"country":{"description":"Country name.","type":"string"},"contactPhone":{"description":"Customer's contact phone.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Additional address information.","type":"object","additionalProperties":true}},"required":["contactName","street","city","zipCode","country"]},"payment":{"title":"Payment","description":"Payment details.","type":"object","properties":{"method":{"description":"Payment method.","type":"string"},"status":{"description":"Payment status.","allOf":[{"$ref":"#/components/schemas/paymentStatus"}]},"paymentResponse":{"description":"Payment response.","type":"string"},"paidAmount":{"description":"Paid amount.","type":"number"},"refundAmount":{"description":"Refund amount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"transactionId":{"description":"The ID of the payment transaction.","type":"string"},"redirectUrl":{"description":"Redirect url.","type":"string"},"authorizedAmount":{"description":"Authorized amount.","type":"number"},"provider":{"description":"Payment provider.","type":"string"}},"required":["method","paidAmount","currency"]},"paymentStatus":{"type":"string","enum":["PENDING","AUTHORIZATION_SUCCESS","AUTHORIZATION_FAILURE","CAPTURE_SUCCESS","CAPTURE_FAILURE","SUCCESS","FAILURE","CANCELLATION_SUCCESS","CANCELLATION_FAILURE","REFUND_SUCCESS","REFUND_FAILURE"],"default":"PENDING","description":"Status of the payment."},"shipping":{"description":"Shipping details.","title":"Shipping","type":"object","properties":{"total":{"description":"Total shipping amount.","type":"object","properties":{"amount":{"type":"number","description":"Shipping amount.","default":0},"currency":{"type":"string","description":"Currency of the shipping amount."}}},"lines":{"description":"Shipping line list.","type":"array","items":{"$ref":"#/components/schemas/shippingLine"}}},"required":["total"]},"shippingLine":{"title":"Shipping line","description":"Shipping line.","type":"object","properties":{"amount":{"type":"number","description":"Shipping line amount.","default":0},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Shipping line code.","type":"string"},"name":{"description":"Shipping line name.","type":"string"},"localizedName":{"description":"Shipping line name in a form of a map of translations.","type":"object","additionalProperties":{"type":"string"}},"discounts":{"description":"Shipping line discount.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"tax":{"$ref":"#/components/schemas/shippingTax"},"link":{"$ref":"#/components/schemas/reference"},"shippingTaxCode":{"type":"string"}},"required":["code"]},"shippingTax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"},"rate":{"description":"The rate of the shipping tax","type":"number"}},"required":["total"]},"deliveryWindow":{"title":"Delivery Window","type":"object","properties":{"id":{"type":"string","description":"Id of the delivery window"},"deliveryDate":{"type":"string","format":"date","description":"Delivery date."},"slotId":{"type":"string","description":"ID of the delivery slot"},"deliveryTimeRange":{"$ref":"#/components/schemas/deliveryTimeRange"},"deliveryCycle":{"type":"string","description":"Delivery cycle to which the order is assigned (containing date)"},"deliveryCycleName":{"type":"string","description":"Delivery cycle name to which the order is assigned"}}},"deliveryTimeRange":{"title":"Delivery Time Range","type":"object","properties":{"timeFrom":{"type":"string","format":"time","description":"Start Time"},"timeTo":{"type":"string","format":"time","description":"End Time"}}},"metadataMixins":{"title":"Metadata DTO","type":"object","additionalProperties":true,"properties":{"mixins":{"type":"object","additionalProperties":true},"version":{"type":"integer"}}},"orderCalculatedPrice":{"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 - `entries[].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 any 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 the 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."}}}]},"paymentFees":{"type":"array","description":"The list of payment fees applied to an order. Payment fees are not changed and are not discounted, even when a discount or coupon is applied to the total.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedPaymentFee"},{"type":"object","properties":{"id":{"type":"string","description":"Payment fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the payment fee. PERCENT for the fee’s `feePercentage`` multiplied by sum of line items `finalPrice` plus shipping cost. ABSOLUTE - monetary amount that is assigned to the payment method."},"price":{"description":"Calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"The monetary amount of the fee, depending on the fee type. ABSOLUTE for the value of defined fee’s `feeAbsolute.amount` attribute. The amount is treated as `netValue`. PERCENT, when defined on fee level percentage, `feePercentage` attribute, of sum of all item line’s `finalPrice.netValue` plus cart’s `calculatedPrice.totalShipping.netValue`. If the fee is taxable and has a tax code, the gross value is calculated. Otherwise, `grossValue` is equal to `netValue`."},"grossValue":{"type":"number","format":"double","description":"For a fee where `taxable=true` and a valid `taxCode` is provided, the tax rate associated with that tax code is used to calculate `grossValue`. If the fee is not taxable, `netValue` is equal to `grossValue`."},"taxValue":{"type":"number","format":"double","description":"Tax value of the payment fee, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the `taxCode` provided at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"The tax code defined at the fee level, for example STANDARD. The value must correspond to the available tax codes in the system configuration."}}}}}]}},"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 `entries[].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":{"type":"array","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."}}}]}}}}]},"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 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."}}}]}}}}]},"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":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total shipping cost is calculated by summing `entries[].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.**","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":{"type":"array","description":"A list of discounts applied to shipping.","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."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `entries[].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."}}}]}}}}}]}}},"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"$ref":"#/components/schemas/calculatedPrice"}},"title":"calculatedPaymentFee"},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A price calculation model that includes tax aggregate information.","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}}}]},"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"}},"parameters":{"trait_recalculate":{"name":"recalculate","in":"query","description":"Flag that enforces order recalculation. If set to `true`, the whole order, including the coupon discounts, will be recalculated.\n","schema":{"default":false,"type":"boolean"}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}":{"patch":{"tags":["Orders (Tenant-managed)"],"summary":"Partially updating an order","description":"Updates partially an order with the specified order ID. To be used by tenant employees.\n","operationId":"PATCH-order-partial-update-order","responses":{"204":{"description":"Successful order update"},"400":{"$ref":"#/components/responses/trait_billingAware_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"409":{"$ref":"#/components/responses/trait_order_409"},"500":{"$ref":"#/components/responses/trait_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderUpdateDto"}}},"required":false},"parameters":[{"$ref":"#/components/parameters/trait_recalculate"}]}}}}
```

## Retrieving status transitions for an order

> Retrieves all possible status transitions for a specific order. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_read","order.order_update","order.order_read_by_vendor","order.order_manage_by_vendor","order.order_update_completed"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"transitions":{"title":"Transitions","description":"Order status transition list.","type":"array","items":{"$ref":"#/components/schemas/transition"}},"transition":{"title":"Transition","description":"Order status transition.","type":"object","properties":{"status":{"$ref":"#/components/schemas/orderStatus"}}},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."}},"responses":{"trait_billingAware_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}/transitions":{"get":{"tags":["Orders (Tenant-managed)"],"summary":"Retrieving status transitions for an order","description":"Retrieves all possible status transitions for a specific order. To be used by tenant employees.\n","operationId":"GET-order-retrieve-order-transitions","responses":{"200":{"description":"The request was successful. Status transitions for specific order returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/transitions"}}}},"400":{"$ref":"#/components/responses/trait_billingAware_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}}}}}}
```

## Updating order status

> Updates the status of a specific order. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_update","order.order_manage_by_vendor","order.order_update_completed"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"responses":{"trait_billingAware_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"schemas":{"transition":{"title":"Transition","description":"Order status transition.","type":"object","properties":{"status":{"$ref":"#/components/schemas/orderStatus"}}},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}/transitions":{"post":{"tags":["Orders (Tenant-managed)"],"summary":"Updating order status","description":"Updates the status of a specific order. To be used by tenant employees.\n","operationId":"POST-order-update-order-transition-employee","responses":{"204":{"description":"The request was successful. Order was successfully updated."},"400":{"$ref":"#/components/responses/trait_billingAware_400"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/transition"}}},"required":false}}}}}
```

## Retrieving historical status transitions for a specific order

> Retrieves historical status transitions for a specific order, including status history metadata. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_read","order.order_update","order.order_read_by_vendor","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"historicalTransitionsResponse":{"title":"Historical Transitions Response","description":"Historical order status transitions with metadata.","type":"object","properties":{"transitions":{"type":"array","description":"Ordered list of historical status transitions.","items":{"$ref":"#/components/schemas/historicalTransition"}},"metadata":{"$ref":"#/components/schemas/historicalTransitionsMetadata"}},"required":["transitions","metadata"]},"historicalTransition":{"title":"Historical Transition","description":"A historical order status transition entry.","type":"object","properties":{"status":{"$ref":"#/components/schemas/orderStatus"},"timestamp":{"type":"string","format":"date-time","description":"Timestamp when the status transition happened."}},"required":["status","timestamp"]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"historicalTransitionsMetadata":{"title":"Historical Transitions Metadata","description":"Metadata related to historical order status transitions.","type":"object","properties":{"version":{"type":"integer","format":"int64","description":"Version of the transition history record."},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the transition history record was created."},"modifiedAt":{"type":"string","format":"date-time","description":"Timestamp when the transition history record was last modified."}},"required":["version","createdAt","modifiedAt"]}},"responses":{"trait_yaasAware_403":{"description":"Given authorization scopes are not sufficient and do not match required scopes.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"trait_saas_token":{"name":"saas-token","in":"header","required":false,"description":"Required only when using **access token (client credentials)**. Not used with customer token.\nToken used to identify the logged-in user; has an expiry and is signed with a passphrase.\n","schema":{"type":"string"}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}/historical-transitions":{"get":{"tags":["Orders (Tenant-managed)"],"summary":"Retrieving historical status transitions for a specific order","description":"Retrieves historical status transitions for a specific order, including status history metadata. To be used by tenant employees.\n","operationId":"GET-order-retrieve-historical-transitions-employee","responses":{"200":{"description":"The request was successful. Historical status transitions for the given order have been returned.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/historicalTransitionsResponse"}}}},"403":{"$ref":"#/components/responses/trait_yaasAware_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}},"parameters":[{"$ref":"#/components/parameters/trait_saas_token"}]}}}}
```

## Recalculating number of entries

> Updates the number of entries in the specific order and recalculates it. To be used by tenant employees.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_update","order.order_update_completed"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"responses":{"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"schemas":{"orderCalculationDto":{"properties":{"entries":{"title":"Order Calculation DTO","description":"Order recalculation DTO contains a list of entries, where each entry contains entry ID and delivered amount of items.","type":"array","items":{"$ref":"#/components/schemas/orderCalculationEntryDto"}}}},"orderCalculationEntryDto":{"title":"Order Calculation Entry DTO","description":"Order Calculation DTO contains information to recalculate a single entry. Required information is ID of entry and (new) delivered amount of items.","properties":{"entryId":{"description":"Unique identifier of an entry.","type":"string"},"deliveredAmount":{"description":"Delivered amount is the new amount of items for recalculation.","type":"integer","minimum":0},"deliveredAmountInPc":{"description":"Delivered amount in pieces","type":"integer","minimum":0},"unit":{"description":"The measurement unit used to present the price.","type":"string"}},"required":["entryId","deliveredAmount"]}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}/calculations":{"post":{"tags":["Orders (Tenant-managed)"],"summary":"Recalculating number of entries","description":"Updates the number of entries in the specific order and recalculates it. To be used by tenant employees.\n","operationId":"POST-order-calculate-order-entries-employees","responses":{"200":{"description":"Order recalculated successfully."},"400":{"description":"Bad Request"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderCalculationDto"}}},"required":true}}}}}
```

## Adding entries to an order

> Updates the entries in the specific order and recalculates it. If provided entry is already assigned to the order then quantity of this entry is updated. If you want to remove entry from order then set quantity to 0.<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_update","order.order_manage_by_vendor"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"salesOrder":{"allOf":[{"type":"object","properties":{"id":{"description":"Order's unique identifier.","type":"string"},"quoteId":{"description":"Identifier of the quote from which the order has been created","type":"string"},"createdBy":{"description":"Order's creator name.","type":"string"},"assistedBuying":{"$ref":"#/components/schemas/assistedBuying"},"checkout":{"type":"boolean","description":"Indicates whether this order was created through checkout. Available in tenant-managed responses only.\n\nWhen set to `true`, only one order can be created per cart ID — enforcing that a checkout cart results in a single order.\nOrders created through the checkout flow have this flag set to `true` by default.\n"}}},{"$ref":"#/components/schemas/orderUpdateDto"}]},"assistedBuying":{"title":"assistedBuying","type":"object","properties":{"entries":{"type":"array","description":"List of operations done by an employee on behalf of a customer.","items":{"$ref":"#/components/schemas/assistedBuyingEntry"}}},"description":"The field is populated only if an assisted buying operation was performed. The field is read-only. There is no possibility to update it by PUT/PATCH operation."},"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"'Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`'","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}},"orderUpdateDto":{"title":"Order Update DTO","type":"object","allOf":[{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/channel"},"created":{"description":"Order's creation date.","type":"string"},"completed":{"description":"Order's completion date.","type":"string"},"lastStatusChange":{"description":"Order last status change date.","type":"string"},"shipments":{"description":"Shipment list.","type":"array","items":{"$ref":"#/components/schemas/shipment"}}}},{"$ref":"#/components/schemas/orderCommonDto"}]},"channel":{"title":"Channel","type":"object","properties":{"name":{"type":"string"},"source":{"type":"string"}}},"shipment":{"title":"Shipment","description":"Shippment details.","type":"object","properties":{"shippedDate":{"description":"Shipped date.","type":"string"},"carrier":{"description":"Carrier.","type":"string"},"trackingNumber":{"description":"Tracking number.","type":"string"},"expectDeliveryOn":{"description":"Expected delivery date.","type":"string"}},"required":["shippedDate","carrier"]},"orderCommonDto":{"title":"Order Common DTO","description":"The base order fields. This object is inherited by all of other order objects as Order Creation DTO, Order Update DTO etc.","type":"object","properties":{"restriction":{"$ref":"#/components/schemas/restriction"},"feeYrnAggregate":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"type":"object","description":"**This field is deprecated**. Please use `calculatedPrice.totalFees` and `entries[].calculatedPrice.fees` instead. These fields provide the same values with updated functionality."}],"deprecated":true},"status":{"$ref":"#/components/schemas/orderStatus"},"cartId":{"type":"string","description":"The identifier of a cart that was used to create this order."},"vendor":{"$ref":"#/components/schemas/vendor"},"orderType":{"$ref":"#/components/schemas/splitOrderType"},"masterOrder":{"type":"string","description":"The identifier of a master order. Available on suborders that have been created after splitting the master order."},"splitInfo":{"$ref":"#/components/schemas/splitInfo"},"subOrders":{"type":"array","description":"A list of string IDs for suborders created after a split. Available only on the master order from which the split originated."},"entries":{"description":"Ordered item list.","type":"array","minItems":1,"items":{"$ref":"#/components/schemas/orderEntry"}},"discounts":{"description":"Discount list.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"customer":{"$ref":"#/components/schemas/customer"},"siteCode":{"description":"Site's unique identifier. A site is a specific shop.","type":"string"},"countryCode":{"description":"Two-letter country code, compliant with the ISO 3166 standard.","type":"string"},"billingAddress":{"$ref":"#/components/schemas/address"},"shippingAddress":{"$ref":"#/components/schemas/address"},"payments":{"description":"Payment list.","type":"array","items":{"$ref":"#/components/schemas/payment"}},"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},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"subTotalPrice":{"type":"number","deprecated":true,"description":"Order sub total price. **This field is deprecated**. Please use `calculatedPrice.price` or `calculatedPrice.discountedPrice` instead. These fields provide the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"Order total price. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"totalAuthorizedAmount":{"type":"number","description":"The amount that should be authorized with payment provider. It's a sum of `calculatedPrice.finalPrice.grossValue` and `calculatedPrice.upliftValue.grossValue`."},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"orderCycle":{"description":"Order cycle date.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.deliveryCycle` attribute","deprecated":true,"type":"string"},"deliveryWindowId":{"description":"Delivery window's unique identifier.\n\n***NOTE***\nThis attribute is DEPRECATED, please use the `deliveryWindow.id` attribute","type":"string","deprecated":true},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"},"metadata":{"$ref":"#/components/schemas/metadataMixins"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderCalculatedPrice"},{"type":"object","description":"A breakdown of the total price calculated from all line items, including detailed pricing components. Can be skipped if deprecated`totalPrice` is provided to preserve backward compatibility"}]},"legalEntityId":{"type":"string","description":"The identifier of the legal entity on whose behalf the order was placed."}},"required":["entries","customer","calculatedPrice"]},"restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the order.\n\n**Purpose**: Restricts order visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access orders with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view orders 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**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `siteCode` property.\n"},"aggregateFee":{"type":"object","title":"Aggregate Fee","properties":{"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"elements":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"$ref":"#/components/schemas/localizedValue"},{"type":"object","description":"Fee name."}]},"yrn":{"type":"string","description":"Unique identifier of the fee."},"taxCode":{"type":"string","description":"Tax code of the fee."},"total":{"type":"object","properties":{"subTotal":{"type":"number"},"totalTax":{"type":"number"},"total":{"type":"number"}}},"taxValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the tax."},"value":{"type":"number","description":"Value of the tax."},"rate":{"type":"number","description":"Rate of the tax."}}}}}}}},"required":["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"}}]},"orderStatus":{"type":"string","enum":["IN_CHECKOUT","CREATED","CONFIRMED","DECLINED","SHIPPED","COMPLETED"],"description":"Status of the order. Supported order statuses are `IN_CHECKOUT`, `CREATED`, `CONFIRMED`, `DECLINED`, `SHIPPED`, `COMPLETED`'. Customers can only change the order status from `CREATED` to `DECLINED`."},"vendor":{"type":"object","properties":{"id":{"type":"string","description":"An identifier of a vendor"},"name":{"type":"string","description":"vendor name"}},"required":["id"]},"splitOrderType":{"type":"string","enum":["MASTER_ORDER","SUB_ORDER"],"description":"Available on orders that have been split. For standard orders, the value is `null`. For the original order that was split, the value is `MASTER_ORDER`s, and for the created suborders, the value is `SUB_ORDER`."},"splitInfo":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders. Available only on suborders that had uniqueValue for the split. Not available on master order."}},"description":"Information about how the order was split from the master order."},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"orderEntry":{"title":"Order entry","description":"The ordered item.","type":"object","properties":{"id":{"description":"The ordered item ID.","type":"string"},"itemYrn":{"$ref":"#/components/schemas/YRN"},"fees":{"allOf":[{"$ref":"#/components/schemas/aggregateFee"},{"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},"amount":{"description":"The amount of items.","type":"integer"},"orderedAmount":{"description":"The ordered amount of items.","type":"integer"},"packedAmountInPc":{"description":"The packed amount of items.","type":"integer"},"effectiveQuantity":{"description":"Effective quantity is q calculated average quantity customer is paying for.","type":"number","format":"double"},"originalAmount":{"description":"The original amount. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"originalPrice":{"description":"The original price. This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality.","type":"number","deprecated":true},"unitPrice":{"type":"number","deprecated":true,"description":"**This field is deprecated**. Please use `calculatedUnitPrice` instead. The `calculatedUnitPrice` field provides the same value with updated functionality."},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"Product's unit price with tax values, can be skipped if deprecated `unitPrice` is provided for backward compatibility."}]},"measurementUnit":{"$ref":"#/components/schemas/measurementUnit"},"link":{"description":"Link to product.","type":"string"},"discounts":{"deprecated":true,"description":"The discount list. **This field is deprecated**. Please use `calculatedPrice.totalDiscount` instead. The `calculatedPrice.totalDiscount` field provides the same value with updated functionality."},"totalPrice":{"type":"number","deprecated":true,"description":"The total price of items. **This field is deprecated**. Please use `calculatedPrice.finalPrice` instead. The `calculatedPrice.finalPrice` field provides the same value with updated functionality."},"authorizedAmount":{"description":"The authorized amount. **This field is deprecated**. Please use `calculatedPrice.upliftValue` instead. The `calculatedPrice.upliftValue` field how much payment authorization should be increased for given item.","deprecated":true,"type":"number"},"product":{"$ref":"#/components/schemas/product"},"tax":{"allOf":[{"$ref":"#/components/schemas/tax"},{"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},"price":{"$ref":"#/components/schemas/price"},"metadata":{"$ref":"#/components/schemas/mixinsMetadata"},"mixins":{"type":"object"},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/orderEntryCalculatedPrice"},{"type":"object","description":"Detailed price calculation for a single line item with all pricing components. Can be skipped if deprecated `totalPrice` is provided for backward compatibility."}]},"priceMatchDetails":{"$ref":"#/components/schemas/priceMatchDetails"},"externalDiscounts":{"type":"array","description":"External discounts applied to this order entry.","items":{"$ref":"#/components/schemas/externalDiscount"}},"externalFees":{"type":"array","description":"External fees applied to this order entry.","items":{"$ref":"#/components/schemas/externalFee"}}},"required":["amount","calculatedUnitPrice","calculatedPrice"]},"YRN":{"type":"string","title":"YRN","description":"In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.\n\nIt is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.","minLength":1},"calculatedPrice":{"type":"object","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price."}},"description":"A price calculation model containing net and gross amounts along with their associated tax details.","required":["netValue","grossValue","taxValue"]},"measurementUnit":{"title":"Measurement Unit","description":"The entry measurement unit","type":"object","properties":{"unit":{"description":"Code of the unit, like `kg` or `l`.","type":"string"},"value":{"description":"Quantity of given unit.","type":"number"}},"required":["value"]},"product":{"title":"Product","description":"Product details.","type":"object","properties":{"id":{"description":"Unique identifier of a product.","type":"string"},"sku":{"description":"Product sku.","type":"string"},"code":{"description":"Unique code of a product.","type":"string"},"name":{"description":"Unique name of a product.","type":"string"},"localizedName":{"description":"A product's name represented as a map, with language as the key and the corresponding translated name as the value","type":"object","additionalProperties":{"type":"string"}},"description":{"description":"Product description.","type":"string"},"published":{"description":"Product published flag.","type":"boolean"},"productType":{"description":"Type of the product (BASIC, VARIANT, BUNDLE).","type":"string","enum":["BASIC","VARIANT","BUNDLE"]},"bundledProducts":{"description":"The collection of products assigned to the bundle.","type":"array","items":{"$ref":"#/components/schemas/bundleProduct"}},"images":{"description":"Product images.","type":"array","items":{"$ref":"#/components/schemas/media"}},"vendor":{"$ref":"#/components/schemas/vendor"},"mixins":{"description":"Product additional information.","type":"object","additionalProperties":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"The metadata of the product."}]}}},"bundleProduct":{"title":"Bundle Product","description":"Represents the product used in a bundle.","type":"object","properties":{"amount":{"description":"The number of given products assigned to the bundle.","type":"number"},"productId":{"description":"Id of the product assigned to the bundle.","type":"string"}}},"media":{"title":"Media","description":"The media.","type":"object","properties":{"id":{"description":"Unique identifier of a media file.","type":"string"},"url":{"description":"Media URL.","type":"string"},"stored":{"description":"Media stored flag.","type":"boolean","default":false}}},"mixinsMetadata":{"title":"Product Metadata","description":"Product Metadata","type":"object","additionalProperties":true,"properties":{"mixins":{"description":"A key-value map of mixins, where the mixin name is a key and schema url is a value","type":"object","additionalProperties":true},"version":{"description":"The document version number.","type":"integer"}}},"tax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"}},"required":["total"]},"taxLine":{"title":"taxLine","description":"Tax line details.","type":"object","properties":{"amount":{"description":"Tax line amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Tax code.","type":"string"},"name":{"description":"Tax name.","type":"string"},"rate":{"description":"Tax rate.","type":"number","default":0},"taxable":{"description":"Order's taxable amount.","type":"number"},"sequenceId":{"description":"Sequence ID.","type":"integer","default":0},"inclusive":{"description":"Inclusive flag.","type":"boolean","default":false}},"required":["amount","currency","sequenceId","inclusive"]},"taxTotal":{"title":"Tax total","description":"The tax total tax amount.","type":"object","properties":{"amount":{"description":"Total tax amount.","default":0,"type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"inclusive":{"description":"Total tax inclusive flag.","default":false,"type":"boolean"}},"required":["amount","currency","inclusive"]},"price":{"title":"Price","description":"Price details.","type":"object","properties":{"priceId":{"description":"Id of the price related to order entry.","type":"string"},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the returned prices belongs to any price list."},"effectiveAmount":{"description":"Effective amount is a calculated average item price after a discount.","type":"number"},"originalAmount":{"description":"Oryginal amount is a price set by the merchant.","type":"number"},"currency":{"description":"Currency of the entry price.","type":"string"},"salePrice":{"allOf":[{"$ref":"#/components/schemas/salePrice"},{"type":"object","description":"Attributes of the sale price."}]}}},"salePrice":{"title":"Sale Price","description":"The sale price.","type":"object","properties":{"discountAmount":{"description":"Amount of the discount for sale price promotion.","type":"number"},"discountRate":{"description":"Rate of the discount for sale price promotion.","type":"number"},"description":{"description":"The sale price description.","type":"string"}}},"orderEntryCalculatedPrice":{"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"],"description":"INTERNAL defined in commerce engine, EXTERNAL specified when an item is added to the order."},"name":{"type":"object","description":"Fee name."},"price":{"type":"object","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.","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 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/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."}}}]}},"required":["finalPrice"]},"calculatedPriceWithDiscounts":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","properties":{"appliedDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}}]},"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."},"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."},"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."},"origin":{"enum":["INTERNAL","EXTERNAL"],"description":"origin of the fee, `INTERNAL` defined in commerce engine, `EXTERNAL` specified when item is added to the cart."},"price":{"$ref":"#/components/schemas/calculatedPrice"},"discountedPrice":{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"}}},"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.","items":{"$ref":"#/components/schemas/calculatedAppliedDiscount"}}}},"priceMatchDetails":{"title":"priceMatchDetails","type":"object","properties":{"netValue":{"type":"number","format":"double","description":"The net value of the matched price"},"grossValue":{"type":"number","format":"double","description":"The gross value of the matched price"},"taxValue":{"type":"number","format":"double","description":"The calculated tax value"},"taxCode":{"type":"string","description":"The applied tax code"},"taxRate":{"type":"number","format":"double","description":"The applied tax rate"},"taxCountry":{"type":"string","description":"The tax country for which the price was matched"}},"description":"This model represents the price value retrieved from the price service"},"externalDiscount":{"type":"object","description":"External discount that was applied to order 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). For discountType=`PERCENT`, maximum is 100.0; for ABSOLUTE, there is no limit."},"includeFees":{"type":"boolean","description":"Flag indicating whether the discount is 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":"#/components/schemas/localizedValue"}],"description":"Fee name."},"feeType":{"type":"string","description":"Type of the fee.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"]},"feePercentage":{"type":"number","description":"Value of the fee as percentage. It must be provided when feeType equals `PERCENT`."},"feeAbsolute":{"type":"object","description":"Value of the 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 the fee absolute."},"amount":{"type":"number","description":"Value of the fee absolute."}}},"taxable":{"type":"boolean","description":"It marks whether tax should be included to the fee or not. A taxable fee must have the `taxCode` attribute provided."},"taxCode":{"type":"string","description":"Tax code of the fee."}}},"discount":{"title":"Discount","properties":{"code":{"description":"Discount's code.","type":"string"},"amount":{"description":"Amount of discount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"name":{"description":"Discount's name.","type":"string"},"discountRate":{"description":"Discount's rate.","type":"number"},"calculationType":{"description":"Discount's code.calculation type.","type":"string"},"discountCalculationType":{"description":"Determines whether the coupon is applied to the total or subtotal value of the order.","type":"string","enum":["SUBTOTAL","TOTAL"]},"discountType":{"description":"Discount's type.","type":"string"},"sequenceId":{"description":"Discount's unique sequence ID identifier.","type":"integer"},"link":{"allOf":[{"$ref":"#/components/schemas/reference"},{"type":"object","description":"Link to discount."}]},"categoryRestricted":{"description":"This flag indicates if discount is category restricted.","type":"boolean"},"restrictions":{"allOf":[{"$ref":"#/components/schemas/discountRestrictions"},{"type":"object","description":"The restrictions based on which the discount can be applied."}]}},"required":["code","currency"]},"reference":{"title":"Link","properties":{"id":{"description":"Unique identifier of a link.","type":"string"},"type":{"description":"Link type.","type":"string"},"url":{"description":"URL of the link.","type":"string"}},"required":["id","type","url"]},"discountRestrictions":{"title":"Discount Restrictions","properties":{"validFrom":{"description":"The date from which the discount restriction is valid.","type":"string"},"validUntil":{"description":"The date from which the discount restriction is valid.","type":"string"},"minOrderValue":{"allOf":[{"$ref":"#/components/schemas/discountRestrictionsPrice"},{"type":"object","description":"The minimum order price for which the discount is valid."}]},"includedCategories":{"description":"List of included categories.","type":"array","items":{"type":"string"}},"excludedCategories":{"description":"List of excluded categories.","type":"array","items":{"type":"string"}}}},"discountRestrictionsPrice":{"title":"Discount Restrictions Price","properties":{"amount":{"description":"The amount of discount price","type":"number"},"currency":{"description":"The currency of the price","type":"string"}}},"customer":{"title":"Customer","description":"Customer data. \n\nOne of these properties needs to be provided:\n- `name` for business customers (B2B)\n- `firstName` and `lastName` for individual customers (B2C)\n","properties":{"id":{"description":"Customer's unique identifier.","type":"string","default":"ANONYMOUS"},"name":{"description":"Customer's name.","type":"string"},"title":{"description":"Customer's title.","type":"string"},"firstName":{"description":"Customer's first name.","type":"string"},"middleName":{"description":"Customer's middle name.","type":"string"},"lastName":{"description":"Customer's last name.","type":"string"},"company":{"description":"Company name.","type":"string"},"email":{"description":"Customer's email address.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Customer additional information.","type":"object","additionalProperties":true}},"required":["email"]},"address":{"title":"Address","description":"Customer's address.","type":"object","properties":{"contactName":{"description":"Customer's name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"street":{"description":"Street name.","type":"string"},"streetNumber":{"description":"Street number.","type":"string"},"streetAppendix":{"description":"Street appendix.","type":"string"},"extraLine1":{"description":"Additional address information.","type":"string"},"extraLine2":{"description":"Additional address information.","type":"string"},"extraLine3":{"description":"Additional address information.","type":"string"},"extraLine4":{"description":"Additional address information.","type":"string"},"zipCode":{"description":"Customer's address - zip code.","type":"string"},"city":{"description":"City name.","type":"string"},"state":{"description":"State name.","type":"string"},"country":{"description":"Country name.","type":"string"},"contactPhone":{"description":"Customer's contact phone.","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/mixinsMetadata"},{"type":"object","description":"Metadata."}]},"mixins":{"description":"Additional address information.","type":"object","additionalProperties":true}},"required":["contactName","street","city","zipCode","country"]},"payment":{"title":"Payment","description":"Payment details.","type":"object","properties":{"method":{"description":"Payment method.","type":"string"},"status":{"description":"Payment status.","allOf":[{"$ref":"#/components/schemas/paymentStatus"}]},"paymentResponse":{"description":"Payment response.","type":"string"},"paidAmount":{"description":"Paid amount.","type":"number"},"refundAmount":{"description":"Refund amount.","type":"number"},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"transactionId":{"description":"The ID of the payment transaction.","type":"string"},"redirectUrl":{"description":"Redirect url.","type":"string"},"authorizedAmount":{"description":"Authorized amount.","type":"number"},"provider":{"description":"Payment provider.","type":"string"}},"required":["method","paidAmount","currency"]},"paymentStatus":{"type":"string","enum":["PENDING","AUTHORIZATION_SUCCESS","AUTHORIZATION_FAILURE","CAPTURE_SUCCESS","CAPTURE_FAILURE","SUCCESS","FAILURE","CANCELLATION_SUCCESS","CANCELLATION_FAILURE","REFUND_SUCCESS","REFUND_FAILURE"],"default":"PENDING","description":"Status of the payment."},"shipping":{"description":"Shipping details.","title":"Shipping","type":"object","properties":{"total":{"description":"Total shipping amount.","type":"object","properties":{"amount":{"type":"number","description":"Shipping amount.","default":0},"currency":{"type":"string","description":"Currency of the shipping amount."}}},"lines":{"description":"Shipping line list.","type":"array","items":{"$ref":"#/components/schemas/shippingLine"}}},"required":["total"]},"shippingLine":{"title":"Shipping line","description":"Shipping line.","type":"object","properties":{"amount":{"type":"number","description":"Shipping line amount.","default":0},"currency":{"description":"Three-letter currency code, compliant with the ISO 4217 standard.","type":"string"},"code":{"description":"Shipping line code.","type":"string"},"name":{"description":"Shipping line name.","type":"string"},"localizedName":{"description":"Shipping line name in a form of a map of translations.","type":"object","additionalProperties":{"type":"string"}},"discounts":{"description":"Shipping line discount.","type":"array","items":{"$ref":"#/components/schemas/discount"}},"tax":{"$ref":"#/components/schemas/shippingTax"},"link":{"$ref":"#/components/schemas/reference"},"shippingTaxCode":{"type":"string"}},"required":["code"]},"shippingTax":{"title":"Tax","description":"Tax details.","type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/taxLine"}},"total":{"$ref":"#/components/schemas/taxTotal"},"rate":{"description":"The rate of the shipping tax","type":"number"}},"required":["total"]},"deliveryWindow":{"title":"Delivery Window","type":"object","properties":{"id":{"type":"string","description":"Id of the delivery window"},"deliveryDate":{"type":"string","format":"date","description":"Delivery date."},"slotId":{"type":"string","description":"ID of the delivery slot"},"deliveryTimeRange":{"$ref":"#/components/schemas/deliveryTimeRange"},"deliveryCycle":{"type":"string","description":"Delivery cycle to which the order is assigned (containing date)"},"deliveryCycleName":{"type":"string","description":"Delivery cycle name to which the order is assigned"}}},"deliveryTimeRange":{"title":"Delivery Time Range","type":"object","properties":{"timeFrom":{"type":"string","format":"time","description":"Start Time"},"timeTo":{"type":"string","format":"time","description":"End Time"}}},"metadataMixins":{"title":"Metadata DTO","type":"object","additionalProperties":true,"properties":{"mixins":{"type":"object","additionalProperties":true},"version":{"type":"integer"}}},"orderCalculatedPrice":{"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 - `entries[].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 any 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 the 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."}}}]},"paymentFees":{"type":"array","description":"The list of payment fees applied to an order. Payment fees are not changed and are not discounted, even when a discount or coupon is applied to the total.","items":{"allOf":[{"$ref":"#/components/schemas/calculatedPaymentFee"},{"type":"object","properties":{"id":{"type":"string","description":"Payment fee identifier."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the payment fee. PERCENT for the fee’s `feePercentage`` multiplied by sum of line items `finalPrice` plus shipping cost. ABSOLUTE - monetary amount that is assigned to the payment method."},"price":{"description":"Calculated price of the fee.","properties":{"netValue":{"type":"number","format":"double","description":"The monetary amount of the fee, depending on the fee type. ABSOLUTE for the value of defined fee’s `feeAbsolute.amount` attribute. The amount is treated as `netValue`. PERCENT, when defined on fee level percentage, `feePercentage` attribute, of sum of all item line’s `finalPrice.netValue` plus cart’s `calculatedPrice.totalShipping.netValue`. If the fee is taxable and has a tax code, the gross value is calculated. Otherwise, `grossValue` is equal to `netValue`."},"grossValue":{"type":"number","format":"double","description":"For a fee where `taxable=true` and a valid `taxCode` is provided, the tax rate associated with that tax code is used to calculate `grossValue`. If the fee is not taxable, `netValue` is equal to `grossValue`."},"taxValue":{"type":"number","format":"double","description":"Tax value of the payment fee, it's the actual amount of tax that has to be paid."},"taxRate":{"type":"number","format":"double","description":"If a fee is defined with the attribute `taxable=true`, the tax rate is calculated based on the `taxCode` provided at the fee level. A taxable fee must have a defined `taxCode`."},"taxCode":{"type":"string","description":"The tax code defined at the fee level, for example STANDARD. The value must correspond to the available tax codes in the system configuration."}}}}}]}},"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 `entries[].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":{"type":"array","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."}}}]}}}}]},"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 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."}}}]}}}}]},"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":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithDiscounts"},{"type":"object","description":"The total shipping cost is calculated by summing `entries[].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.**","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":{"type":"array","description":"A list of discounts applied to shipping.","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."}}}]}}}}]},"finalPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPriceWithTaxAggregate"},{"type":"object","description":"The final price is the sum of `entries[].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."}}}]}}}}}]}}},"calculatedPaymentFee":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the fee."},"type":{"type":"string","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"description":"Type of the fee."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized names of the fee."},"price":{"$ref":"#/components/schemas/calculatedPrice"}},"title":"calculatedPaymentFee"},"calculatedPriceWithTaxAggregate":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"},{"type":"object","description":"A price calculation model that includes tax aggregate information.","properties":{"taxAggregate":{"$ref":"#/components/schemas/calculatedTaxAggregate"}}}]},"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"},"orderEntriesDto":{"properties":{"entries":{"title":"Entries of the order","type":"array","items":{"properties":{"entryId":{"type":"string","description":"Order entry id. Required if `productId` is not provided. Use for entry modification. Cannot be provided along with `productId`."},"productId":{"type":"string","description":"Id of the product added to the order. Required if `entryId` is not provided. Cannot be provided along with `entryId`."},"quantity":{"type":"number","description":"Quantity of the products added to the order. When set to `0` then such entries are removed from the order."}},"required":["quantity"]}}},"required":["entries"]}},"responses":{"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}/entries":{"post":{"tags":["Orders (Tenant-managed)"],"summary":"Adding entries to an order","description":"Updates the entries in the specific order and recalculates it. If provided entry is already assigned to the order then quantity of this entry is updated. If you want to remove entry from order then set quantity to 0.\n","operationId":"POST-order-update-order-entries","responses":{"200":{"description":"The request was successful. Recalculated order has been returned.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/salesOrder"}}}},"400":{"description":"Bad Request"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderEntriesDto"}}},"required":true}}}}}
```

## Splitting order

> Splits order into suborders based on the given criteria. It works for:\
> \- orders with \`CREATED\` status\
> \- orders where \`orderType\` = null, meaning that the order has not been split and there are not suborders of a master order.\
> \- orders without discounts, the ones with included discounts are not supported<br>

```json
{"openapi":"3.0.0","info":{"title":"Order Service","version":"0.0.1"},"tags":[{"name":"Orders (Tenant-managed)","description":"Manage tenant orders."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["order.order_update"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"order.order_post":"Needed to create new order as a customer.","order.order_read":"Needed to read order.","order.order_read_le":"Needed to read legal entity orders.","order.order_update":"Needed to update an order.","order.order_update_completed":"Needed to update an order with a `completed` status.","order.order_create":"Needed to create new order by merchant.","order.order_delete":"Needed to delete an order.","order.history_view":"Needed to view order when logged as a customer.","order.order_readascustomer":"Needed to read an order as a customer.","order.order_updateascustomer":"Needed to update an order as a customer.","order.order_read_by_vendor":"The scope allows vendor to read order with assigned vendor.","order.order_manage_by_vendor":"The scope allows vendor to manage order with assigned vendor."}}}}},"schemas":{"orderSplitResponse":{"type":"object","properties":{"masterOrder":{"type":"string","description":"ID of the order that was split. The same as in the path."},"splitBy":{"$ref":"#/components/schemas/splitBy"},"subOrders":{"type":"array","items":{"$ref":"#/components/schemas/splitItemResponse"}}}},"splitBy":{"type":"string","enum":["VENDOR_ID"],"description":"Specifies the criteria used to split a master order into suborders. Currently, only `VENDOR_ID` is supported."},"splitItemResponse":{"type":"object","properties":{"id":{"type":"string","description":"An ID of a suborder."},"uniqueValue":{"type":"string","description":"A unique value used to split the entries of a master order into separate suborders."}},"description":"Information about how the order was split from the master order."},"orderSplitRequest":{"type":"object","properties":{"splitBy":{"$ref":"#/components/schemas/splitBy"}}}},"responses":{"trait_restricted_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_order_404":{"description":"Order does not exist","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg conflict_resource","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"}},"required":["status","type"]}}}},"trait_500":{"description":"Some server side error occurred.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/order-v2/{tenant}/salesorders/{orderId}/split":{"post":{"tags":["Orders (Tenant-managed)"],"summary":"Splitting order","description":"Splits order into suborders based on the given criteria. It works for:\n- orders with `CREATED` status\n- orders where `orderType` = null, meaning that the order has not been split and there are not suborders of a master order.\n- orders without discounts, the ones with included discounts are not supported\n","operationId":"POST-order-split","responses":{"200":{"description":"The order has been successfully split.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderSplitResponse"}}}},"400":{"description":"Bad Request"},"403":{"$ref":"#/components/responses/trait_restricted_403"},"404":{"$ref":"#/components/responses/trait_order_404"},"500":{"$ref":"#/components/responses/trait_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/orderSplitRequest"}}},"required":true}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references/api-guides/orders/order/api-reference/orders-tenant-managed.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
