Marketplaces / TikTok Marketplace Integration v2 / TikTok - Product management / TikTok Update Product

TikTok Update Product

Version Date Created / Updated Notes
v1.0 20.06.2024 Hristiyan Georgiev TikTok has new API version and updates. The scope was also updated to the latest changes
v1.1 05.09.2024 Hristiyan Logic for closed variants added
v1.2 19.09.2024 Hristiyan added logic for protect flags

Update Product

Full Update (Edit Product)

In order to perform full update we will use “Edit Product“ API.

As per the requirements for the GTIN field on TikTok: When we call edit_product API to update a product which already has a GTIN assigned (The field GTIN type -identifier_code & GTIN value - code should be the same as the fields we have pushed when we create a product. They will be saved and will be pushed once we send updates) and we try to change the GTIN, error message should be returned. Once the GTIN has been assigned to an existing product, it can't be changed or deleted!

API Call: PUT /product/202309/products/{product_id}

API Docs: https://partner.tiktokshop.com/docv2/page/6509da7d0fcef602bf1caddf?external_id=6509da7d0fcef602bf1caddf#Back To Top

The {product_id} is what we have stored as Product Account > Channel Item ID

We need to pass the shop_cipher as query property which was obtained with the Get Authorised Shops call found here TikTok - Authentication & Database structure

All triggers, validations etc are as per the abstraction -

Product Listing general requirements

Example call:

{
  "brand_id": "7082427311584347905",
  "category_id": "600001",
  "certifications": [
    {
      "files": [
        {
          "format": "PDF",
          "id": "v09e40f40000cfu0ovhc77ub7fl97k4w",
          "name": "SNI Certificate"
        }
      ],
      "id": "7182427311584347905",
      "images": [
        {
          "uri": "tos-maliva-i-o3syd03w52-us/c668cdf70b7f483c94dbe"
        }
      ]
    }
  ],
  "delivery_option_ids": "1729592969712203232",
  "description": " ",
  "external_product_id": "172959296971220002",
  "is_cod_allowed": false,
  "main_images": [
    {
      "uri": "tos-maliva-i-o3syd03w52-us/c668cdf70b7f483c94dbe"
    }
  ],
  "manufacturer": {
    "address": "123W 106th St, New York, NY, USA, 10025",
    "email": "samplemanufacturer101@outlook.com",
    "name": "Sample Manufacturer Name",
    "phone_number": "4412345678"
  },
  "package_dimensions": {
    "height": "10",
    "length": "10",
    "unit": "CENTIMETER",
    "width": "10"
  },
  "package_weight": {
    "unit": "KILOGRAM",
    "value": "1.32"
  },
  "product_attributes": [
    {
      "id": "100392",
      "values": [
        {
          "id": "1001533",
          "name": "Birthday"
        }
      ]
    }
  ],
  "size_chart": {
    "image": {
      "uri": "tos-maliva-i-o3syd03w52-us/c668cdf70b7f483c94dbe"
    },
    "template": {
      "id": "7267563252536723205"
    }
  },
  "skus": [
    {
      "combined_skus": [
        {
          "product_id": "1729582718312380123",
          "sku_count": 2,
          "sku_id": "2729382476852921560"
        }
      ],
      "external_sku_id": "1729592969712207012",
      "id": "1729592969712207000",
      "identifier_code": {
        "code": "12345678901234",
        "type": "GTIN"
      },
      "inventory": [
        {
          "quantity": 999,
          "warehouse_id": "7068517275539719942"
        }
      ],
      "price": {
        "amount": "1.21",
        "currency": "USD"
      },
      "sales_attributes": [
        {
          "id": "100089",
          "name": "Specification",
          "sku_img": {
            "uri": "tos-maliva-i-o3syd03w52-us/c668cdf70b7f483c94dbe"
          },
          "value_id": "1729592969712401100",
          "value_name": "XL"
        }
      ],
      "seller_sku": "Color-Red-XM001",
      "sku_unit_count": "100.00"
    }
  ],
  "title": "Men's Fashion Sports Low Cut Cotton Breathable Ankle Short Boat Invisible Socks\n",
  "video": {
    "id": "v09e40f40000cfu0ovhc77ub7fl97k4w"
  }
}

