Skip to content

Product update by code

Request

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 code. When code is not specified or not existing, new variant will be created.

If you want to change code of variant, use code to specify variant to be changed and newCode for specifying new code.

Field parameters 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

Security
shoptetAccessToken or shoptetPrivateApiToken
Path
codestringrequired

Product or variant code

Example:00351
Query
includestring

Optional parts of response

Example:include=images,variantParameters,allCategories,flags,descriptiveParameters,measureUnit,surchargeParameters,setItems,filteringParameters,perStockAmount
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
dataobject, non-empty(productUpdate)required
curl -i -X PATCH \
  'https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/products/code/00351?include=images%2CvariantParameters%2CallCategories%2Cflags%2CdescriptiveParameters%2CmeasureUnit%2CsurchargeParameters%2CsetItems%2CfilteringParameters%2CperStockAmounts%2CperPricelistPrices%2CrecyclingFee%2CconsumptionTax' \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE' \
  -d '{
    "data": {
      "guid": "1b02cb8e-d7b5-11e0-9a5c-feab5ed617ed",
      "type": "product",
      "visibility": "hidden",
      "name": "Velká čokoláda",
      "adult": true,
      "shortDescription": "Velice kvalitní a dobrá čokoláda.",
      "description": "<p>Velice kvalitní a dobrá čokoláda. Chutná vždy dobře. <b>Neobsahuje arašídy.</b></p>",
      "additionalName": "Velice kvalitní a dobrá čokoláda.",
      "metaTitle": "Velice kvalitní a dobrá čokoláda.",
      "metaDescription": "Velice kvalitní a dobrá čokoláda. Chutná vždy dobře. Neobsahuje arašídy.",
      "conditionGrade": "used",
      "conditionDescription": "Without original package.",
      "defaultCategoryGuid": "1b02cb8e-d7b5-11e0-9a5c-feab5ed617ed",
      "brandCode": "milka",
      "internalNote": "Internal note for product manager.",
      "preauthorizationRequired": true,
      "hsCode": "95030099",
      "supplierGuid": "1b02cb8e-d7b5-11e0-9a5c-feab5ed617ed",
      "categoryGuids": [
        "1b02cb8e-d7b5-11e0-9a5c-feab5ed617ed"
      ],
      "warrantyId": 1,
      "flags": [
        {
          "code": "new",
          "dateFrom": "2017-04-04",
          "dateTo": "2017-04-04"
        }
      ],
      "flagsManagement": [
        {
          "action": "set",
          "code": "new",
          "dateFrom": "2017-04-04",
          "dateTo": "2017-04-04"
        }
      ],
      "descriptiveParameters": [
        {
          "name": "Material",
          "value": "Cotton",
          "description": "Material the shirt is made of",
          "priority": 1
        }
      ],
      "filteringParameters": [
        {
          "code": "action",
          "values": [
            "Action"
          ]
        }
      ],
      "surchargeParameters": [
        {
          "code": "pp-1",
          "values": [
            {
              "valueIndex": "hodnota-01",
              "price": "21.00",
              "visible": true
            }
          ]
        }
      ],
      "variants": [
        {
          "code": "0035",
          "newCode": "0036",
          "ean": "8594001234567",
          "unitId": -1,
          "weight": "15.500",
          "width": "10.0",
          "height": "10.0",
          "depth": "10.0",
          "visible": true,
          "manufacturerCode": "OKI",
          "pluCode": "0828",
          "isbn": "978-80-251-0000-0",
          "serialNo": "B412",
          "mpn": "H3T5-87",
          "availabilityId": -1,
          "availabilityWhenSoldOutId": -3,
          "image": "106.jpg",
          "parameters": [
            {
              "nameIndex": "color",
              "valueIndex": "red"
            }
          ],
          "minStockSupply": "1.000",
          "stocksLocations": [
            {
              "stockId": 1,
              "location": "H6/M11/R13"
            }
          ],
          "negativeStockAllowed": true,
          "measureUnit": {
            "packagingUnitId": 22,
            "packagingAmount": "1.000",
            "measureUnitId": 1,
            "measureAmount": "1.000"
          },
          "recyclingFeeId": 123,
          "consumptionTaxId": 1,
          "amountDecimalPlaces": 2,
          "atypicalBilling": true,
          "atypicalShipping": true,
          "boxRestriction": true,
          "ossVatLevels": [
            {
              "countryCode": "CZ",
              "taxLevel": "high"
            }
          ]
        }
      ],
      "indexName": "baleriny-modre-s-puntiky",
      "relatedVideos": [
        {
          "code": "zpvmPA3me7o",
          "title": "Test video",
          "type": "youtube"
        }
      ]
    }
  }'

Responses

OK

Bodyapplication/json
dataobject(product)required
errorsArray of objects or null(Errors)required
metadataobject(Metadata)required
Response
{ "data": { "guid": "1b02cb8e-d7b5-11e0-9a5c-feab5ed617ed", "type": "product", "name": "Pelle 1978", "indexName": "baleriny-modre-s-puntiky", "brand": {}, "supplier": {}, "visibility": "normal", "creationTime": "2018-05-29T09:02:27+0200", "changeTime": "2018-05-29T09:02:27+0200", "shortDescription": "A high quality jacket, although its fairly bold design is not to everyone's taste, it has its fans, so you can find it in our offer too. For kids, why not.", "description": "<p>As it is often the case with jackets for kids, the emphasis is primarily on durability and quality workmanship. It is clear that it will be put through its paces, which the manufacturer has borne in mind. As previously stated, the manufacturer could also afford a less conservative design for a kids product, combining bold colors with a company logo on the front and back.</p>\n\n<ul>\n\t<li>Body - 60% Nylon, 40% wool</li>\n<li>Inside - 100% Polyester</li>\n</ul>", "metaDescription": "Pelle 1978. A high quality jacket, although its fairly bold design is not to everyone's taste .... ", "url": "https://www.domena-eshopu.cz/hodinky/citizen-chronograph-eco-drive/", "conditionGrade": "used", "conditionDescription": "Without original package", "internalNote": "This product is not in stock, but it is possible to order it.", "preauthorizationRequired": true, "hsCode": "95030099", "defaultCategory": {}, "categories": [], "descriptiveParameters": [], "additionalName": "+ free gift", "xmlFeedName": "our-feed.xml", "metaTitle": "Nice product title", "adult": true, "atypicalBilling": true, "atypicalShipping": true, "allowIPlatba": true, "allowOnlinePayments": true, "sizeIdName": "adidas - man - shoes (ID 142)", "voteAverageScore": "1.000", "voteCount": 16, "isVariant": true, "variants": [], "images": [], "flags": [], "surchargeParameters": [], "setItems": [], "filteringParameters": [], "warranty": {}, "gifts": [], "alternativeProducts": [], "relatedProducts": [], "relatedFiles": [], "relatedVideos": [] }, "errors": [ {} ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } }