Reports & ads

Statistics inventory analytics

2 endpoints · https://pos.pages.fm/api/v1

View Markdown

Statistics by variant

GET/shops/{SHOP_ID}/inventory_analytics/inventory

Get inventory statistics grouped by product variant

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Query parameters

pageinteger

Page number

Example: 1
page_sizeinteger

Page size

Example: 30
start_dateinteger · unix timestamprequired

Start date (unix timestamp)

Example: 1760720400
end_dateinteger · unix timestamprequired

End date (unix timestamp)

Example: 1763398799
typestringrequired

Statistics by

Values"actual"inventory"remain"Remain quantity
Example: "actual"
warehouse_ids[]array<string · uuid>

Filter histories by warehouse ID(s). Restricts the inventory movements considered to the listed warehouses.

variation_ids[]array<string · uuid>

Filter by variation IDs. When is_exclude_variation=true, this list becomes an exclusion list.

is_exclude_variationboolean

When true, treat variation_ids[] as an exclusion list instead of an inclusion list.

Default: false · Example: false
product_ids[]array<string · uuid>

Filter by product IDs. When is_exclude_product=true, this list becomes an exclusion list.

is_exclude_productboolean

When true, treat product_ids[] as an exclusion list instead of an inclusion list.

Default: false · Example: false
category_ids[]array<integer>

Filter by category IDs. A single integer value is also accepted (category_ids=567).

brand_ids[]array<string>

Filter by brand IDs (UUID). Special value no_value matches products without a brand.

product_tags[]array<string>

Filter by product tag IDs (integers serialized as strings). Special value no_value matches products without any tag. Combine with filter_exclude_tag=true to negate the filter.

filter_exclude_tagboolean

When true, treat product_tags[] as an exclusion list. Products with any of the listed tags are excluded.

Default: false · Example: false
supplier_product_ids[]array<string>

Filter by supplier IDs (integers serialized as strings). Special value no_value matches products without a supplier. By default the product must contain ALL listed supplier IDs; set is_filter_supplier_by_or=true to match ANY.

is_filter_supplier_by_orboolean

When true, OR-combine the supplier_product_ids[] filter (match any) instead of AND (match all).

Default: false · Example: false
manipulation_warehouse_ids[]array<string · uuid>

Filter by manipulation warehouses configured on the product. By default the product must contain ALL listed warehouses; set is_filter_manipulation_warehouse_by_or=true to match ANY. Products without any manipulation warehouse are always included.

is_filter_manipulation_warehouse_by_orboolean

When true, OR-combine the manipulation_warehouse_ids[] filter (match any) instead of AND (match all).

Default: false · Example: false
data_sortstring

JSON-encoded sort spec {"sort_by": <field>, "asc_desc": "asc"|"desc"}. Supported sort_by values: 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.

Example: "{\"sort_by\":\"product_name\",\"asc_desc\":\"desc\"}"

Responses

object
dataarray<object>

Statistics by variant

page_numberinteger

Current page number

page_sizeinteger

Page size

total_entriesinteger

Total number of entries

total_pagesinteger

Total number of pages

successboolean

Success status

Request
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"
Response 200
{
  "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
}

Statistics by product

GET/shops/{SHOP_ID}/inventory_analytics/inventory_by_product

Get inventory statistics grouped by product

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Query parameters

pageinteger

Page number

Example: 1
page_sizeinteger

Page size

Example: 30
start_dateinteger · unix timestamprequired

Start date (unix timestamp)

Example: 1760720400
end_dateinteger · unix timestamprequired

End date (unix timestamp)

Example: 1763398799
typestringrequired

Statistics by

Values"actual"inventory"remain"Remain quantity
Example: "actual"
warehouse_ids[]array<string · uuid>

Filter histories by warehouse ID(s). Restricts the inventory movements considered to the listed warehouses.

variation_ids[]array<string · uuid>

Filter by variation IDs. When is_exclude_variation=true, this list becomes an exclusion list.

is_exclude_variationboolean

When true, treat variation_ids[] as an exclusion list instead of an inclusion list.

Default: false · Example: false
product_ids[]array<string · uuid>

Filter by product IDs. When is_exclude_product=true, this list becomes an exclusion list.

is_exclude_productboolean

When true, treat product_ids[] as an exclusion list instead of an inclusion list.

Default: false · Example: false
category_ids[]array<integer>

Filter by category IDs. A single integer value is also accepted (category_ids=567).

brand_ids[]array<string>

Filter by brand IDs (UUID). Special value no_value matches products without a brand.

product_tags[]array<string>

Filter by product tag IDs (integers serialized as strings). Special value no_value matches products without any tag. Combine with filter_exclude_tag=true to negate the filter.

filter_exclude_tagboolean

When true, treat product_tags[] as an exclusion list. Products with any of the listed tags are excluded.

Default: false · Example: false
supplier_product_ids[]array<string>

Filter by supplier IDs (integers serialized as strings). Special value no_value matches products without a supplier. By default the product must contain ALL listed supplier IDs; set is_filter_supplier_by_or=true to match ANY.

is_filter_supplier_by_orboolean

When true, OR-combine the supplier_product_ids[] filter (match any) instead of AND (match all).

Default: false · Example: false
manipulation_warehouse_ids[]array<string · uuid>

Filter by manipulation warehouses configured on the product. By default the product must contain ALL listed warehouses; set is_filter_manipulation_warehouse_by_or=true to match ANY. Products without any manipulation warehouse are always included.

is_filter_manipulation_warehouse_by_orboolean

When true, OR-combine the manipulation_warehouse_ids[] filter (match any) instead of AND (match all).

Default: false · Example: false
data_sortstring

JSON-encoded sort spec {"sort_by": <field>, "asc_desc": "asc"|"desc"}. Supported sort_by values: 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.

Example: "{\"sort_by\":\"product_name\",\"asc_desc\":\"desc\"}"

Responses

object
dataarray<object>

Statistics by product

page_numberinteger

Current page number

page_sizeinteger

Page size

total_entriesinteger

Total number of entries

total_pagesinteger

Total number of pages

successboolean

Success status

Request
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"
Response 200
{
  "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"
      }
    }
  ]
}