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_idhoặcwarehouse_code(đúng một trong hai — theo chuẩn Public API v6.1).
Header
| Header | Bắt buộc | Mô tả |
|---|---|---|
X-API-KEY | Có | API key do CRM cấp |
Content-Type | Khuyến nghị | application/json |
2. Tham số Request
2.1. Định danh (bắt buộc — chọn một)
| Tham số | Kiểu | Mô tả |
|---|---|---|
warehouse_id | integer | ID kho (≥ 1) |
warehouse_code | string | Mã kho (tương ứng store_code trong CRM) |
Không gửi đồng thời warehouse_id và warehouse_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ường | Mô tả |
|---|---|
id | ID kho |
store_name | Tên kho |
total_quantity | Tổ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ường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID kho |
store_name | string | Tên kho |
total_quantity | number | Tổ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>'