TikTok Update Stock
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 | 30/09/2024 | Hristiyan | Added additional trigger |
Update Stock
API Call: POST /product/202309/products/{product_id}/inventory/update
All triggers, validations etc are as per the abstraction -
Stock Update general requirements <v1.1> and an additional trigger of Product Account TikTok
> TikTok Product Status
= Activated </v1.1>
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
Example Call:
{
"skus": [
{
"id": "1729592969712207013",
"inventory": [
{
"quantity": 999,
"warehouse_id": "7068517275539719942"
}
]
}
]
}
Call Mapping:
Integration Field | Integration Notes | Integration required | Hemi Mapping | Hemi Notes | ||
---|---|---|---|---|---|---|
skus |
object[] | |||||
The SKU stock can be updated only this SKU in live status.(you cannot successfully modify the stock if the product in other status | Yes | |||||
id |
string | |||||
SKU_ID | Yes | Product Аccount TikTok > SKU ID |
If we would want to update stock for a product, which have variations, we should push the Product ID, that we have received and stored into Channel Item ID , and the “SKU ID“ for each variant that we have stored in Product Account TikTok > SKU ID |
|||
inventory |
object | Yes | ||||
quantity |
int32 | |||||
The value should be non-negative numbers(include number 0)And less then 99999 | Yes | Product Account > Quantity |
||||
warehouse_id |
If the SKU is using one default warehouse information , then this warehouse id is an optional field. | No | N/A |
Upon successful response we will receive code “0“ status with message “Success“ for each update we’ve requested.
Example Response:
{
"code": 0,
"data": {
"errors": [
{
"code": 12052990,
"detail": {
"extra_errors": [
{
"code": 12052003,
"message": "The current product status can not be actiavted",
"warehouse_id": "7068517275539719942"
}
],
"sku_id": "1729592969712207013"
},
"message": "batch update inventory error"
}
]
},
"message": "Success",
"request_id": "202203070749000101890810281E8C70B7"
}
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 |
---|---|
12019022 | sku ID is invalid |
12019024 | stock count is invalid |
12019028 | multiple warehouse in one product |
12052036 | The SKU ID is necessary |
12052037 | Failed to update stock |
12052048 | You can't edit other sellers' products. |
12052050 | A single product cannot have more than 100 different SKUs |
12052055 | The SKU stock exceed limit. |
12052096 | The warehouse is required |
12052097 | The warehouse does not exist |
12052141 | please edit stock from global |
12052260 | product id not exist |
12052403 | logistics service unreachable |
12052530 | warehouse id not belong seller |
12052531 | warehouse status invalid |
12052532 | the warehouse not delivery warehouse |
12052535 | Couldn't publish this product as you haven't set the return warehouse for your shop. Add the return warehouse information on TikTok Shop Seller Center first and try again. |
12052553 | Sku id duplicate |
12052556 | The SKU id not exist. |
12052700 | seller is inactived |
12052703 | Invalid seller tax number |
12052900 | System error, try again later |
12052901 | product status invalid |
12052902 | skus is invalid |