# Update of credit note item

Updates credit note item. It's not possible to change productType
property and it's not possible to update credit note item of another
type then product or product-set.

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

## Path parameters:

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

  - `id` (integer, required)
    credit note item id. Can be found in field
data.creditNote.items.itemId in Credit note detail.
    Example: 198

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (object, required)

  - `data.code` (string)

  - `data.amount` (string,null)
    amount of item, 3 decimal places accuracy, required. For credit note you will probably use negative amount. (can be null)

  - `data.name` (string,null)
    name of item (can be null)

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

  - `data.amountUnit` (string,null)
    unit of amount (can be null)

  - `data.price` (string)
    price of item, 3 decimal places accuracy (can be null), default value 0.00

  - `data.includingVat` (boolean)
    default value is false; whether the credit note item price is saved with VAT or without

  - `data.vatRate` (string)
    VAT rate in percent

  - `data.priceRatio` (string)
    value of discount of price, 4 decimal places accuracy, (from 0.0000 to 1.0000), e.g. 0.8500 means 85% discount (can be null)

  - `data.weight` (string,null)
    weight of the item, 3 decimal places accuracy (can be null)

  - `data.remark` (string,null)
    item note (can be null)

  - `data.additionalField` (string,null)
    field for additional info (can be null)

## Response 200 fields (application/json):

  - `data` (object, required)

  - `data.creditNoteItem` (object, required)

  - `data.creditNoteItem.productGuid` (any, required)
    global unique permanent product identifier (can be null)

  - `data.creditNoteItem.code` (string,null, required)
    variant code (product) (can be null)

  - `data.creditNoteItem.itemType` (string, required)
    item type

  - `data.creditNoteItem.name` (string,null, required)
    product name (can be null)

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

  - `data.creditNoteItem.brand` (string,null, required)
    brand name (can be null)

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

  - `data.creditNoteItem.amountUnit` (string,null, required)
    unit of quantity (can be null)

  - `data.creditNoteItem.remark` (string,null, required)
    remark (can be null)

  - `data.creditNoteItem.priceRatio` (string, required)
    discount - 0.7800 = discount 22%; 1.0000 = no discount

  - `data.creditNoteItem.weight` (any, required)

  - `data.creditNoteItem.additionalField` (string,null, required)
    additional info (can be null)

  - `data.creditNoteItem.itemPrice` (object, required)
    item price

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

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

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

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

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

  - `data.creditNoteItem.purchasePrice` (any, required)
    purchase price of the part, can be null.

  - `data.creditNoteItem.displayPrices` (array)
    in some cases, one item is displayed as multiple lines in the administration or a printout. This array contains one or more rows representing the printout version of the item.

  - `data.creditNoteItem.itemId` (integer, required)
    item identifier for manipulation with this item

  - `data.creditNoteItem.surchargeParameters` (array)

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

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

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

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

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

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

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

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

  - `data.creditNoteItem.specificSurchargeParameters` (array)

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

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

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

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

  - `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.


