来自 TikTok Shop 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§1 Path: /product/202309/products/{product_id}/inventory/update
#§2 Method: [POST]
#§3 Function Description
Update the inventory quantity of SKUs belonging to a product. The SKU ID must belong to a product that is not in FREEZE or DELETED status.
§4 Common Parameters
For common parameters, refer to How to call TikTok Shop APIs - Common Parameters
| Properties | Location | Type | Require | Sample | Properties description |
|---|---|---|---|---|---|
| shop_cipher | query | string | Y | GCP_XF90igAAAABh00qsWgtvOiGFNqyubMt3 | Use this property to pass shop information in requesting the API. Failure in passing the correct value when requesting the API for cross-border shops will return incorrect response. |
| Get by API Get Authorization Shop | |||||
| content-type | header | string | Y | application/json | Allowed type: application/json |
§5 Request Path Parameters
| Properties | Type | Require | Sample | Properties description |
|---|---|---|---|---|
| product_id | string | Y | 1729382561353664372 | The product ID generated by TikTok Shop. |
§6 Request Query Parameters
| Properties | Type | Require | Sample | Properties description |
|---|---|---|---|---|
| app_key | string | Y | 38abcd | Every single app will have a unique key. Please use the specific key assigned to your app. |
| sign | string | Y | 5361235029d141222525e303d742f9e38aea052d10896d3197ab9d6233730b8c | Signature generated by gen algorithm. When you send API requests to TTS, you must sign them so that TTS can identify the senders. |
| timestamp | int | Y | 1623812664 | Unix timestamp GMT (UTC+00:00). This timestamp is used across all API requests. Developers can use this convert to local time. |
§7 Request Body Parameters
| Properties | Type | Require | Sample | Properties description |
|---|---|---|---|---|
| skus | []object | Y | A list of Stock Keeping Units (SKUs) used to identify distinct variants of the product. | |
| ^id | string | Y | 1729592969712207013 | The SKU ID generated by TikTok Shop. One product can contain multiple SKU IDs. |
Note:
- The SKU ID must belong to a product that is not in
FREEZEorDELETEDstatus. - If you are updating multiple SKUs, all the SKU IDs must belong to the same product. | ^inventory |[]object |Y | |SKU inventory information. Note: You must include all warehouse IDs assigned to this SKU, along with the respective quantity. Do not omit any or add unrelated warehouses. | ^^warehouse_id |string |N |7068517275539719942 |The ID of the warehouse where the SKU is stored. Retrieve this value from the Get Product API.
Note: Optional if there is only 1 warehouse. Otherwise, please provide this ID. |
^^quantity |int |Y |999 |The total SKU quantity available in the warehouse.
Valid range: [1, 99,999]
Note: This quantity specifically refers to the in-stock inventory that can be shipped immediately. |
^^backorder_quantity |int |N |888 |The backorder_quantity will automatically be converted to quantity once in-stock inventory is sold out. The fulfillment of this inventory follows the handling_time specified below.
Note: Any existing backorder_quantity will persist if no update is provided during API call. |
^^handling_time |int |N |5 |The estimated number of working days needed for a backorder to be shipped. Currently, different warehouses for the same SKU are not allowed to have different handling_time |
§8 Request Sample
Query
https://open-api.tiktokglobalshop.com/product/202309/products/1729382561353664372/inventory/update?app_key=123abc&sign=5361235029d141222525e303d742f9e38aea052d10896d3197ab9d6233730b8c×tamp=1625484268&shop_cipher=ROW_RHkDDABBAAB8tKAVoAqsMTjsQZFLyNfY
Body
{"skus":[{"id":"1729592969712207013","inventory":[{"warehouse_id":"7068517275539719942","quantity":999,"backorder_quantity":888,"handling_time":5}]}]}
§9 Response Parameters
| Properties | Type | Sample | Properties description |
|---|---|---|---|
| code | int | 0 | The success or failure status code returned in API response. |
| message | string | Success | The success or failure messages returned in API response. Reasons of failure will be described in the message. |
| request_id | string | 202203070749000101890810281E8C70B7 | Request log |
| data | object | Specific return information | |
| ^errors | []object | The list of errors that occurred. | |
| ^^code | int | 12052990 | The main error code. |
| ^^message | string | Check failed | The main error message. |
| ^^detail | object | The details of the main error. | |
| ^^^sku_id | string | 1729592969712207013 | The ID of the SKU where the error occurred. |
| ^^^extra_errors | []object | A list of secondary errors or issues related to the main error. | |
| ^^^^warehouse_id | string | 7068517275539719942 | The ID of the warehouse where the error occurred. |
| ^^^^code | int | 12052097 | The secondary error code. |
| ^^^^message | string | The warehouse does not exist | The secondary error message. |
§10 Response Sample
{"code":0,"data":{"errors":[{"code":12052990,"message":"Check failed","detail":{"sku_id":"1729592969712207013","extra_errors":[{"warehouse_id":"7068517275539719942","code":12052097,"message":"The warehouse does not exist"}]}}]},"message":"Success","request_id":"202203070749000101890810281E8C70B7"}
§11 Error Code
For common error codes, refer to How to call TikTok Shop APIs - Common Error Code
| Code | Message |
|---|---|
| 12019022 | SKU must contain a valid warehouse. |
| 12019024 | stock count is invalid |
| 12019028 | Multiple warehouses detected. Include all warehouse IDs and the corresponding details and try again. |
| 12052031 | Invalid product ID(s) found |
| 12052032 | The product does not exist |
| 12052036 | The SKU ID is necessary |
| 12052037 | Couldn't update inventory. Possible causes: |
- Inventory is automatically allocated and cannot be modified manually
- Warehouse IDs provided are incorrect
- Missing warehouse IDs (all warehouses that stock the product must be included) | 12052048 |You cannot edit the specified product(s) as it isn't listed in your account or shop. | 12052050 |A single product cannot have more than 100 different SKUs | 12052055 |The SKU inventory quantity for the warehouse must be within allowed limits. | 12052094 |No multiple warehouse permission | 12052096 |Unable to update the price for SKUs with no warehouse. Assign a warehouse and try again. | 12052097 |The warehouse does not exist | 12052115 |seller has no warehouse | 12052141 |please edit stock from global | 12052160 |sku count must be one and disable variables | 12052207 |receipt brand not support warehouse | 12052260 |The product ID does not exist | 12052308 |There's an ongoing appeal. If you wish to edit product details, please revoke the appeal first. | 12052364 |The warehouse is unavailable because this product cannot be shipped to the target market from this warehouse. | 12052371 |Auction product is bidding when it is not supported to change product info | 12052393 |Product locked for Promotion and stock can't be updated below current stock | 12052403 |The warehouse does not support fulfillment for the current shop. | 12052465 |warehouse is unavailable for eu gpr product | 12052530 |The warehouse ' {{warehouse ID}} ' does not belong to this shop/seller. | 12052531 |The warehouse is disabled. | 12052532 |the warehouse not delivery warehouse | 12052533 |Removal, addition, and change of warehouses are not permitted. Please specify the original warehouses for the SKUs. | 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 |The seller is inactive. | 12052703 |Invalid seller tax number | 12052704 |seller id not exist | 12052849 |You don't have the permission to operate combo. | 12052850 |The stock of combo does not support being edited. | 36009003 |Internal error. Please try again. If the issue persists after multiple attempts, please contact platform support. | 12052901 |The product in its current status is not available for this operation. Change the product status and try again. | 12052902 |The SKU list is empty. Either omit the list entirely, or provide all required details. | 12052921 |Couldn't edit the inventory quantity because this product shares the inventory with the source shop | 12052990 |The check failed. |