Mapping is the same as product create, except when we update product, we need to check if we have all images uploaded and this is done via the TikTok Images table. If images are not uploaded, first we need to wait for the Images Create cron to upload them and then to update the product.

Example response:

{
  "code": 0,
  "data": {
    "product_id": "1729592969712207008",
    "skus": [
      {
        "external_sku_id": "1729592969712207234",
        "id": "1729592969712207012",
        "sales_attributes": [
          {
            "id": "100000",
            "value_id": "1729592969712207123"
          }
        ],
        "seller_sku": "Color-Red-XM001"
      }
    ],
    "warnings": [
      {
        "message": "The [brand_id]:123 field is incorrect and has been automatically cleared by the system. Reason: [Brand does not exist]. You can edit it later."
      }
    ]
  },
  "message": "Success",
  "request_id": "202203070749000101890810281E8C70B7"
}

*Important :** As per additional tests performed, we are able to add new variant to existing product, using Edit Product API call. In order to do this, we should simply not push the SKU IDs. SKU IDs need to be pushed only if we want to update an already existing variant! Also, we need to keep the existing SKU at the same time! If this is not done, not only the old SKU will be deleted, but also the new one will not be successfully added! I.e. all products which are published need to be pushed in Edit Product Call + all variants which are with status awaiting creation + list/update the whole item = pending. Equally, if we do not send any of the variants it will get deleted on the TikTok platform.

<v1.1> Since we can have a closed variant from a variation and if we exclude it from the payload, it will get deleted, which is not correct, we want to create an internal validation and if we have such case where we have a variation and have closed variants but we are trying to push a product for update, we want to block the update and return an internal error across all variants stating that we cannot push an update as we have a closed variant. </v1.1>

<v1.2> How we handle the other protect flags : Product Account > Protect the whole item = Yes - we skip this item and block the update for the whole variation if it is part of a variation for update. We don’t want to store any error, we just skip it. Product Account > Protect Quantity = Yes - we want to skip this item and block an update for the whole variation if it is part of a variation for update. We want to store an error stating that Full update is not possible as we have items that have protect quantity. Product Account > Protect Price = Yes - we want to skip this item and block an update for the whole variation if it is part of a variation for update. We want to store an error stating that Full update is not possible as we have items that have protect price. </v1.2>

Example:

{
    "category_id": "804360",
    "title": "Puma Kids Girls Hoodie",
    "description": "AWESOME comfort all day long",
    "main_images": [
        {
            "uri": "tos-useast2a-i-tulkllf4y5-euttp/134dfc61cc544726ac2a85675d86ecac"
        }
    ],
    "is_cod_open": false,
    "package_dimensions": {
    "height": "11",
    "length": "30",
    "unit": "CENTIMETER",
    "width": "10"
  },
    "package_weight": {
        "value": "0.91",
        "unit": "KILOGRAM"
    },
    "package_width": 185,
    "product_id": "1729401106232151499",
    "skus": [
        {
            "id": "1729401106232217035",
            "original_price": "52.00",
            "sales_attributes": [
                {
                    "id": "100000",
                    "name": "Colour",
                    "value_name": "Purple"
                },
                {
                        "id": "100007",
                        "name": "Size",
                        "value_id": "7278582591966594849",
                        "value_name": "5-6Y"
                    }
                ],
            "identifier_code": {
                        "code": "4065451689439",
                         "type": "EAN"
            },            
            "inventory": [
                {
                    "available_stock": 19,
                    "warehouse_id": "7097151957604779781"
                }
            ],
            "price": {
                "amount": "111.21",
                "currency": "USD"
            }
        },
        // Below is the new variant which is added to the product. The specific here is when we want to add new variant to product, we did not push the SKU_ID.
        {            
            "original_price": "152.00",
            "sales_attributes": [
                {
                    "id": "100000",
                    "name": "Colour",
                    "value_name": "Purple"
                },
                {
                        "id": "100007",
                        "name": "Size",
                        "value_name": "15-16Y"
                    }
                ],
            "identifier_code": {
                        "code": "4065451689441",
                         "type": "EAN"
            },            
            "inventory": [
                {
                    "available_stock": 19,
                    "warehouse_id": "7097151957604779781"
                }
            ],
            "price": {
                "amount": "121.21",
                "currency": "USD"
            }
        }
    ]
}

