Skip to content

Product insertion

Request

This endpoint allows you to insert products into Shoptet. You can use it for an import from an external system.

Request is sent in JSON format in its body. For detailed description of items, which can be provided, see the right-most pane, section "Request" » "Attributes".

When creating a product without variants, add one variant to the variants array — it will be created as a single-variant product with the values specified in that variant.

When creating a product with multiple variants, each variant must have a unique combination of parameters (e.g. color:black + size:XXL vs. color:yellow + size:XXL). Two variants with identical parameter combinations are not allowed. Also, nameIndex must be unique within a single variant (e.g. two color parameters in one variant is not allowed).

Maximum number of variants per product is 512.

Security
shoptetAccessToken or shoptetPrivateApiToken
Query
includestring

Optional parts of response

Example:include=images,variantParameters,allCategories,flags,descriptiveParameters,measureUnit,surchargeParameters,setItems,filteringParameters,recyclingFee,c
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
dataobjectrequired
curl -i -X POST \
  'https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/products?include=images%2CvariantParameters%2CallCategories%2Cflags%2CdescriptiveParameters%2CmeasureUnit%2CsurchargeParameters%2CsetItems%2CfilteringParameters%2CrecyclingFee%2CconsumptionTax%2Cwarranty%2CsortVariants%2CrelatedVideos%2CperPricelistPrices' \
  -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.",
      "xmlFeedName": "Velká čokoláda Twist",
      "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"
        }
      ],
      "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",
          "ean": "8594001234567",
          "unitId": -1,
          "weight": "15.500",
          "width": "10.0",
          "height": "10.0",
          "depth": "10.0",
          "visible": true,
          "price": "21.00",
          "currencyCode": "CZK",
          "manufacturerCode": "OKI",
          "pluCode": "0828",
          "isbn": "978-80-251-0000-0",
          "serialNo": "B412",
          "mpn": "H3T5-87",
          "availabilityId": -1,
          "availabilityWhenSoldOutId": -3,
          "parameters": [
            {
              "nameIndex": "color",
              "valueIndex": "red"
            }
          ],
          "minStockSupply": "1.000",
          "stocksLocations": [
            {
              "stockId": 1,
              "amount": "1.000",
              "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,
          "heureka": {
            "feedExcluded": true,
            "cartExcluded": true
          },
          "ossVatLevels": [
            {
              "countryCode": "CZ",
              "taxLevel": "high"
            }
          ]
        }
      ],
      "indexName": "baleriny-modre-s-puntiky",
      "relatedVideos": [
        {
          "code": "zpvmPA3me7o",
          "title": "Test video",
          "type": "youtube"
        }
      ]
    }
  }'

Responses

Created

Bodyapplication/json
dataobjectrequired
errorsArray of objects or null(Errors)required
metadataobject(Metadata)required
Response
{ "data": { "product": {} }, "errors": [ {} ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } }