Tồn kho — Cập nhật hàng loạt

Cập nhật tồn kho nhiều biến thể cùng lúc.

Xem Markdown

Cập nhật tồn hàng loạt cho nhiều cặp (biến thể, kho). Dùng is_actual_remain_quantity để gán tồn thực tế khi kiểm kê.

Endpoint

MethodEndpointMô tả
POST/api/v1/shops/{shop_id}/variations/update_quantityCập nhật tồn hàng loạt

Tham số

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

Kiểm thử tại chỗ

POSThttps://pos.hitechcloud.vn/api/v1/shops/{shop_id}/variations/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/update_quantity" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "variations_warehouses": [
    {
      "variation_id": "var_1001",
      "warehouse_id": "wh_main",
      "remain_quantity": 62
    }
  ]
}'
Phản hồi mẫu
{
  "status": "success",
  "data": {
    "updated": 1
  }
}
Giới hạn ghi tồn kho chặt hơn các endpoint khác (xem Phân trang & Rate limit).