The successfull response will be with code : 0 and message : Success . If we receive a different code than 0, this means there was an error and we need to store the error. We want to store the error message as per the abstraction Product Listing general requirements :

Code​ Message​
12019011​ product package weight is invalid​
12019022​ sku ID is invalid​
12052013​ The product description cannot exceed maximum characters​
12052015​ The product description is required​
12052023​ Category does not exist​
12052024​ Category is not final category​
12052026​ Brand does not exist​
12052028​ Main product image is required​
12052038​ Product price locked due to ongoing promotion. ​
12052048​ You can't edit other sellers' products.​
12052051​ The product name exceed max limit characters​
12052055​ The SKU stock exceed limit.​
12052056​ The num of image in description cannot exceed max limit​
12052092​ product sale price is invalid​
12052104​ property is required​
12052105​ required qualification miss​
12052200​ brand is expired​
12052201​ brand does not comply with nice classification​
12052208​ A brand authorization is required to publish this listing.​
12052220​ The category status is unavailable.​
12052221​ Only whitelisted sellers are permitted to trade under current category​
12052222​ category do not support cod​
12052225​ This category status is not available because this category is not within the main category of the store. You do not have permission to use it for this purpose. Please contact AM to apply or re-select the category of the available status.​
12052226​ the category is unauthorized.​
12052227​ the category is unauthorized or unavailable​
12052240​ Do not support custom property.​
12052241​ attribute name or attribute id is empty.​
12052242​ The attribute name characters cannot exceed max_limit​
12052243​ The product attribute or sale attribute name characters contain Chinese.​
12052244​ The attribute name duplicate.​
12052245​ The product attributes contained invalid characters. Please modify and re-submit.​
12052251​ The attribute value name duplicate.​
12052254​ Duplicate attribute id​
12052260​ product id not exist​
12052261​ product name is empty​
12052262​ Chinese characters are not supported in product name​
12052300​ product main image uri illegal​
12052302​ The main images size exceed limit.​
12052304​ Main product image format not support.​
12052305​ The main images aspect ratio cannot exceed max limit.​
12052306​ main product images count exceed limit​
12052324​ Product description image file format is not supported​
12052340​ product description image uri illegal​
12052341​ The description images size cannot exceed limit.​
12052342​ The description images space cannot exceed limit.​
12052344​ The product description html syntax with error​
12052345​ The product description html tag not support.​
12052346​ The product description has Chinese characters​
12052348​ The product description html tag required attribute is miss.​
12052349​ The product description html tag not support nest.​
12052350​ The product description html tag contain illegal attribute.​
12052360​ The video id is not exist.​
12052520​ product sale property image uri illegal​
12052521​ The sale property images size over limit. ​
12052522​ Product sale property image is required​
12052523​ Product sale property image format not support.​
12052524​ The sale property image aspect ratio invalid​
12052525​ The attribute max num cannot exceed 3.​
12052527​ The sale attribute id not exist.​
12052528​ Just allow one sale property contain image.​
12052531​ warehouse status invalid​
12052553​ Sku id duplicate​
12052560​ The SKU contains duplicate sales attribute.​
12052570​ product price exceed limit​
12052572​ the sale price is invalid​
12052593​ The identifier code cannot be changed once be submitted​
12052671​ The sizechart images size over limit.​
12052673​ Product sizechart image is required​
12052700​ seller is inactived​
12052701​ do not support cross-boarder seller create local product directly​
12052702​ seller does not support pre-order​
12052703​ Invalid seller tax number​
12052704​ seller id not exist​
12052900​ System error, try again later​
12052901​ product status invalid​
12052902​ skus is invalid​
Is this article helpful?
0 0 0