# Product update by code This endpoint allows you to update products identified by a product code in Shoptet. Request is sent in JSON format in its body. For detailed description of items, which can be updated and their format, check the right-most pane, section "Request" ยป "Attributes". Product variant can be updated by specifying its . When is not specified or not existing, new variant will be created. If you want to change of variant, use to specify variant to be changed and for specifying new code. Field should contain ALL parameters that the edited variant should contain. That means, if you have for example "color:black" in variant and you specify only new parameter "velikost", parameter color will be deleted. Please note that any product's variant can be edited by this endpoint, not only the one in url Endpoint: PATCH /api/products/code/{code} Version: 1.0.0 Security: shoptetAccessToken, shoptetPrivateApiToken ## Path parameters: - `code` (string, required) Product or variant code Example: "00351" ## Query parameters: - `include` (string) Optional parts of response Example: "images,variantParameters,allCategories,flags,descriptiveParameters,measureUnit,surchargeParameters,setItems,filteringParameters,perStockAmounts,perPricelistPrices,recyclingFee,consumptionTax" ## Header parameters: - `Content-Type` (string, required) ## Request fields (application/json): - `data` (object, required) - `data.guid` (string) Product GUID. Must be unique if set. - `data.type` (string) Product type. Please note that 'product-set' requires 'sets' module to be enabled. Enum - see [Product types](#section/code-lists/product-types) code list. Enum: "product", "bazar", "service", "product-set" - `data.visibility` (string) Product visibility. Optional, default value . Enum - see [Product visibility](#section/code-lists/product-visibility) code list. Enum: "hidden", "visible", "blocked", "show-registered", "block-unregistered", "cash-desk-only", "detail-only" - `data.name` (string) Product's name. Mandatory. Maximal length of 250 characters. - `data.adult` (boolean,null) Whether the product is for adults only. Optional, default value . - `data.shortDescription` (string,null) Product's short description. - `data.description` (string,null) Product's full description. - `data.additionalName` (string,null) Product's additional name. Optional. Maximal length of 150 characters. - `data.metaTitle` (string,null) Product's seo title. Maximal length of 255 characters. - `data.metaDescription` (string,null) Product's full description. - `data.conditionGrade` (string,null) Grade condition of second-hand product. Allowed only for type. - `data.conditionDescription` (string,null) Condition description of second-hand product. Allowed only for type. - `data.defaultCategoryGuid` (string) Product's default category's GUID. Mandatory. - `data.brandCode` (string,null) Product's brand. Must exist if set. - `data.internalNote` (string,null) Product internal note. - `data.preauthorizationRequired` (boolean) whether the preauthorization is required; available only if shoptet pay module is enabled - `data.supplierGuid` (string,null) Supplier GUID. Must exist if set. - `data.categoryGuids` (array) - `data.warrantyId` (integer,null) Warranty ID. - `data.flags` (array,null) Must exist if set. - `data.flags.code` (string, required) flag identifier. - `data.flags.dateFrom` (string,null) Date from which the flag is valid. - `data.flags.dateTo` (string,null) Date to which the flag is valid. - `data.descriptiveParameters` (array) Product descriptive parameters. - `data.descriptiveParameters.name` (string, required) Parameter name. - `data.descriptiveParameters.value` (string,null) value of the descriptive parameter. - `data.descriptiveParameters.description` (string,null) Description of the descriptive parameter. - `data.descriptiveParameters.priority` (integer,null) Priority of the parameter. - `data.filteringParameters` (array,null) - `data.filteringParameters.code` (string, required) Filtering parameter code. - `data.filteringParameters.values` (array, required) Product filtering parameter values. - `data.surchargeParameters` (array) Product surcharge parameters. Not allowed for products with multiple tax classes. - `data.surchargeParameters.code` (string, required) parameter identifier, language dependent - `data.surchargeParameters.values` (array, required) Product surcharge parameter values. - `data.surchargeParameters.values.valueIndex` (string, required) parameter value identifier, language dependent - `data.surchargeParameters.values.price` (string,null) surcharge amount which is added to the product price for the customer when this parameter is chosen. - `data.surchargeParameters.values.visible` (boolean) flag, whether the parameter value is visible - `data.variants` (array) - `data.variants.code` (string) Variant's code. Must be unique if set. After processing it will be converted to uppercase. Generated automatically if not set. - `data.variants.newCode` (string) New code of existing variant. - `data.variants.ean` (string,null) Variant's ean. - `data.variants.unitId` (integer) Variant's unit id. Optional - `data.variants.weight` (string,null) Variant's weight in kilograms. 3 decimal places, and maximum value of 99999.999. - `data.variants.width` (string) width of the product in cm. 1 decimal place, maximum 9999.9. - `data.variants.height` (string) height of the product in cm. 1 decimal place, maximum 9999.9. - `data.variants.depth` (string) depth of the product in cm. 1 decimal place, maximum 9999.9. - `data.variants.visible` (boolean) Is variant visible? - `data.variants.manufacturerCode` (string,null) Variant's manufacturer code. - `data.variants.pluCode` (string,null) Variant's plu. - `data.variants.isbn` (string,null) Variant's ISBN. - `data.variants.serialNo` (string,null) Variant's serial number. - `data.variants.mpn` (string,null) Variant's MPN. - `data.variants.availabilityId` (number,null) Product availability id - `data.variants.availabilityWhenSoldOutId` (number,null) Product availability id when not stocked - `data.variants.image` (string,null) image filename of this variant (image must exist within product). - `data.variants.parameters` (array) Variant's parameters - `data.variants.parameters.nameIndex` (string, required) indexName of parameter name - `data.variants.parameters.valueIndex` (string, required) indexName of parameter value - `data.variants.minStockSupply` (string,null) Minimum stock supply. - `data.variants.stocksLocations` (array) Locations and amounts in stocks. - `data.variants.stocksLocations.stockId` (integer, required) Id of stock. Required if stocksLocations is set. Must fit existing stock Id. Check List of Stocks. - `data.variants.stocksLocations.location` (string,null, required) Stock location. - `data.variants.negativeStockAllowed` (boolean) Product stock can be in negative numbers - `data.variants.measureUnit` (object,null) Product variant measure and packaging units. - `data.variants.measureUnit.packagingUnitId` (integer,null, required) Packaging unit id - `data.variants.measureUnit.packagingAmount` (string,null, required) amount being in a package - `data.variants.measureUnit.measureUnitId` (integer,null, required) Measure unit id - `data.variants.measureUnit.measureAmount` (string,null, required) referential amount - `data.variants.recyclingFeeId` (integer,null) Product recycling fee id - `data.variants.consumptionTaxId` (integer,null) Product consumption tax identifier - `data.variants.amountDecimalPlaces` (integer) Amount of product variant decimal places. Enum: 0, 1, 2, 3 - `data.variants.atypicalBilling` (boolean) Has atypical billing? - `data.variants.atypicalShipping` (boolean) Has atypical shipping? - `data.indexName` (string) String which defines product url. Value is sanitized to fits url needs. If value is not present, indexName is created from product name. - `data.relatedVideos` (array) Product related videos. - `data.relatedVideos.code` (string, required) related video code. - `data.relatedVideos.title` (string,null) related video title. - `data.relatedVideos.type` (any, required) related video type. Enum: "youtube", "youtube-short" ## Response 200 fields (application/json): - `data` (object, required) - `data.guid` (string, required) unique product indicator - `data.type` (string, required) product type (, ...) - see also [Product types](#section/code-lists/product-types) code list - `data.name` (string,null) product name - `data.brand` (any, required) product brand (or manufacturer, possibly) - `data.supplier` (any, required) product supplier - `data.visibility` (string, required) visibility of product (, ...) - see also [Product visibility](#section/code-lists/product-visibility) code list - `data.creationTime` (string,null, required) date and time of product creation (date in ISO 8601 format) - `data.changeTime` (string,null, required) date and time of last product change (date in ISO 8601 format) - `data.shortDescription` (string,null, required) short product description - `data.description` (string,null, required) product description. May contain html. - `data.metaDescription` (string,null, required) product label from meta tag. - `data.url` (string,null, required) URL of the product in the e-shop - `data.conditionGrade` (string,null) Grade condition of second-hand product. It contains value only for type, otherwise, it is . - `data.conditionDescription` (string,null) Condition description of second-hand product. It contains value only for type, otherwise, it is . - `data.internalNote` (string,null, required) product internal note - `data.preauthorizationRequired` (boolean) whether the preauthorization is required; available only if shoptet pay module is enabled - `data.defaultCategory` (object, required) default product category - `data.defaultCategory.guid` (string,null, required) category unique identifier (can be ) - `data.defaultCategory.name` (string,null, required) category description - `data.defaultCategory.visible` (boolean,null, required) whether the parameter is visible - `data.categories` (array) information about available product categories - `data.categories.name` (string, required) category name - `data.categories.parentGuid` (string,null, required) parent category unique identifier (can be ) - `data.descriptiveParameters` (array) product description parameters - `data.descriptiveParameters.name` (string, required) parameter name - `data.descriptiveParameters.value` (string,null, required) value of the descriptive parameter - `data.descriptiveParameters.description` (string,null, required) parameter name description - `data.descriptiveParameters.priority` (integer,null, required) parameter priority - `data.additionalName` (string,null) Additional part of product name - `data.xmlFeedName` (string,null) Name of xml feed - `data.metaTitle` (string) Meta (seo) title - `data.adult` (boolean) Flag, whether the product is for adults only - `data.allowIPlatba` (boolean) Is Cofidis payment allowed? - `data.allowOnlinePayments` (boolean) Are online Payments allowed? - `data.sizeIdName` (string,null) Name for sizeid.com - `data.voteAverageScore` (string,null) Average score of product reviews - `data.voteCount` (integer,null) Count of product reviews - `data.isVariant` (boolean) define if product has multiple variants. - `data.variants` (array, required) information about available product variants. For a product without variants, this field contains just one element with product details. - `data.variants.code` (string, required) unique identification of the product variant - `data.variants.ean` (string,null, required) product variant bar code - `data.variants.stock` (string,null, required) quantity of goods in stock - `data.variants.unit` (string,null, required) unit of goods quantity - `data.variants.weight` (any, required) weight in kg - `data.variants.width` (string, required) width of the product in cm - `data.variants.height` (string, required) height of the product in cm - `data.variants.depth` (string, required) depth of the product in cm - `data.variants.visible` (boolean, required) flag, whether the variant is visible - `data.variants.price` (string,null, required) price - `data.variants.commonPrice` (string,null, required) standard price - `data.variants.manufacturerCode` (string,null, required) manufacturer code - `data.variants.pluCode` (string,null, required) PLU code - `data.variants.isbn` (string,null, required) ISBN code - `data.variants.serialNo` (string,null, required) serial number - `data.variants.mpn` (string,null, required) manufacturer part number - `data.variants.includingVat` (boolean, required) flag, whether the price is including VAT - `data.variants.vatRate` (string, required) VAT rate in percent - `data.variants.currencyCode` (string, required) currency code - `data.variants.minStockSupply` (string,null, required) minimum stock supply - `data.variants.actionPrice` (object,null, required) special discounted price - `data.variants.actionPrice.price` (string, required) special discounted price. It is only used if set and if the validity date is set too, form () to (). - `data.variants.actionPrice.fromDate` (string,null, required) date from which the special discounted price is valid. - `data.variants.actionPrice.toDate` (string,null, required) date to which the special discounted price is valid. - `data.variants.image` (string,null) main image of variant (if set, otherwise the product's main image is to be used). - `data.variants.isProductDefaultImage` (boolean) Determines whether the default product image is given (true) or the product variant image (false). - `data.variants.name` (string,null) name composed of the variant parameters, as seen in the e-shop. For products without variants this is . Requires parameter. - `data.variants.amountDecimalPlaces` (integer, required) Number of decimal places for amount - `data.variants.parameters` (array,null) - `data.variants.parameters.paramName` (string,null, required) human readable name of the variant parameter. - `data.variants.parameters.paramIndex` (string, required) name of the variant parameter without diacritics and spaces - `data.variants.parameters.paramValue` (string, required) human readable value of the variant parameter - `data.variants.parameters.displayName` (string,null) Parameter display name - `data.variants.parameters.rawValue` (string,null, required) value of the parameter without variant, without diacritics and spaces. - `data.variants.parameters.color` (string,null, required) parameter value as color hexadecimal code. - `data.variants.parameters.image` (string,null, required) URL of the image that serves as the parameter value. - `data.variants.parameters.valuePriority` (number, required) priority of the parameter value. - `data.variants.measureUnit` (object,null) product measure unit - `data.variants.measureUnit.packagingUnitId` (integer,null, required) packaging unit identifier - `data.variants.measureUnit.packagingUnitName` (string,null, required) packaging unit name - `data.variants.measureUnit.packagingAmount` (string,null, required) amount being in a package - `data.variants.measureUnit.measureUnitId` (integer,null, required) measure unit identifier - `data.variants.measureUnit.measureUnitName` (string,null, required) measure unit name - `data.variants.measureUnit.measureAmount` (string,null, required) referential amount - `data.variants.measureUnit.measurePrice` (string,null, required) price of package for referential amount - `data.variants.availability` (object,null) product availability - `data.variants.availability.id` (integer, required) availability unique ID - `data.variants.availability.name` (string, required) availability name - `data.variants.availabilityWhenSoldOut` (object,null) product availability when not stocked - `data.variants.negativeStockAllowed` (string, required) is negative stock buying allowed? Possible values - yes, set globally, - no, - globally no, but per this variant yes. Enum: "yes-global", "no-global", "yes" - `data.variants.recyclingFee` (any) recycling fee including category and fee - `data.variants.consumptionTax` (any) consumption tax - `data.variants.heurekaCPC` (string,null) Heureka cost per click - `data.variants.zboziCZ` (object) Information from zbozi.cz - `data.variants.zboziCZ.maximalCPC` (string,null, required) Zbozi.cz maximal cost per click - `data.variants.zboziCZ.maximalSearchCPC` (string,null, required) Zbozi.cz maximal search cost per click - `data.variants.zboziCZ.hidden` (boolean,null, required) - `data.variants.atypicalBilling` (boolean) Has atypical billing? - `data.variants.atypicalShipping` (boolean) Has atypical shipping? - `data.variants.perStockAmounts` (array,null) Variant amounts/claims per individual stocks. - `data.variants.perStockAmounts.stockId` (integer, required) stock unique ID - `data.variants.perStockAmounts.amount` (string,null, required) amount of items, products - `data.variants.perStockAmounts.claim` (string,null, required) requirements on stock quantity - `data.variants.perStockAmounts.location` (string,null, required) stock position, can be - `data.variants.perStockAmounts.lastAmountUpdate` (string,null, required) date and time of last change of stock quantity (ISO 8601 format), can be - `data.variants.perPricelistPrices` (array,null) Variant prices per individual pricelists. - `data.variants.perPricelistPrices.code` (string, required) identifier of product variant - `data.variants.perPricelistPrices.currencyCode` (string, required) currency code. List of available currencies within the e-shop can be found in endpoint . - `data.variants.perPricelistPrices.includingVat` (boolean, required) flag, if price is including VAT - `data.variants.perPricelistPrices.vatRate` (string, required) VAT rate - `data.variants.perPricelistPrices.price` (object, required) - `data.variants.perPricelistPrices.price.price` (string,null, required) Price, at which the customer can purchase the product. It can be loaded by the special discounted price and influenced by the price ratio. - `data.variants.perPricelistPrices.price.commonPrice` (string,null, required) standard price, use for information and comparison to competitors. - `data.variants.perPricelistPrices.price.buyPrice` (string,null, required) purchase price. - `data.variants.perPricelistPrices.price.priceRatio` (string, required) price ratio. The price of the product shall be calculated by multiplying the price and this coefficient. The price ratio affects only the price (), the special discounted price () is not affected by the ratio. This ratio has 3 decimal places and can be greater than 1,000 - `data.variants.perPricelistPrices.price.actionPrice` (object,null, required) special discounted price. - `data.variants.perPricelistPrices.sales` (object, required) - `data.variants.perPricelistPrices.sales.minPriceRatio` (string, required) 3 decimal places accuracy, (from to ), maximum permitted discount. - `data.variants.perPricelistPrices.sales.freeShipping` (boolean, required) flag, whether the product will have a free transport after it is placed in the cart. - `data.variants.perPricelistPrices.sales.freeBilling` (boolean, required) flag, whether the product will have a free payment after it is placed in the cart. - `data.variants.perPricelistPrices.sales.loyaltyDiscount` (boolean, required) flag, whether the loyalty discount should be used. - `data.variants.perPricelistPrices.sales.volumeDiscount` (boolean, required) flag, whether the volume discount should be used. - `data.variants.perPricelistPrices.sales.quantityDiscount` (boolean, required) flag, whether the volume/multibuy discount should be used. - `data.variants.perPricelistPrices.sales.discountCoupon` (boolean, required) flag, whether a discount coupon can be applied. - `data.variants.perPricelistPrices.orderableAmount` (object, required) - `data.variants.perPricelistPrices.orderableAmount.minimumAmount` (string,null, required) minimum orderable quantity. - `data.variants.perPricelistPrices.orderableAmount.maximumAmount` (string,null, required) maximum orderable quantity. - `data.variants.perPricelistPrices.pricelistId` (integer, required) price list identifier - `data.variants.url` (string,null) If product has multiple variants, URL of the variant is provided. - `data.images` (array) information about images. - `data.images.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 obtained from the endpoint e-shop info . - `data.images.seoName` (string, required) file name modified for SEO - a short label is attached. - `data.images.cdnName` (string, required) same as with attached hashed last image change time. , and can be entered in the URL - redirect will deliver the same image. - `data.images.priority` (integer,null, 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. - `data.images.description` (string,null, required) image label - `data.images.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. - `data.images.isMainImage` (boolean) determines whether it is the main image - `data.flags` (array) product flags - `data.flags.code` (string, required) flag identifier - `data.flags.title` (string, required) flag name - `data.flags.dateFrom` (string,null, required) date from which the flag is valid - `data.flags.dateTo` (string,null, required) date to which the flag is valid - `data.surchargeParameters` (array) product surcharge parameters - `data.surchargeParameters.code` (string, required) parameter identifier - `data.surchargeParameters.displayName` (string,null, required) parameter display name - `data.surchargeParameters.description` (string,null, required) parameter description - `data.surchargeParameters.required` (boolean, required) Is value for parameter required? - `data.surchargeParameters.currency` (string, required) Currency of price in parameter's values - `data.surchargeParameters.includingVat` (boolean, required) Is price in parameter's values including VAT? - `data.surchargeParameters.values` (array, required) Possible parameter's values - `data.surchargeParameters.values.valueIndex` (string, required) Code (identifier) of parameter's value - `data.surchargeParameters.values.description` (string, required) Description (name) of parameter's value - `data.surchargeParameters.values.price` (string,null, required) Price of parameter's value - `data.surchargeParameters.values.priority` (integer,null, required) Priority of parameter's value - `data.surchargeParameters.values.visible` (boolean, required) Is parameter value visible? - `data.setItems` (array,null) information about items, products, in set - `data.setItems.guid` (string, required) global unique permanent category identifier - `data.setItems.code` (string, required) product code - `data.filteringParameters` (array) product filtering parameters - `data.filteringParameters.code` (string, required) parameter code - `data.filteringParameters.googleMapping` (object,null, required) Possible parameter mapping with google - `data.filteringParameters.googleMapping.value` (string) Code (identifier) of google mapping parameter - `data.filteringParameters.googleMapping.description` (string,null) Description (name) of google mapping parameter - `data.filteringParameters.values` (array, required) possible parameter's values - `data.filteringParameters.values.name` (string, required) Description (name) of parameter's value - `data.filteringParameters.values.color` (string,null, required) Hex code of color - `data.filteringParameters.values.image` (string,null, required) URL of image - `data.warranty` (object,null) product warranty - `data.warranty.id` (integer, required) Warranty id. Negative number indicates system warranties. Positive numbers are defined by customer. - `data.warranty.inMonths` (integer,null, required) Warranty length in months. Negative number () means infinite (lifetime) warranty. - `data.warranty.description` (string, required) Warranty description - `data.gifts` (array) Gifts related to product - `data.gifts.code` (string, required) product variant identifier - `data.gifts.priority` (integer, required) variant priority - `data.alternativeProducts` (array,null) - `data.alternativeProducts.guid` (string, required) related product identifier - `data.alternativeProducts.priority` (integer, required) Priority of product in related products list - `data.alternativeProducts.linkType` (string) Type of the link to the product. Defines if the product is paired physically or reciprocally. - `data.relatedProducts` (array,null) - `data.relatedFiles` (array) files related to product - `data.relatedFiles.name` (string,null, required) related file title - `data.relatedFiles.url` (string, required) related file URL - `data.relatedFiles.size` (integer,null, required) related file size - `data.relatedVideos` (array) Videos related to product - `data.relatedVideos.code` (string, required) urelated video YouTube code - `data.relatedVideos.title` (string,null, required) related video title - `data.relatedVideos.type` (any, required) related video type Enum: "youtube", "youtube-short" - `data.atypicalBilling` (boolean) (Moved to variant) - Has atypical billing? - `data.atypicalShipping` (boolean) (Moved to variant) - Has atypical shipping? - `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 ## 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 ## 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