Chuyển tới nội dung chính

Chi tiết kho

1. Thông tin API

  • Endpoint: /api/v6.1/warehouse
  • Method: GET
  • Mô tả: Lấy một kho theo warehouse_id hoặc warehouse_code (đúng một trong hai — theo chuẩn Public API v6.1).
HeaderBắt buộcMô tả
X-API-KEYAPI key do CRM cấp
Content-TypeKhuyến nghịapplication/json

2. Tham số Request

2.1. Định danh (bắt buộc — chọn một)

Tham sốKiểuMô tả
warehouse_idintegerID kho (≥ 1)
warehouse_codestringMã kho (tương ứng store_code trong CRM)

Không gửi đồng thời warehouse_idwarehouse_code.

2.2. Fields

Giống Danh sách kho: Public API v6.1 cho phép id, store_name, total_quantity (CSV). Mặc định không gửi fields → chỉ id.

TrườngMô tả
idID kho
store_nameTên kho
total_quantityTổng tồn

3. Response mẫu

{
"id": 2,
"store_name": "Kho Bình Dương",
"total_quantity": 89432
}

4. Mô tả các trường dữ liệu

TrườngKiểuMô tả
idintegerID kho
store_namestringTên kho
total_quantitynumberTổng tồn

5. Ghi chú

  • Có thể gửi tham số query hoặc body JSON tùy client; phổ biến nhất là query string.

Ví dụ curl

curl --location 'https://example.getflycrm.com/api/v6.1/warehouse?warehouse_id=1&fields=id,store_name,total_quantity' \
--header 'X-API-KEY: <your_api_key>'
curl --location 'https://example.getflycrm.com/api/v6.1/warehouse?warehouse_code=KHO-A&fields=id,store_name,total_quantity' \
--header 'X-API-KEY: <your_api_key>'