v1

latestOpenAPI 3.0.02026-07-26318168886.7 KB
Products

Bulk Update Stock

To update the mutiple product's stock with its ID<br>使用多個商品 ID 更新商品在各個倉庫的庫存

put/products/bulk_update_stocks

Request body

is_replaceboolean required

Whether replacing the original quantity<br>是否取代原本數量<br><br>true: replace the product's quantity with the number you provided<br>取代原本數量<br><br>false: increase/decrease the quantity with the number you provided<br>增加/減少數量

Example request

{
  "bulk_data": [
    {
      "id": "5d3594c276e7ec003b7021c0",
      "quantity": 10,
      "warehouse_id": "5ee819deab591e00169a4618",
      "variation_id": "5d3594c2e95d2f000642e011"
    }
  ]
}

Response

OK

Example response

{
  "errors": [
    {
      "message": "Stock Not Found",
      "data": {
        "product_id": "645c6a1a3c53a4004800ffcf",
        "quantity": 10,
        "warehouse_id": "6327e34fb64cf2001bbad433"
      }
    }
  ]
}