# Order item change

Endpoint: PATCH /api/orders/{code}/item/{id}
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Path parameters:

  - `code` (string, required)
    order code (number)
    Example: "2018000012"

  - `id` (string, required)
    order item id. Can be found in field data.order.items.itemId in
Order detail.  (number)
    Example: "198"

## Query parameters:

  - `suppressProductGuidCheck` (boolean)
    suppress the product existence check per GUID
    Example: true

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (object, required)

  - `data.itemType` (string, required)
    Item type. Mandatory field; see also [Types of order items](#section/code-lists/types-of-order-items) code list. Only product, product-set, service, bazar, volume-discount or discount-coupon item type is allowed.

  - `data.code` (string)
    Item code. For transportation, payment and discounts the (discount-coupon and volume-discount) must remain null, for the other types of items, this is mandatory.

  - `data.vatRate` (string)
    VAT rate (0.00 for VAT non-payers). Mandatory.

  - `data.unitPriceWithVat` (string)
    Unit price including VAT. Optional. Only one of the items unitPriceWithVat or unitPriceWithoutVat must be entered.

  - `data.unitPriceWithoutVat` (string)
    Unit price excluding VAT. Optional. Only one of the items unitPriceWithVat or unitPriceWithoutVat must be entered.

  - `data.buyPriceWithVat` (string)
    Purchase price, including VAT. Optional. Price including tax and price excluding tax cannot be combined. This is used for profit margin calculation and statistics.

  - `data.buyPriceWithoutVat` (string)
    Purchase price, excluding VAT. Optional. Price including tax and price excluding tax cannot be combined. This is used for profit margin calculation and statistics.

  - `data.buyPriceVatRate` (string)
    VAT rate for purchase price. Optional.

  - `data.name` (string)
    Product name (optional, but usually filled in). Mandatory only for transport and payment, for other items, it is loaded according to code.

  - `data.variantName` (string,null)
    Variant name. Optional.

  - `data.brand` (string,null)
    brand (manufacturer). Optional.

  - `data.supplierName` (string,null)
    supplier. Optional.

  - `data.productGuid` (string,null)
    Product GUID in item. When used with the ?suppressProductChecking=true parameter, this field has no influence.

  - `data.remark` (string,null)
    With cubicles

  - `data.warrantyDescription` (string,null)
    textual description of warranty length (can be null)

  - `data.amountCompleted` (string,null)
    quantity of completed product

  - `data.additionalField` (string,null)
    additional information. Used for transport to specify the branch.

  - `data.amount` (string)
    amount, 3 decimal places accuracy, optional, default value 1.000.

  - `data.amountUnit` (string)
    unit of quantity (optional)

  - `data.weight` (string)
    product weight in kilograms. Maximum 3 decimal places, and maximum value of 99999.

  - `data.priceRatio` (string)
    discount in the form of coefficient (0.7 = 70 % of the original price, i.e. 30 % discount). Optional, default value is 1.0000

  - `data.recyclingFeeId` (integer,null)
    Product recycling fee id, replacement for recyclingFee

  - `data.statusId` (integer)
    Order item status. Optional, if not indicated, default value is guided by the order status. If the order status was indicated and this status has the Change status of items in the order flag set, then the item will have this status. Otherwise the default status of the e-shop is used.

  - `data.consumptionTaxId` (integer,null)
    consumption tax, cannot be used together with consumptionTax. You can send this parameter, only if consumption tax module is enabled.

  - `data.consumptionTax` (object,null)
    consumption tax with custom value, cannot be used together with consumptionTaxId. You can send this parameter, only if consumption tax module is enabled.

  - `data.consumptionTax.currency` (string, required)
    Currency code. List of available currencies within the e-shop can be found in endpoint GET /api/eshop.

  - `data.consumptionTax.price` (string,null, required)
    consumption tax value

  - `data.itemPriceWithVat` (string)
    Deprecated: use unitPriceWithVat instead. Item price including VAT. Optional. Only one of the items itemPriceWithVat or itemPriceWithoutVat must be entered.

  - `data.itemPriceWithoutVat` (string)
    Deprecated: use unitPriceWithoutVat instead. Item price excluding VAT. Optional. Only one of the items itemPriceWithVat or itemPriceWithoutVat must be entered.

## Response 200 fields (application/json):

  - `data` (object, required)

  - `data.orderItem` (object, required)

  - `data.orderItem.productGuid` (any, required)
    product identifier of the item. At the time the order is created, it will be entered in this field, but when the product is deleted, the link will be lost (can be null)

  - `data.orderItem.code` (string,null, required)
    identifier of the item code (product or variant). At the time the order is created, it will be entered in this field, but when the product is deleted, the link will be lost.

  - `data.orderItem.ean` (string,null, required)
    EAN of the product variant (can be null)

  - `data.orderItem.itemType` (string, required)
    Order item type (product, service...). See also [Types of order items](#section/code-lists/types-of-order-items) code list.

  - `data.orderItem.productType` (string,null)
    Product type at the time of the order (product, product-set..). See also [Product types](#section/code-lists/product-types) code list (can be null).

  - `data.orderItem.name` (string, required)
    Product name, with possible addition (Free Gift)

  - `data.orderItem.variantName` (string,null, required)
    variant name (can be null)

  - `data.orderItem.brand` (string,null, required)
    product brand (or manufacturer, possibly)

  - `data.orderItem.remark` (string,null, required)
    remark

  - `data.orderItem.weight` (string, required)
    weight in kg, unpacked (can be null). 3 decimal places. Maximum value 999999.

  - `data.orderItem.additionalField` (string,null, required)
    additional field for remarks

  - `data.orderItem.amount` (string,null, required)
    product quantity

  - `data.orderItem.amountUnit` (string,null, required)
    product unit of quantity

  - `data.orderItem.priceRatio` (string, required)
    price coefficient. This also represents a discount (discount 10 % means priceRatio = 0.9)

  - `data.orderItem.status` (object, required)

  - `data.orderItem.status.name` (string,null, required)
    order item status description (can be null)

  - `data.orderItem.status.id` (integer, required)
    identifier of order item status

  - `data.orderItem.itemPrice` (object, required)
    the price of the item including the discount (priceRatio) and quantity (amount).

  - `data.orderItem.itemPrice.withVat` (string,null, required)
    price including tax

  - `data.orderItem.itemPrice.withoutVat` (string,null, required)
    price excluding tax

  - `data.orderItem.itemPrice.vat` (string,null, required)
    VAT value, two decimal places

  - `data.orderItem.itemPrice.vatRate` (string, required)
    VAT rate

  - `data.orderItem.unitPrice` (object, required)
    unit price

  - `data.orderItem.unitPrice.withVat` (string,null, required)
    price including tax

  - `data.orderItem.unitPrice.withoutVat` (string,null, required)
    price excluding tax

  - `data.orderItem.unitPrice.vat` (string,null, required)
    VAT value, two decimal places

  - `data.orderItem.unitPrice.vatRate` (string, required)
    VAT rate

  - `data.orderItem.displayPrices` (array)

  - `data.orderItem.displayPrices.withVat` (string,null, required)
    price including tax

  - `data.orderItem.displayPrices.withoutVat` (string,null, required)
    price excluding tax

  - `data.orderItem.displayPrices.vat` (string,null, required)
    VAT value, two decimal places

  - `data.orderItem.displayPrices.vatRate` (string, required)
    VAT rate

  - `data.orderItem.purchasePrice` (any, required)
    purchase price of item, can be null.

  - `data.orderItem.recyclingFee` (object,null, required)
    recycling fee including category and price (or possibly null).

  - `data.orderItem.recyclingFee.category` (string, required)
    Recycling fee category name.

  - `data.orderItem.recyclingFee.fee` (string,null, required)
    Recycling fee.

  - `data.orderItem.recyclingFee.unit` (any)
    Recycling fee unit.
    Enum: "pcs", "kg"

  - `data.orderItem.mainImage` (object,null)

  - `data.orderItem.mainImage.name` (string, required)
    image file name, also serves as an identifier for the image of the product. To assemble complete URL, it is added to the urlPath obtained from the endpoint e-shop info /api/eshop?include=imageCuts.

  - `data.orderItem.mainImage.seoName` (string, required)
    file name modified for SEO - a short label is attached.

  - `data.orderItem.mainImage.cdnName` (string, required)
    same as seoName with attached hashed last image change time. name, seoName and cdnName can be entered in the URL - redirect will deliver the same image.

  - `data.orderItem.mainImage.priority` (integer, required)
    the key for the sequence of images matching the sequence in administration - it's not necessarily from the first, and the series may contain gaps. (can be null).

  - `data.orderItem.mainImage.description` (string,null, required)
    description of the image (can be null).

  - `data.orderItem.mainImage.changeTime` (string,null, required)
    last image change time If you are saving images together, you can use this timestamp to indicate if you need to reload the image. (can be null).

  - `data.orderItem.stockLocation` (string,null)
    position in stock (can be null)

  - `data.orderItem.supplierName` (string,null)
    product supplier (can be null)

  - `data.orderItem.itemId` (integer, required)
    order item identifier

  - `data.orderItem.warrantyDescription` (string,null, required)
    textual description of warranty length (can be null)

  - `data.orderItem.surchargeParameters` (array)
    items surcharge parameters, filled in order creation. Cannot be edited.

  - `data.orderItem.surchargeParameters.parameterName` (object)
    surcharge parameter name's information

  - `data.orderItem.surchargeParameters.parameterName.code` (string,null)
    parameters name code, can be null if already deleted

  - `data.orderItem.surchargeParameters.parameterName.name` (string)
    parameters name

  - `data.orderItem.surchargeParameters.parameterName.subscription` (boolean,null)
    indicates whether this surcharge parameter is a subscription (recurring payment)

  - `data.orderItem.surchargeParameters.parameterValue` (object)
    surcharge parameter value's information

  - `data.orderItem.surchargeParameters.parameterValue.valueIndex` (string,null)
    parameters value code, can be null if already deleted

  - `data.orderItem.surchargeParameters.parameterValue.description` (string)
    parameters value name

  - `data.orderItem.surchargeParameters.parameterValue.price` (string,null)
    parameters value additional price

  - `data.orderItem.specificSurchargeParameters` (array)
    list of specific surcharge parameters for order item detail, created from surchargeParameters, but editable in order item detail in eshop administration or via order item detail surcharge-parameters endpoint.

  - `data.orderItem.specificSurchargeParameters.relationId` (string, required)
    id which identifies relation between item and surcharge. Can be used to delete surcharge parameter related to item.

  - `data.orderItem.specificSurchargeParameters.name` (string, required)
    full name of surcharge parameter.

  - `data.orderItem.specificSurchargeParameters.price` (string,null, required)
    price of surcharge parameter

  - `data.orderItem.productFlags` (array)
    list of product flags

  - `data.orderItem.productFlags.code` (string, required)
    flag identifier

  - `data.orderItem.productFlags.title` (string, required)
    flag title

  - `data.orderItem.productFlags.system` (boolean, required)
    is it a system flag common for all e-shops?

  - `data.orderItem.consumptionTax` (object,null)
    consumption tax of order item

  - `data.orderItem.consumptionTax.currency` (string, required)
    Currency code. List of available currencies within the e-shop can be found in endpoint GET /api/eshop.

  - `data.orderItem.consumptionTax.price` (string,null, required)
    consumption tax value

  - `data.orderItem.itemPriceVatBreakdown` (array,null)
    Detailed VAT list displaying tax amounts for each VAT rate used in the document. Applied for non product items.

  - `data.orderItem.itemPriceVatBreakdown.withVat` (string,null, required)
    price including tax

  - `data.orderItem.itemPriceVatBreakdown.withoutVat` (string,null, required)
    price excluding tax

  - `data.orderItem.itemPriceVatBreakdown.vat` (string,null, required)
    VAT value, two decimal places

  - `data.orderItem.itemPriceVatBreakdown.vatRate` (string, required)
    VAT rate

  - `data.orderItem.amountCompleted` (string,null, required)
    quantity of completed product. Deprecated - use completion section instead.

  - `data.orderItem.surchargeParametersTexts` (array)
    List of custom surcharge parameters names

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object, required)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.

## Response 403 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.

## Response 404 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.

## Response 422 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.


