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

Phiếu nhập kho

Domain InventorySheetInchỉ đọ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ườngHỗ trợKiểuMô tả
ideqintegerID phiếu
sheet_codeeqstringMã chứng từ
account_ideq, emptyintegerKhách hàng
account_nameeq, containsstringTên KH
store_ideqintegerKho nhập
user_ideqintegerNgười tạo / user liên quan
sheet_statuseq, inintegerTrạng thái phiếu
order_ideq, emptyintegerLiên kết đơn (nếu có)
purchase_order_codeeq, containsstringMã đơn mua
has_accountingeqintegerCờ hạch toán (theo domain)
sheet_dateeq, gte, lte, betweendate / datetimeNgày phiếu
current_and_under_user_departmenteqintegerPhòng ban (theo domain)
valid_user_departmentismixedLọc phòng ban hợp lệ
inventory_product_ideqintegerSP trên dòng phiếu
inventory_product_nameeq, containsstringTên SP
inventory_product_codeeq, containsstringMã SP
(các inventory_product_* + custom field SP)Theo domainBổ 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.

  • search — phạm vi: sheet_code.

1.4. Sorting

TrườngHướng
idasc, 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ómTrường ví dụ
Phiếusheet_code, sheet_date, sheet_status, sheet_kind, flow_code, description, source, created_at, updated_at
Kho / Đơnstore_id, store_name, store_code, store_address, order_id, order_code, slip_id, slip_code
Kháchaccount_id, account_code, account_name, account_phone, account_address, contact_id, contact_name, r_account_manager
Quy trìnhapproval_date, approval_user, workflow_step_id, sheet_workflow_steps, user_ability
Dòng phiếusheet_details (collection dòng — nặng)
Khácrelated_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ểuMô tả
limitintegerGiới hạn
offsetintegerPhâ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ểuMô tả
inventory_sheet_in_idintegerID phiếu (≥ 1)
inventory_sheet_in_codestringMã 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_details có 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 query inventory_sheet_in_id — xem tài liệu Phiếu nhập kho v6.0.