Tồn kho — Cập nhật một biến thể

Cập nhật tồn kho của một biến thể theo từng kho.

Xem Markdown

Cập nhật số lượng tồn của một biến thể ở một hoặc nhiều kho.

Endpoint

MethodEndpointMô tả
POST/api/v1/shops/{shop_id}/variations/{variation_id}/update_quantityCập nhật tồn một biến thể

Tham số

Tham sốVị tríKiểuBắt buộcMô tả
shop_idđường dẫnstringCóID cửa hàng
variation_idđường dẫnstringCóID biến thể
variations_warehousesthânobject[]CóDanh sách {warehouse_id, remain_quantity}

Kiểm thử tại chỗ

POSThttps://pos.hitechcloud.vn/api/v1/shops/{shop_id}/variations/{variation_id}/update_quantity

Nhập tham số và API Key rồi bấm Gửi thử. Key không được lưu lại.

Tham số đường dẫn
Body
cURL mẫu (POST)
curl -X POST "https://pos.hitechcloud.vn/api/v1/shops/shop_0a1b2c3d/variations/var_1001/update_quantity" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "variations_warehouses": [
    {
      "warehouse_id": "wh_main",
      "remain_quantity": 62
    }
  ]
}'
Phản hồi mẫu
{
  "status": "success",
  "data": {
    "variation_id": "var_1001",
    "warehouse_id": "wh_main",
    "remain_quantity": 62
  }
}