/shops/{SHOP_ID}/inventory_analytics/inventoryBáo cáo xuất nhập kho theo mẫu mãGET/shops/{SHOP_ID}/inventory_analytics/inventory_by_productBáo cáo xuất nhập kho theo sản phẩmBáo cáo xuất nhập kho theo mẫu mã
/shops/{SHOP_ID}/inventory_analytics/inventoryLấy báo cáo xuất nhập kho theo mẫu mã
Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Tham số truy vấn
pageintegerSố trang hiện tại
page_sizeintegerKích thước trang
start_dateinteger · unix timestampbắt buộcThời gian bắt đầu (unix timestamp)
end_dateinteger · unix timestampbắt buộcThời gian kết thúc (unix timestamp)
typestringbắt buộcBáo cáo theo
"actual"Tồn kho"remain"Có thể bánwarehouse_ids[]array<string · uuid>Lọc lịch sử theo mã kho. Chỉ tính các phát sinh xuất nhập thuộc các kho được liệt kê.
variation_ids[]array<string · uuid>Lọc theo mã mẫu mã. Khi is_exclude_variation=true, danh sách này trở thành danh sách loại trừ.
is_exclude_variationbooleanKhi bật, coi variation_ids[] là danh sách loại trừ thay vì danh sách lọc vào.
product_ids[]array<string · uuid>Lọc theo mã sản phẩm. Khi is_exclude_product=true, danh sách này trở thành danh sách loại trừ.
is_exclude_productbooleanKhi bật, coi product_ids[] là danh sách loại trừ thay vì danh sách lọc vào.
category_ids[]array<integer>Lọc theo mã danh mục. Có thể truyền một giá trị đơn (category_ids=567).
brand_ids[]array<string>Lọc theo mã thương hiệu (UUID). Giá trị đặc biệt no_value để lọc sản phẩm chưa gắn thương hiệu.
product_tags[]array<string>Lọc theo mã tag sản phẩm (số nguyên dạng chuỗi). Giá trị đặc biệt no_value để lọc sản phẩm chưa gắn tag.
Kết hợp với filter_exclude_tag=true để đảo lọc thành loại trừ.
filter_exclude_tagbooleanKhi bật, coi product_tags[] là danh sách loại trừ. Loại bỏ các sản phẩm có chứa bất kỳ tag nào trong danh sách.
supplier_product_ids[]array<string>Lọc theo mã nhà cung cấp (số nguyên dạng chuỗi). Giá trị đặc biệt no_value để lọc sản phẩm chưa gắn NCC.
Mặc định sản phẩm phải chứa TẤT CẢ các NCC được liệt kê; bật is_filter_supplier_by_or=true để khớp BẤT KỲ.
is_filter_supplier_by_orbooleanKhi bật, các giá trị trong supplier_product_ids[] được khớp theo OR (bất kỳ) thay vì AND (tất cả).
manipulation_warehouse_ids[]array<string · uuid>Lọc theo kho thao tác cấu hình trên sản phẩm. Mặc định sản phẩm phải chứa TẤT CẢ các kho được liệt kê;
bật is_filter_manipulation_warehouse_by_or=true để khớp BẤT KỲ. Sản phẩm chưa cấu hình kho thao tác luôn được tính.
is_filter_manipulation_warehouse_by_orbooleanKhi bật, các giá trị trong manipulation_warehouse_ids[] được khớp theo OR (bất kỳ) thay vì AND (tất cả).
data_sortstringBộ sắp xếp dạng JSON {"sort_by": <trường>, "asc_desc": "asc"|"desc"}. Các giá trị sort_by hỗ trợ:
product_id, product_name, variation, purchase_import, purchase_export, return_import,
transfer_import, transfer_export, sell_export, stocktaking_import, stocktaking_export,
other_import, other_export, total_import_value, total_export_value, early_actual,
late_actual, early_actual_value, late_actual_value.
Phản hồi
dataarray<object>Thống kê theo mẫu mã
page_numberintegerSố trang hiện tại
page_sizeintegerKích thước trang
total_entriesintegerTổng số bản ghi
total_pagesintegerTổng số trang
successbooleanTrạng thái thành công
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/inventory_analytics/inventory?api_key=API_KEY&start_date=1760720400&end_date=1763398799&type=actual"{
"success": true,
"data": [
{
"id": "d9005a9f-257b-4ce7-af6e-bad339598ea6",
"begin_inventory": 1099,
"begin_inventory_value": 109900000,
"end_inventory": 1128,
"end_inventory_value": 112800000,
"purchase_import": 30,
"return_import": 0,
"stocktaking_import": 2,
"transfer_import": 5,
"total_import": 37,
"total_import_value": 3700000,
"purchase_export": 0,
"transfer_export": -5,
"sell_export": 0,
"stocktaking_export": 0,
"total_export": -8,
"total_export_value": 800000,
"variation": {
"id": "d9005a9f-257b-4ce7-af6e-bad339598ea6",
"product_id": "dee8f2c3-2ecc-4d9b-a9ff-603b5bde7e3d",
"shop_id": 20,
"custom_id": "TESTMATDOS",
"display_id": 15,
"barcode": null,
"images": [
"https://content.pancake.vn/user-content-dev2.pancake.vn/2025/9/30/d05f44dcf2b9f96312d88b718da35aa5317242d6.jpg"
],
"fields": [
{
"id": "2b61c249-35dc-4b79-a3aa-a173c63a8061",
"keyValue": "BLUE",
"name": "Color",
"value": "blue"
},
{
"id": "b053dfb9-b7b6-4d8a-9fb4-197d7b0d7556",
"keyValue": "L",
"name": "Size",
"value": "L"
}
],
"product": {
"category_ids": [
567
],
"custom_id": "ANTT",
"display_id": 13038,
"images": [],
"inserted_at": "2024-11-18T03:18:03",
"name": "Áo nam Pari đẹp thời trang"
}
}
}
],
"page_number": 1,
"page_size": 30,
"total_entries": 4,
"total_pages": 1
}Báo cáo xuất nhập kho theo sản phẩm
/shops/{SHOP_ID}/inventory_analytics/inventory_by_productLấy báo cáo xuất nhập kho theo sản phẩm
Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Tham số truy vấn
pageintegerSố trang hiện tại
page_sizeintegerKích thước trang
start_dateinteger · unix timestampbắt buộcThời gian bắt đầu (unix timestamp)
end_dateinteger · unix timestampbắt buộcThời gian kết thúc (unix timestamp)
typestringbắt buộcBáo cáo theo
"actual"Tồn kho"remain"Có thể bánwarehouse_ids[]array<string · uuid>Lọc lịch sử theo mã kho. Chỉ tính các phát sinh xuất nhập thuộc các kho được liệt kê.
variation_ids[]array<string · uuid>Lọc theo mã mẫu mã. Khi is_exclude_variation=true, danh sách này trở thành danh sách loại trừ.
is_exclude_variationbooleanKhi bật, coi variation_ids[] là danh sách loại trừ thay vì danh sách lọc vào.
product_ids[]array<string · uuid>Lọc theo mã sản phẩm. Khi is_exclude_product=true, danh sách này trở thành danh sách loại trừ.
is_exclude_productbooleanKhi bật, coi product_ids[] là danh sách loại trừ thay vì danh sách lọc vào.
category_ids[]array<integer>Lọc theo mã danh mục. Có thể truyền một giá trị đơn (category_ids=567).
brand_ids[]array<string>Lọc theo mã thương hiệu (UUID). Giá trị đặc biệt no_value để lọc sản phẩm chưa gắn thương hiệu.
product_tags[]array<string>Lọc theo mã tag sản phẩm (số nguyên dạng chuỗi). Giá trị đặc biệt no_value để lọc sản phẩm chưa gắn tag.
Kết hợp với filter_exclude_tag=true để đảo lọc thành loại trừ.
filter_exclude_tagbooleanKhi bật, coi product_tags[] là danh sách loại trừ. Loại bỏ các sản phẩm có chứa bất kỳ tag nào trong danh sách.
supplier_product_ids[]array<string>Lọc theo mã nhà cung cấp (số nguyên dạng chuỗi). Giá trị đặc biệt no_value để lọc sản phẩm chưa gắn NCC.
Mặc định sản phẩm phải chứa TẤT CẢ các NCC được liệt kê; bật is_filter_supplier_by_or=true để khớp BẤT KỲ.
is_filter_supplier_by_orbooleanKhi bật, các giá trị trong supplier_product_ids[] được khớp theo OR (bất kỳ) thay vì AND (tất cả).
manipulation_warehouse_ids[]array<string · uuid>Lọc theo kho thao tác cấu hình trên sản phẩm. Mặc định sản phẩm phải chứa TẤT CẢ các kho được liệt kê;
bật is_filter_manipulation_warehouse_by_or=true để khớp BẤT KỲ. Sản phẩm chưa cấu hình kho thao tác luôn được tính.
is_filter_manipulation_warehouse_by_orbooleanKhi bật, các giá trị trong manipulation_warehouse_ids[] được khớp theo OR (bất kỳ) thay vì AND (tất cả).
data_sortstringBộ sắp xếp dạng JSON {"sort_by": <trường>, "asc_desc": "asc"|"desc"}. Các giá trị sort_by hỗ trợ:
product_id, product_name, variation, purchase_import, purchase_export, return_import,
transfer_import, transfer_export, sell_export, stocktaking_import, stocktaking_export,
other_import, other_export, total_import_value, total_export_value, early_actual,
late_actual, early_actual_value, late_actual_value.
Phản hồi
dataarray<object>Thống kê theo sản phẩm
page_numberintegerSố trang hiện tại
page_sizeintegerKích thước trang
total_entriesintegerTổng số bản ghi
total_pagesintegerTổng số trang
successbooleanTrạng thái thành công
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/inventory_analytics/inventory_by_product?api_key=API_KEY&start_date=1760720400&end_date=1763398799&type=actual"{
"success": true,
"page_number": 1,
"page_size": 30,
"total_entries": 1,
"total_pages": 1,
"data": [
{
"id": "dee8f2c3-2ecc-4d9b-a9ff-603b5bde7e3d",
"product_id": "dee8f2c3-2ecc-4d9b-a9ff-603b5bde7e3d",
"begin_inventory": 2597,
"begin_inventory_value": 259700000,
"end_inventory": 2870,
"end_inventory_value": 287000000,
"purchase_import": 130,
"return_import": 5,
"stocktaking_import": 2,
"transfer_import": 5,
"total_import": 296,
"total_import_value": 29600000,
"purchase_export": 0,
"transfer_export": -5,
"sell_export": -15,
"stocktaking_export": 0,
"total_export": -23,
"total_export_value": 2300000,
"product": {
"category_ids": [
567
],
"custom_id": "ANTT",
"display_id": 13038,
"images": [],
"inserted_at": "2024-11-18T03:18:03",
"name": "Áo nam Pari đẹp thời trang"
}
}
]
}