Phiếu nhập kho
Domain InventorySheetIn — chỉ đọc (GET).
1. Danh sách phiếu nhập
1.1. Thông tin API
- Endpoint:
/api/v6.1/inventory_sheet_ins - Method:
GET - Authentication:
X-API-KEY
1.2. Filtering
| Trường | Hỗ trợ | Kiểu | Mô tả |
|---|---|---|---|
id | eq | integer | ID phiếu |
sheet_code | eq | string | Mã chứng từ |
account_id | eq, empty | integer | Khách hàng |
account_name | eq, contains | string | Tên KH |
store_id | eq | integer | Kho nhập |
user_id | eq | integer | Người tạo / user liên quan |
sheet_status | eq, in | integer | Trạng thái phiếu |
order_id | eq, empty | integer | Liên kết đơn (nếu có) |
purchase_order_code | eq, contains | string | Mã đơn mua |
has_accounting | eq | integer | Cờ hạch toán (theo domain) |
sheet_date | eq, gte, lte, between | date / datetime | Ngày phiếu |
current_and_under_user_department | eq | integer | Phòng ban (theo domain) |
valid_user_department | is | mixed | Lọc phòng ban hợp lệ |
inventory_product_id | eq | integer | SP trên dòng phiếu |
inventory_product_name | eq, contains | string | Tên SP |
inventory_product_code | eq, contains | string | Mã SP |
(các inventory_product_* + custom field SP) | Theo domain | — | Bổ sung theo cấu hình |
Lọc lồng khách hàng: sub_account — object điều kiện con (domain Account::handleSubFiltering), tương tự các API CRM có sub_account.
1.3. Search
search— phạm vi:sheet_code.
1.4. Sorting
| Trường | Hướng |
|---|---|
id | asc, desc |
Mặc định: id DESC.
1.5. Fields
fields— CSV (needed_info).- Mặc định: chỉ
id.
Các trường có thể truy xuất (rút gọn — đủ keys trong domain defineRetrievableFields):
| Nhóm | Trường ví dụ |
|---|---|
| Phiếu | sheet_code, sheet_date, sheet_status, sheet_kind, flow_code, description, source, created_at, updated_at |
| Kho / Đơn | store_id, store_name, store_code, store_address, order_id, order_code, slip_id, slip_code |
| Khách | account_id, account_code, account_name, account_phone, account_address, contact_id, contact_name, r_account_manager |
| Quy trình | approval_date, approval_user, workflow_step_id, sheet_workflow_steps, user_ability |
| Dòng phiếu | sheet_details (collection dòng — nặng) |
| Khác | related_user_ids, sale_order, purchase_order, total_product_price_out_amount, attachment_code, attachments, user_id, creator_display_name |
1.6. Pagination
| Tham số | Kiểu | Mô tả |
|---|---|---|
limit | integer | Giới hạn |
offset | integer | Phân trang |
1.7. Response mẫu (danh sách)
{
"data": [
{
"id": 1200,
"sheet_code": "PNK/2026/0001",
"sheet_date": "2026-03-15",
"store_id": 1,
"store_name": "Kho chính",
"sheet_status": 2
}
],
"has_more": false,
"offset": 0,
"limited": 50,
"sorted": { "id": "DESC" }
}
1.8. Ví dụ curl
curl -g --location 'https://example.getflycrm.com/api/v6.1/inventory_sheet_ins?fields=id,sheet_code,sheet_date,store_id,store_name,sheet_status&filtering[store_id]=1&limit=50' \
--header 'X-API-KEY: <your_api_key>'
2. Chi tiết phiếu nhập
2.1. Thông tin API
- Endpoint:
/api/v6.1/inventory_sheet_in - Method:
GET
2.2. Định danh (bắt buộc — chọn một)
| Tham số | Kiểu | Mô tả |
|---|---|---|
inventory_sheet_in_id | integer | ID phiếu (≥ 1) |
inventory_sheet_in_code | string | Mã chứng từ (sheet_code) |
Không gửi đồng thời hai tham số.
2.3. Fields
Giống mục 1.5. Chi tiết phiếu: backend gọi collector dòng phiếu — trong response thường có sheet_details (mảng các dòng) khi trường đó được nạp theo fields / logic collector.
2.4. Response mẫu (rút gọn)
{
"id": 1200,
"sheet_code": "PNK/2026/0001",
"sheet_date": "2026-03-15",
"store_id": 1,
"store_name": "Kho chính",
"account_name": "Công ty ABC",
"sheet_details": [
{
"product_id": 101,
"product_code": "SP001",
"product_name": "Sản phẩm mẫu",
"quantity": 10,
"unit_name": "Cái"
}
]
}
2.5. Ví dụ curl
curl --location 'https://example.getflycrm.com/api/v6.1/inventory_sheet_in?inventory_sheet_in_code=PNK/2026/0001&fields=id,sheet_code,sheet_date,store_name,account_name,sheet_details' \
--header 'X-API-KEY: <your_api_key>'
3. Ghi chú
sheet_detailscó thể chứa biến thể / thuộc tính tùy sản phẩm — cấu trúc đầy đủ lấy từ response thực tế.- Phiên bản v6.0 dùng URL path
/api/v6/inventory_sheet_ins/{id}thay cho queryinventory_sheet_in_id— xem tài liệu Phiếu nhập kho v6.0.