Danh sách kho
1. Thông tin API
- Endpoint:
/api/v6/warehouses - Method:
GET - Authentication:
X-API-KEY - Mô tả: Danh sách kho hoạt động (
valid = 1). Tham số chung: Thông tin cần thiết và domainWarehouse.
2. Tham số Request
2.1. Filtering
| Trường | Hỗ trợ | Kiểu | Mô tả |
|---|---|---|---|
id | eq, in | integer | ID kho |
valid | is, in | integer | Hiệu lực |
storekeeper | eq, in | integer | Thủ kho |
inventory_in_request_user | eq | integer | User yêu cầu nhập |
inventory_out_request_user | eq | integer | User yêu cầu xuất |
inventory_request_user | eq | integer | User yêu cầu kho |
product_id | eq | integer | SP (domain) |
product_name | eq, contains | string | Tên SP |
product_code | eq, contains | string | Mã SP |
product_category_id | eq, in | integer | Danh mục SP |
(các product_* + custom field SP) | Theo domain | — |
2.2. Search
search—store_name,store_code.
2.3. Sorting
| Trường | Hướng |
|---|---|
id | asc, desc |
2.4. Fields (Public API v6)
Whitelist tối thiểu: id, store_name, total_quantity (CSV). Mặc định không gửi fields → chỉ id.
2.5. Pagination
limit, offset.
3. Response mẫu
{
"data": [
{
"id": 1,
"store_name": "Kho chính",
"total_quantity": 15240.5
}
],
"has_more": false,
"offset": 0,
"limited": 50,
"sorted": { "id": "DESC" }
}
4. Ghi chú
- Chi tiết một kho v6.0: Chi tiết kho —
GET /api/v6/warehouses/{id}. - v6.1 hỗ trợ
warehouse_id/warehouse_codetrên một endpointwarehouse: Chi tiết kho v6.1.
Ví dụ curl
curl -g --location 'https://example.getflycrm.com/api/v6/warehouses?fields=id,store_name,total_quantity&limit=50' \
--header 'X-API-KEY: <your_api_key>'