# Quote management

## Retrieving quotes

> Retrieves quotes. The response includes either all quotes or a subset of quotes based on the assigned access token scopes.\
> \*\*\*\
> \
> \### Required scopes (one of)\
> \
> &#x20; \* \`quote.quote\_read\` - assigned to employees to allow them to retrieve all tenant quotes\
> &#x20; \* \`quote.quote\_read\_own\` - assigned to customers to enable them to retrieve only the quotes that they created themselves or that were created on their behalf

```json
{"openapi":"3.0.1","info":{"title":"Quote Service","version":"0.0.1"},"tags":[{"name":"Quote management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["quote.quote_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"quote.quote_read":"","quote.quote_read_own":"","quote.quote_manage":"","quote.quote_manage_own":""}}}}},"parameters":{"trait_acceptLanguage_header":{"name":"Accept-Language","in":"header","required":false,"schema":{"type":"string"},"description":"List of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields. If a value is specified, then it must be present in the tenant configuration.\n* If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.\n* If the header is set to `*`, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.\n* If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.\n"},"X-Total-Count":{"name":"X-Total-Count","in":"header","required":false,"schema":{"type":"boolean","default":false},"description":"Flag indicating whether the total number of retrieved items should be returned.\n"},"trait_paged_pageSize":{"name":"pageSize","in":"query","description":"Number of items to be retrieved per page.\n","schema":{"default":60,"minimum":1,"type":"integer"}},"trait_paged_pageNumber":{"name":"pageNumber","in":"query","description":"Page number to be retrieved. The number of the first page is 1.\n","schema":{"default":1,"minimum":1,"type":"integer"}},"trait_sort":{"name":"sort","in":"query","description":"List of properties used to sort the results, separated by colons. The order of properties indicates their priority in sorting.\n\nPossible values:\n* `{fieldName}`\n* `{fieldName}:asc`\n* `{fieldName}:desc`\n\n**Note:** If you want to sort the results by localized properties, the possible values are:\n  * `{fieldName}.{language}`\n  * `{fieldName}.{language}:asc`\n  * `{fieldName}.{language}:desc`\n\nIf the sorting direction is not specified, the fields are sorted in ascending order.","schema":{"type":"string"}},"trait_q_param":{"name":"q","in":"query","description":"A standard query parameter is used to search for specific values.\n\n* Searching for items by string-based properties:\n  * By a field value: `q=siteCode:main`, where `siteCode` is the field name, and `main` is its desired value.\n  * By a localized field value: `q=items.product.name.en:apple_lobo`, where `name` is the field name of product, `en` is the language code, and `apple_lobo` is the field value expressed in the specified language. **Note**: This query works only for localized fields, which are stored in a map format, where `key` is the language code and `value` is the translation to particular language.\n* Searching for items by a number-based property:\n  * With a specific value: `q=items.quantity.quantity:20`\n  * With a value greater than: `q=items.quantity.quantity:>20`\n  * With a value lower than: `q=items.quantity.quantity:<20`\n  * With a value greater than or equal to: `q=items.quantity.quantity:>=20`\n  * With a value lower than or equal to: `q=items.quantity.quantity:<=20`\n  * With a value within a range of values: `q=items.quantity.quantity:(>=10 AND <=20)`\\\n   where `items.quantity.quantity` is the name of the number-based field, and `20` is its querying value.\n* Searching for items by a date-based property: All number-based property queries are also valid for dates. In that case, the date should be placed within double quotes: `q=metadataCreatedAt:(>=\"2021-05-18T07:27:27.455Z\" AND <\"2021-05-20T07:27:27.455Z\")`\n* Searching for items by a boolean-based property: `q=description.multiLanguage:true`, where `description.multiLanguage` is the boolean field name, and `true` is its desired value.\n* Searching for items with a nonexistent or empty property: `q=description.en:null`, where `description.en` is the field that has its value set to `null`.\n* Searching for items with an 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:(5c3325baa9812100098ff48f,5c3325d1a9812100098ff494)`, where `id` is the field name, and strings within the bracket are the desired values.\n* Searching for items by multiple fields: `q=id:5c3325baa9812100098ff48f siteCode:main` where `id` and `siteCode` are field names. All objects that contain the specified values are returned. Multiple fields (separated by space) can be specified. Multiple values for each field can also be specified in the format presented earlier.\n* Searching for items with string-based properties conforming to a regex: `q=siteCode:~ain` or `q=code:(~U PL)` - in case of searching for strings with space, where `siteCode` is the name of the field, and `ain` or `U PL` is its querying regex.\n* Searching for items with a localized string-based property conforming to a regex: `items.product.name.en:~(Yoghurt im)` - where `name` is the product field name, `en` is the desired language, and `Joghurt im` is the search term.\n","schema":{"type":"string"}},"trait_fields":{"name":"fields","in":"query","description":"Fields to be returned in the response.\n\nWhen this parameter is passed, only the `id` and `{fieldName}` are retrieved for each entry.\nYou can specify multiple fields by separating them with commas.\n","schema":{"type":"string"}}},"schemas":{"QuoteResponse":{"type":"object","properties":{"id":{"type":"string","description":"Quote ID\n\n**NOTE**:\nIf not specified during creation, this attribute is automatically generated. It is also possible to assign a custom ID."},"businessModel":{"type":"string","description":"Business model of the quote.","enum":["B2B","B2C"]},"customer":{"type":"object","description":"This attribute contains details about the customer for whom the quote was created.","properties":{"customerId":{"type":"string","description":"The ID of the customer for whom the quote was created."},"firstName":{"type":"string","description":"Customer's first name\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created."},"lastName":{"type":"string","description":"Customer's last name\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created."},"contactEmail":{"type":"string","description":"Customer's contact email\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created."}}},"employee":{"type":"object","description":"This attribute contains details about the employee that is processing the quote.","properties":{"employeeId":{"type":"string","description":"The ID of the employee that is processing the quote."},"firstName":{"type":"string","description":"Employee's first name\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created or the employee ID is updated."},"lastName":{"type":"string","description":"Employee's last name.\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created or the employee ID is updated."}}},"cartId":{"type":"string","description":"The ID of the cart from which the quote was created (not available when the quote was created manually)"},"company":{"type":"object","description":"The company for which the quote was created.","properties":{"name":{"type":"string","description":"The company name for which the quote was created."}}},"siteCode":{"type":"string","description":"The site code for which the quote was created"},"orderId":{"type":"string","description":"The ID of the order which was created based on the quote. The order is created and assigned to the quote when status of the quote transitions to `ACCEPTED`."},"currency":{"type":"string","description":"The currency of the quote prices."},"status":{"type":"object","description":"The status of the quote.","properties":{"value":{"type":"string","description":"The status value of the quote."},"comment":{"type":"string","description":"Comment relating to the status."},"quoteReason":{"allOf":[{"$ref":"#/components/schemas/QuoteReasonResponse"},{"type":"object","description":"The reason for status change."}]}}},"validTo":{"type":"string","format":"date-time","description":"The date until which the quote is valid and can be accepted by the customer."},"comment":{"type":"object","description":"Employee and customer comments.","properties":{"employeeComment":{"type":"string","description":"Employee comment"}}},"billingAddress":{"$ref":"#/components/schemas/AddressResponse"},"shippingAddress":{"$ref":"#/components/schemas/AddressResponse"},"totalPrice":{"type":"object","description":"The calculated total price details.","properties":{"currency":{"type":"string","description":"Currency of the value."},"netValue":{"type":"number","description":"The total net value."},"grossValue":{"type":"number","description":"The total gross value."},"taxValue":{"type":"number","description":"The amount of the tax for the total price."}}},"subtotalPrice":{"type":"object","description":"The calculated quote subtotal price.","properties":{"currency":{"type":"string","description":"Currency of the value."},"netValue":{"type":"number","description":"The subtotal net value."},"grossValue":{"type":"number","description":"The subtotal gross value."},"taxValue":{"type":"number","description":"The subtotal tax value."}}},"taxAggregate":{"type":"object","description":"Tax aggregation of the total price.","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The tax code."},"amount":{"type":"number","description":"The amount of the tax."},"rate":{"type":"number","description":"The tax rate."},"taxable":{"type":"number","description":"The total taxable amount."}}}}}},"shipping":{"allOf":[{"$ref":"#/components/schemas/QuoteShipping"},{"type":"object","properties":{"grossValue":{"type":"number","description":"Gross value of the shipping cost."},"methodName":{"type":"object","description":"Localized name of the shipping method selected by the customer.","additionalProperties":{"type":"string"}}}}]},"items":{"type":"array","description":"A list of quote items.","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the quote item used for patch operations on the item."},"quantity":{"type":"object","description":"The attribute contains details about the item quantity.","properties":{"quantity":{"type":"number","description":"The quantity of the item that is used for the price calculation."},"unitCode":{"type":"string","description":"The unit code of the quantity (it must be one of the units defined in the Unit Handling Service)."}}},"price":{"type":"object","description":"Item price details.","properties":{"type":{"type":"string","description":"Defines if product is external or internal. If the product is internal, it's taken from the Emporix Product Service. If the price is external, it's a custom product from external system.","enum":["INTERNAL","EXTERNAL"]},"priceId":{"type":"string","description":"The ID of the price that was initially assigned to the item."},"unitPrice":{"type":"number","description":"The original unit price of the item that is copied from the initial price."},"newUnitPrice":{"type":"number","description":"The new unit price that is auto-calculated based on provided `quantity` and `totalNetValue` values."},"discount":{"type":"number","description":"The difference in percentage between `unitPrice` and `newUnitPrice`."},"totalNetValue":{"type":"number","description":"The total net price of the item that is initially based on the provided price, but it can be overridden to allow for a merchant discount."},"tax":{"type":"object","description":"This attribute contains information about the calculated item tax.","properties":{"taxClass":{"type":"string","description":"The tax class assigned to the item is initially copied from the initial price."},"taxRate":{"type":"number","description":"The tax rate that is copied from the initial price."},"prices":{"type":"object","description":"The auto-calculated item net and gross prices ","properties":{"grossValue":{"type":"number"},"netValue":{"type":"number"}}}}},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Metadata request.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true}}}}},"product":{"type":"object","description":"Product details.","properties":{"type":{"type":"string","description":"Defines if product is external or internal. If the product is internal, it's taken from the Emporix Product Service. If the price is external, it's a custom product from external system.","enum":["INTERNAL","EXTERNAL"]},"productId":{"type":"string","description":"The ID of the product or variant assigned to the quote item."},"name":{"type":"object","description":"This attribute contains the product name language map.\n\n**NOTE**:\nAfter the item has been added to the quote, the product name language map attribute is automatically populated."},"media":{"type":"object","description":"This attribute comprises the product media information and is automatically populated upon the creation of the quote.","properties":{"id":{"type":"string","description":"ID of the media."},"contentType":{"type":"string","description":"The content type of the media. For example: `image/jpg`."},"url":{"type":"string","description":"The url to the product media."}}},"taxClasses":{"type":"object","description":"Map of key-value pairs that associates tax classes with locations (countries)."},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Metadata request.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true}}}}}}}},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Quote metadata details.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true},"version":{"type":"integer","description":"Version of the quote that is used for the optimistic locking handling."},"createdAt":{"type":"string","format":"date-time","description":"Quote creation timestamp."},"modifiedAt":{"type":"string","format":"date-time","description":"Quote modification timestamp."}}},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"QuoteReasonResponse":{"type":"object","properties":{"id":{"type":"string","description":"The quote reason ID."},"type":{"type":"string","enum":["CHANGE","DECLINE"],"description":"Type of the quote reason."},"message":{"oneOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"string"}],"description":"Localized message - can be either string or map with languages as map's keys accordingly to specified 'Accept-Language' header."},"code":{"type":"string","description":"Code of the reason for the quote status change."},"metadata":{"type":"object","description":"The Quote Reason metadata details.","properties":{"version":{"type":"integer","description":"Version of the quote reason that is used for the optimistic locking handling."},"createdAt":{"type":"string","format":"date-time","description":"The Quote Reason creation timestamp."},"modifiedAt":{"type":"string","format":"date-time","description":"The Quote Reason modification timestamp."}}}}},"AddressResponse":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the address."},"name":{"type":"string","description":"The name of the address."},"addressLine1":{"type":"string","description":"First line of the address."},"addressLine2":{"type":"string","description":"Second line of the address."},"city":{"type":"string","description":"City name."},"postcode":{"type":"string","description":"The postal code of the city."},"state":{"type":"string","description":"The state where the city is located."},"countryCode":{"type":"string","description":"The code of the country location."}}},"QuoteShipping":{"type":"object","description":"The shipping cost of the quote.","properties":{"value":{"type":"number","description":"Net value of the shipping cost."},"methodId":{"type":"string","description":"Shipping method's unique identifier."},"zoneId":{"type":"string","description":"Shipping zone identifier."},"shippingTaxCode":{"type":"string","description":"Tax code of the shipping method."}}},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the quotes.\n\n**Purpose**: Restricts quote visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access quotes with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view quotes with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**:\n- If quote is created by a customer (based on a cart) and `restriction` property is not set, the `restriction` value of quote is inherited from customer's restriction.\n- If a quote is created by an employee and the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with quote's siteCode property.\n"},"ErrorResponse":{"required":["code","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}},"responses":{"Bad_request_400":{"description":"Unsupported language provided.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"Unathorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. It usually means that tenant from the token does not match tenant from path.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}}}},"paths":{"/quote/{tenant}/quotes":{"get":{"tags":["Quote management"],"summary":"Retrieving quotes","description":"Retrieves quotes. The response includes either all quotes or a subset of quotes based on the assigned access token scopes.\n***\n\n### Required scopes (one of)\n\n  * `quote.quote_read` - assigned to employees to allow them to retrieve all tenant quotes\n  * `quote.quote_read_own` - assigned to customers to enable them to retrieve only the quotes that they created themselves or that were created on their behalf","operationId":"GET-quote-list-quotes","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/trait_acceptLanguage_header"},{"$ref":"#/components/parameters/X-Total-Count"},{"$ref":"#/components/parameters/trait_paged_pageSize"},{"$ref":"#/components/parameters/trait_paged_pageNumber"},{"$ref":"#/components/parameters/trait_sort"},{"$ref":"#/components/parameters/trait_q_param"},{"$ref":"#/components/parameters/trait_fields"}],"responses":{"200":{"description":"The request was successful. Quote's details are returned.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QuoteResponse"}}}}},"400":{"$ref":"#/components/responses/Bad_request_400"},"401":{"$ref":"#/components/responses/Unathorized_401"},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Creating a quote

> Generates a new quote, which can be created either manually using a complete quote definition that includes items, or by copying the details from cart.\
> \
> \*\*\*\
> \
> \### Required scopes\
> \
> &#x20; \* \`quote.quote\_manage\` - required for the employee to create a quote\
> &#x20; \* \`quote.quote\_manage\_own\` - required for the customer to be able to create a quote from cart\
> &#x20; \* \`cart.cart\_manage\_external\_prices\` - required for external prices<br>

```json
{"openapi":"3.0.1","info":{"title":"Quote Service","version":"0.0.1"},"tags":[{"name":"Quote management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["quote.quote_manage","quote.quote_manage_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"quote.quote_read":"","quote.quote_read_own":"","quote.quote_manage":"","quote.quote_manage_own":""}}}}},"schemas":{"QuoteCreateRequest":{"type":"object","description":"The schema specifies the attributes that must be provided when creating a quote manually.","properties":{"id":{"type":"string","description":"The ID for a quote can either be manually provided at the time of the quote creation, or is automatically generated if not provided."},"customerId":{"type":"string","description":"The customer ID for which the new quote is created. Either this attribute or the `customerEmail` attribute is required for the quote creation"},"employeeId":{"type":"string","description":"The employee ID for which the new quote is created. By default, the employeeId is taken from session token, but in case the session token is not provided, employeeId is taken from the payload. Default employee from the configuration will be assigned to the quote in case session token nor 'employeeId' is not provided."},"companyName":{"type":"string","description":"The name of the merchant company."},"siteCode":{"type":"string","description":"The site code for which the quote is created."},"currency":{"type":"string","description":"The currency for which the quote is created."},"billingAddressId":{"type":"string","description":"For B2B customers, it represents the location which should specify the billing address. For B2C customers, it represents identifier of customer's billing address."},"shippingAddressId":{"type":"string","description":"For B2B customers, it represents the location which should specify the shipping address. For B2C customers, it represents identifier of customer's shipping address."},"validTo":{"type":"string","format":"date-time","description":"The date until which the quote is valid for the customer. After this date, the quote cannot be approved and transformed into order by the customer."},"shipping":{"$ref":"#/components/schemas/QuoteShipping"},"items":{"type":"array","description":"Quote items.","items":{"type":"object","properties":{"itemId":{"type":"string","description":"ID of the item. It's generated automatically when it's not provided."},"quantity":{"type":"object","description":"The quantity of the quote item in a given unit.","properties":{"quantity":{"type":"number","description":"The quantity of quote items."},"unitCode":{"type":"string","description":"The unit of the quantity as defined in the Unit Handling Service."}},"required":["quantity","unitCode"]},"product":{"type":"object","description":"Product reference.","required":["productId"],"properties":{"type":{"type":"string","description":"Defines if product is external or internal. If the product is internal, it's taken from the Emporix Product Service. If the price is external, it's a custom product from external system.","enum":["INTERNAL","EXTERNAL"]},"productId":{"type":"string","description":"Product or variant ID."},"name":{"type":"object","additionalProperties":{"type":"string"},"description":"Localized name of a product. Used for the `EXTERNAL` products as the `INTERNAL` ones are populated from the product catalog data."},"media":{"type":"object","description":"Media object that can be provided for an `EXTERNAL` product. `INTERNAL` products have media populated automatically and override the given value.","properties":{"id":{"type":"string","description":"ID of the media."},"contentType":{"type":"string","description":"The content type of the media. For example: `image/jpg`."},"url":{"type":"string","description":"The url to the product media."}}},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Metadata request.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true}}}}},"price":{"type":"object","description":"Matched price of the product.","properties":{"type":{"type":"string","description":"Defines if price is internal or external. If the price is internal, it's taken from the Emporix Price Service. If the price is external, it's a custom price from external system.","enum":["INTERNAL","EXTERNAL"]},"priceId":{"type":"string","description":"ID of the matched price. Required only for type=`INTERNAL`."},"priceListId":{"type":"string","description":"Identifier of price list. The field should be populated only in case when the price belongs to any price list."},"unitPrice":{"type":"number","description":"Effective unit price of the product."},"totalNetValue":{"type":"number","description":"Total net value for the entire quantity of the item."},"tax":{"type":"object","description":"Tax information of the item.","required":["taxClass","taxRate"],"properties":{"taxClass":{"type":"string","description":"Matched tax class of the item."},"taxRate":{"type":"number","description":"Tax rate of the item."}}}},"required":["priceId","unitPrice","totalNetValue","tax"]},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Metadata request.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true}}}},"required":["product"]}},"restriction":{"$ref":"#/components/schemas/Restriction"},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Metadata request.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true}}},"customerEmail":{"type":"string","description":"The contact email that identifies the customer. Either this attribute or the `customerId` attribute is mandatory for the quote creation request."}},"required":["customerId","siteCode","currency","billingAddressId","shippingAddressId"]},"QuoteShipping":{"type":"object","description":"The shipping cost of the quote.","properties":{"value":{"type":"number","description":"Net value of the shipping cost."},"methodId":{"type":"string","description":"Shipping method's unique identifier."},"zoneId":{"type":"string","description":"Shipping zone identifier."},"shippingTaxCode":{"type":"string","description":"Tax code of the shipping method."}}},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the quotes.\n\n**Purpose**: Restricts quote visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access quotes with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view quotes with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**:\n- If quote is created by a customer (based on a cart) and `restriction` property is not set, the `restriction` value of quote is inherited from customer's restriction.\n- If a quote is created by an employee and the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with quote's siteCode property.\n"},"QuoteCreateFromCartRequest":{"type":"object","description":"This schema includes the attributes that are required to be provided when creating a quote from the cart.","title":"QuoteCreateFromCartRequest","required":["cartId"],"properties":{"cartId":{"type":"string","description":"ID of the cart from which the new quote should be created."},"employeeId":{"type":"string","description":"The employee ID for which the new quote is created. By default, the employeeId is taken from the configuration, but in case the 'employeeId' property is provided, the employeeId from the request is assigned to the quote. Only user of EMPLOYEE type can assign employee to the quote."},"billingAddressId":{"type":"string","description":"For B2B customers, it represents the location which should specify the billing address. For B2C customers, it represents identifier of customer's billing address."},"shippingAddressId":{"type":"string","description":"For B2B customers, it represents the location which should specify the shipping address. For B2C customers, it represents identifier of customer's shipping address."},"shipping":{"$ref":"#/components/schemas/QuoteShipping"}}},"QuoteIdResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the generated document."}},"description":"ID of the generated quote."},"ErrorResponse":{"required":["code","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}},"responses":{"Bad_request_400_cl":{"description":"Unsupported content language provided.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"Unathorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. It usually means that tenant from the token does not match tenant from path.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Conflict_409":{"description":"Conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/quote/{tenant}/quotes":{"post":{"tags":["Quote management"],"summary":"Creating a quote","description":"Generates a new quote, which can be created either manually using a complete quote definition that includes items, or by copying the details from cart.\n\n***\n\n### Required scopes\n\n  * `quote.quote_manage` - required for the employee to create a quote\n  * `quote.quote_manage_own` - required for the customer to be able to create a quote from cart\n  * `cart.cart_manage_external_prices` - required for external prices\n","operationId":"POST-quote-create-quote","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/QuoteCreateRequest"},{"$ref":"#/components/schemas/QuoteCreateFromCartRequest"}]}}},"required":true,"description":""},"responses":{"201":{"description":"The request was successful. The Quote has been created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteIdResponse"}}}},"400":{"$ref":"#/components/responses/Bad_request_400_cl"},"401":{"$ref":"#/components/responses/Unathorized_401"},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"$ref":"#/components/responses/Conflict_409"}}}}}}
```

## Retrieving a single quote

> Retrieves a quote by a given id.\
> \
> \*\*\*\
> \
> \### Required scopes\
> \
> &#x20; \* \`quote.quote\_read\` - allows employees to retrieve any quote\
> &#x20; \* \`quote.quote\_read\_own\` - allows customers to retrieve their own quote<br>

```json
{"openapi":"3.0.1","info":{"title":"Quote Service","version":"0.0.1"},"tags":[{"name":"Quote management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["quote.quote_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"quote.quote_read":"","quote.quote_read_own":"","quote.quote_manage":"","quote.quote_manage_own":""}}}}},"parameters":{"trait_acceptLanguage_header":{"name":"Accept-Language","in":"header","required":false,"schema":{"type":"string"},"description":"List of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields. If a value is specified, then it must be present in the tenant configuration.\n* If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.\n* If the header is set to `*`, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.\n* If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.\n"}},"schemas":{"QuoteResponse":{"type":"object","properties":{"id":{"type":"string","description":"Quote ID\n\n**NOTE**:\nIf not specified during creation, this attribute is automatically generated. It is also possible to assign a custom ID."},"businessModel":{"type":"string","description":"Business model of the quote.","enum":["B2B","B2C"]},"customer":{"type":"object","description":"This attribute contains details about the customer for whom the quote was created.","properties":{"customerId":{"type":"string","description":"The ID of the customer for whom the quote was created."},"firstName":{"type":"string","description":"Customer's first name\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created."},"lastName":{"type":"string","description":"Customer's last name\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created."},"contactEmail":{"type":"string","description":"Customer's contact email\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created."}}},"employee":{"type":"object","description":"This attribute contains details about the employee that is processing the quote.","properties":{"employeeId":{"type":"string","description":"The ID of the employee that is processing the quote."},"firstName":{"type":"string","description":"Employee's first name\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created or the employee ID is updated."},"lastName":{"type":"string","description":"Employee's last name.\n\n**NOTE**:\nThis attribute is filled automatically after the quote is created or the employee ID is updated."}}},"cartId":{"type":"string","description":"The ID of the cart from which the quote was created (not available when the quote was created manually)"},"company":{"type":"object","description":"The company for which the quote was created.","properties":{"name":{"type":"string","description":"The company name for which the quote was created."}}},"siteCode":{"type":"string","description":"The site code for which the quote was created"},"orderId":{"type":"string","description":"The ID of the order which was created based on the quote. The order is created and assigned to the quote when status of the quote transitions to `ACCEPTED`."},"currency":{"type":"string","description":"The currency of the quote prices."},"status":{"type":"object","description":"The status of the quote.","properties":{"value":{"type":"string","description":"The status value of the quote."},"comment":{"type":"string","description":"Comment relating to the status."},"quoteReason":{"allOf":[{"$ref":"#/components/schemas/QuoteReasonResponse"},{"type":"object","description":"The reason for status change."}]}}},"validTo":{"type":"string","format":"date-time","description":"The date until which the quote is valid and can be accepted by the customer."},"comment":{"type":"object","description":"Employee and customer comments.","properties":{"employeeComment":{"type":"string","description":"Employee comment"}}},"billingAddress":{"$ref":"#/components/schemas/AddressResponse"},"shippingAddress":{"$ref":"#/components/schemas/AddressResponse"},"totalPrice":{"type":"object","description":"The calculated total price details.","properties":{"currency":{"type":"string","description":"Currency of the value."},"netValue":{"type":"number","description":"The total net value."},"grossValue":{"type":"number","description":"The total gross value."},"taxValue":{"type":"number","description":"The amount of the tax for the total price."}}},"subtotalPrice":{"type":"object","description":"The calculated quote subtotal price.","properties":{"currency":{"type":"string","description":"Currency of the value."},"netValue":{"type":"number","description":"The subtotal net value."},"grossValue":{"type":"number","description":"The subtotal gross value."},"taxValue":{"type":"number","description":"The subtotal tax value."}}},"taxAggregate":{"type":"object","description":"Tax aggregation of the total price.","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The tax code."},"amount":{"type":"number","description":"The amount of the tax."},"rate":{"type":"number","description":"The tax rate."},"taxable":{"type":"number","description":"The total taxable amount."}}}}}},"shipping":{"allOf":[{"$ref":"#/components/schemas/QuoteShipping"},{"type":"object","properties":{"grossValue":{"type":"number","description":"Gross value of the shipping cost."},"methodName":{"type":"object","description":"Localized name of the shipping method selected by the customer.","additionalProperties":{"type":"string"}}}}]},"items":{"type":"array","description":"A list of quote items.","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the quote item used for patch operations on the item."},"quantity":{"type":"object","description":"The attribute contains details about the item quantity.","properties":{"quantity":{"type":"number","description":"The quantity of the item that is used for the price calculation."},"unitCode":{"type":"string","description":"The unit code of the quantity (it must be one of the units defined in the Unit Handling Service)."}}},"price":{"type":"object","description":"Item price details.","properties":{"type":{"type":"string","description":"Defines if product is external or internal. If the product is internal, it's taken from the Emporix Product Service. If the price is external, it's a custom product from external system.","enum":["INTERNAL","EXTERNAL"]},"priceId":{"type":"string","description":"The ID of the price that was initially assigned to the item."},"unitPrice":{"type":"number","description":"The original unit price of the item that is copied from the initial price."},"newUnitPrice":{"type":"number","description":"The new unit price that is auto-calculated based on provided `quantity` and `totalNetValue` values."},"discount":{"type":"number","description":"The difference in percentage between `unitPrice` and `newUnitPrice`."},"totalNetValue":{"type":"number","description":"The total net price of the item that is initially based on the provided price, but it can be overridden to allow for a merchant discount."},"tax":{"type":"object","description":"This attribute contains information about the calculated item tax.","properties":{"taxClass":{"type":"string","description":"The tax class assigned to the item is initially copied from the initial price."},"taxRate":{"type":"number","description":"The tax rate that is copied from the initial price."},"prices":{"type":"object","description":"The auto-calculated item net and gross prices ","properties":{"grossValue":{"type":"number"},"netValue":{"type":"number"}}}}},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Metadata request.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true}}}}},"product":{"type":"object","description":"Product details.","properties":{"type":{"type":"string","description":"Defines if product is external or internal. If the product is internal, it's taken from the Emporix Product Service. If the price is external, it's a custom product from external system.","enum":["INTERNAL","EXTERNAL"]},"productId":{"type":"string","description":"The ID of the product or variant assigned to the quote item."},"name":{"type":"object","description":"This attribute contains the product name language map.\n\n**NOTE**:\nAfter the item has been added to the quote, the product name language map attribute is automatically populated."},"media":{"type":"object","description":"This attribute comprises the product media information and is automatically populated upon the creation of the quote.","properties":{"id":{"type":"string","description":"ID of the media."},"contentType":{"type":"string","description":"The content type of the media. For example: `image/jpg`."},"url":{"type":"string","description":"The url to the product media."}}},"taxClasses":{"type":"object","description":"Map of key-value pairs that associates tax classes with locations (countries)."},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Metadata request.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true}}}}}}}},"mixins":{"type":"object","description":"Mixins request.","additionalProperties":true},"metadata":{"type":"object","description":"Quote metadata details.","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":true},"version":{"type":"integer","description":"Version of the quote that is used for the optimistic locking handling."},"createdAt":{"type":"string","format":"date-time","description":"Quote creation timestamp."},"modifiedAt":{"type":"string","format":"date-time","description":"Quote modification timestamp."}}},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"QuoteReasonResponse":{"type":"object","properties":{"id":{"type":"string","description":"The quote reason ID."},"type":{"type":"string","enum":["CHANGE","DECLINE"],"description":"Type of the quote reason."},"message":{"oneOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"string"}],"description":"Localized message - can be either string or map with languages as map's keys accordingly to specified 'Accept-Language' header."},"code":{"type":"string","description":"Code of the reason for the quote status change."},"metadata":{"type":"object","description":"The Quote Reason metadata details.","properties":{"version":{"type":"integer","description":"Version of the quote reason that is used for the optimistic locking handling."},"createdAt":{"type":"string","format":"date-time","description":"The Quote Reason creation timestamp."},"modifiedAt":{"type":"string","format":"date-time","description":"The Quote Reason modification timestamp."}}}}},"AddressResponse":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the address."},"name":{"type":"string","description":"The name of the address."},"addressLine1":{"type":"string","description":"First line of the address."},"addressLine2":{"type":"string","description":"Second line of the address."},"city":{"type":"string","description":"City name."},"postcode":{"type":"string","description":"The postal code of the city."},"state":{"type":"string","description":"The state where the city is located."},"countryCode":{"type":"string","description":"The code of the country location."}}},"QuoteShipping":{"type":"object","description":"The shipping cost of the quote.","properties":{"value":{"type":"number","description":"Net value of the shipping cost."},"methodId":{"type":"string","description":"Shipping method's unique identifier."},"zoneId":{"type":"string","description":"Shipping zone identifier."},"shippingTaxCode":{"type":"string","description":"Tax code of the shipping method."}}},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the quotes.\n\n**Purpose**: Restricts quote visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access quotes with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view quotes with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Restriction Synchronization**:\n- If quote is created by a customer (based on a cart) and `restriction` property is not set, the `restriction` value of quote is inherited from customer's restriction.\n- If a quote is created by an employee and the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with quote's siteCode property.\n"},"ErrorResponse":{"required":["code","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}},"responses":{"Bad_request_400":{"description":"Unsupported language provided.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"Unathorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. It usually means that tenant from the token does not match tenant from path.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Not_Found_404":{"description":"Given resource cannot be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/quote/{tenant}/quotes/{quoteId}":{"get":{"tags":["Quote management"],"summary":"Retrieving a single quote","description":"Retrieves a quote by a given id.\n\n***\n\n### Required scopes\n\n  * `quote.quote_read` - allows employees to retrieve any quote\n  * `quote.quote_read_own` - allows customers to retrieve their own quote\n","operationId":"GET-quote-retrieve-quote","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"quoteId","in":"path","description":"Quote unique identifier generated when the quote is created.\n","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/trait_acceptLanguage_header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteResponse"}}}},"400":{"$ref":"#/components/responses/Bad_request_400"},"401":{"$ref":"#/components/responses/Unathorized_401"},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"$ref":"#/components/responses/Not_Found_404"}}}}}}
```

## Deleting a quote

> Deletes a quote with a given quote ID.\
> \*\*\*\
> \
> \### Required scopes\
> \
> &#x20; \* \`quote.quote\_manage\` - the quote can be deleted by an employee

```json
{"openapi":"3.0.1","info":{"title":"Quote Service","version":"0.0.1"},"tags":[{"name":"Quote management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["quote.quote_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"quote.quote_read":"","quote.quote_read_own":"","quote.quote_manage":"","quote.quote_manage_own":""}}}}},"responses":{"Unathorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. It usually means that tenant from the token does not match tenant from path.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}}},"schemas":{"ErrorResponse":{"required":["code","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/quote/{tenant}/quotes/{quoteId}":{"delete":{"summary":"Deleting a quote","tags":["Quote management"],"operationId":"DELETE-quote-remove-quote","description":"Deletes a quote with a given quote ID.\n***\n\n### Required scopes\n\n  * `quote.quote_manage` - the quote can be deleted by an employee","responses":{"204":{"description":"Quote has been deleted successfully."},"401":{"$ref":"#/components/responses/Unathorized_401"},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Partially updating a quote

> Partially updates a quote with a given ID. Single update may contain multiple partial updates in the form of an array. It contains the allowed operations list:\
> &#x20; \- \`add\` - adding an item to the items list\
> &#x20; \- \`remove\` - removing an item from the items list\
> &#x20; \- \`replace\` - replacing an item with given ID with new definition which may contain custom price proposal or defined price\
> \
> After events are saved, some of the information is retrieved in the async way from other services: full price definition is based on the provided price ID, and the full product name is based on the provided product ID.\
> \
> \*\*\*\
> \
> \### Required scopes\
> \
> &#x20; \* \`quote.quote\_manage\` - allows employees or external api calls to modify all quotes\
> &#x20; \* \`quote.quote\_manage\_own\` - allows customers to modify only their own quotes by modifying the status to either \`ACCEPTED\` or \`DECLINED\`.<br>

```json
{"openapi":"3.0.1","info":{"title":"Quote Service","version":"0.0.1"},"tags":[{"name":"Quote management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["quote.quote_manage","quote.quote_manage_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"quote.quote_read":"","quote.quote_read_own":"","quote.quote_manage":"","quote.quote_manage_own":""}}}}},"responses":{"Bad_request_400_cl":{"description":"Unsupported content language provided.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"Unathorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. It usually means that tenant from the token does not match tenant from path.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Not_Found_404":{"description":"Given resource cannot be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"required":["code","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}},"QuoteUpdateRequest":{"type":"array","description":"Quote update operation list.","items":{"type":"object","properties":{"op":{"type":"string","enum":["ADD","REMOVE","REPLACE"]},"path":{"type":"string","enum":["/status","/validTo","/comment","/billingAddressId","/shippingAddressId","/companyName","/customerId","/shipping","/restriction","/items","/items/{itemId}","/items/{itemId}/price","/items/{itemId}/mixins/{mixinsPath}","/items/{itemId}/metadata/mixins/{mixinsPath}","/items/{itemId}/product/mixins/{mixinsPath}","/items/{itemId}/product/metadata/mixins/{mixinsPath}","/mixins/{mixinsPath}","/metadata/{mixinsPath}"]},"value":{"$ref":"#/components/schemas/QuoteUpdateValues"}},"required":["op","path"]}},"QuoteUpdateValues":{"anyOf":[{"$ref":"#/components/schemas/QuoteItemUpdate"},{"$ref":"#/components/schemas/QuoteItemsReplaceUpdate"},{"$ref":"#/components/schemas/QuoteItemUpdatePrice"},{"$ref":"#/components/schemas/QuoteUpdateStatus"},{"$ref":"#/components/schemas/QuoteShipping"},{"$ref":"#/components/schemas/QuoteItemIds"},{"type":"string","description":"Value of the string type."},{"type":"object","description":"Mixin request."}]},"QuoteItemUpdate":{"type":"object","description":"Quote item model.","properties":{"quantity":{"type":"object","properties":{"quantity":{"type":"number"},"unitCode":{"type":"string"}}},"price":{"$ref":"#/components/schemas/QuoteItemUpdatePriceRow"},"product":{"type":"object","properties":{"productId":{"type":"string"}}}},"required":["itemType","quantity","price","product"]},"QuoteItemUpdatePriceRow":{"type":"object","description":"Price details","properties":{"priceId":{"type":"string","description":"The ID of the matched price"},"unitePrice":{"minimum":0,"type":"number","description":"The effective unit price of the product"},"totalNetValue":{"minimum":0,"type":"number","description":"The total net value for the entire quantity of the item."},"tax":{"type":"object","description":"The tax information of the item.","required":["taxClass"],"properties":{"taxClass":{"type":"string","description":"The matched tax class of the item."},"taxRate":{"type":"number","description":"The tax rate of the item."}}}},"required":["tax"]},"QuoteItemsReplaceUpdate":{"type":"array","description":"Quote item ID.","items":{"allOf":[{"$ref":"#/components/schemas/QuoteItemUpdate"},{"type":"object","properties":{"itemId":{"type":"string","description":"ID of the item. It's generated automatically when it's not provided."}}}]}},"QuoteItemUpdatePrice":{"type":"object","description":"TotalNetValue item model.","properties":{"totalNetValue":{"type":"number"}}},"QuoteUpdateStatus":{"type":"object","description":"Quote status.","properties":{"value":{"type":"string","description":"The status value of the code."},"comment":{"type":"string","description":"The comment to the status."},"quoteReasonId":{"type":"string","description":"The ID of the quote reason. Can be provided only in following scenarios:\n- when changing state from OPEN to IN_PROGRESS - quote reason has to be of CHANGE type\n- when changing state from OPEN to DECLINED - quote reason has to be of DECLINE type\n- when changing state from IN_PROGRESS to DECLINED_BY_MERCHANT - quote reason has to be of DECLINE type"}},"required":["value"]},"QuoteShipping":{"type":"object","description":"The shipping cost of the quote.","properties":{"value":{"type":"number","description":"Net value of the shipping cost."},"methodId":{"type":"string","description":"Shipping method's unique identifier."},"zoneId":{"type":"string","description":"Shipping zone identifier."},"shippingTaxCode":{"type":"string","description":"Tax code of the shipping method."}}},"QuoteItemIds":{"type":"array","description":"List of item IDs.","items":{"type":"object","properties":{"itemId":{"type":"string","description":"ID of the item."}}}}}},"paths":{"/quote/{tenant}/quotes/{quoteId}":{"patch":{"operationId":"PATCH-quote-update-quote","summary":"Partially updating a quote","description":"Partially updates a quote with a given ID. Single update may contain multiple partial updates in the form of an array. It contains the allowed operations list:\n  - `add` - adding an item to the items list\n  - `remove` - removing an item from the items list\n  - `replace` - replacing an item with given ID with new definition which may contain custom price proposal or defined price\n\nAfter events are saved, some of the information is retrieved in the async way from other services: full price definition is based on the provided price ID, and the full product name is based on the provided product ID.\n\n***\n\n### Required scopes\n\n  * `quote.quote_manage` - allows employees or external api calls to modify all quotes\n  * `quote.quote_manage_own` - allows customers to modify only their own quotes by modifying the status to either `ACCEPTED` or `DECLINED`.\n","responses":{"204":{"description":"The request was successful. The quote has been updated."},"400":{"$ref":"#/components/responses/Bad_request_400_cl"},"401":{"$ref":"#/components/responses/Unathorized_401"},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"$ref":"#/components/responses/Not_Found_404"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteUpdateRequest"}}}},"tags":["Quote management"]}}}}
```
