Overwrite Stock
This endpoint used for overwriting product stock.
Path
post
/inventory/v1/fs/:fs_id/stock/overwrite
Request Parameters
Parameter | Type | Required | Location | Description |
---|---|---|---|---|
fs_id | Integer | Required | path | Fulfillment service id |
shop_id | Integer | Required | path | Shop ID, owner of the product |
warehouse_id | Integer | Required | query | Warehouse ID, where the increment decrement address to |
request_id | String | Optional | query | Request ID, unique ID generated by WMS for preventing duplicated request to the API |
product_id | Integer | Required | body | Product ID (maximum 20 product_id per request) |
sku | String | Optional | body | Code in WMS for identifying the given product |
product_url | String | Optional | body | Tokopedia URL that address product id given |
new_stock | Integer | Required | body | Current stock for the product_id in WMS |
Example Request
curl -X POST \
'https://fs.tokopedia.net/inventory/v1/fs/:fs_id/stock/overwrite?
shop_id=:shop_id&warehouse_id=1&request_id=12345-6789-123' \
-H 'Authorization: Bearer C-UMqWWXRqaJugr7w5U0zQ' \
-H 'Content-Type: application/json' \
-d '[
{
"product_id": 446082276,
"sku": "VLNP003-007",
"Product_url":"https://www.tokopedia.com/05test07/variant-level-2-new-product-03-ungu-36",
"new_stock": 10
}
]'
Response Parameters
Success Response Examples
{
"header": {
"process_time": 1950.2109079999998,
"messages": "Your request has been processed successfully"
},
"data": {
"failed_rows": 0,
"failed_rows_data": [],
"succeed_rows": 1
}
}
Error Response Examples
{
"header": {
"process_time": 102.105345,
"messages": "We had a problem with our server. Try again later.",
"reason": "",
"error_code": 0
},
"data": null
}
Error Codes
Notes
Maximum JSON body length is 20