/shops/{SHOP_ID}/analytics/saleOrder statisticsGET/shops/{SHOP_ID}/analytics/get_list_formulaList of customized formulasGET/shops/{SHOP_ID}/analytics/get_analytic_fieldsList of analytic fieldsGET/shops/{SHOP_ID}/statistic_custom/foldersList of custom statistic foldersOrder statistics
/shops/{SHOP_ID}/analytics/saleGet order statistics
Path parameters
SHOP_IDintegerrequiredShop ID
Query parameters
sincestring · date-timeStart date
untilstring · date-timeEnd date
split_by[]array<string>Group statistics by one or more dimensions. Each value is a <Table>.<field> key.
Time.hour/Time.day/Time.month/Time.year— by date bucketOrder.source/Order.order_sources— by order source / accountOrder.status— by order status codeOrder.warehouse_id— by warehouseOrder.post_id— by Facebook postOrder.partner_id— by shipping carrierOrder.marketplace_id— by e-commerce marketplaceOrder.country_code/Order.province_id/Order.district_id/Order.commune_id/Order.region_filter— by shipping geographyOrder.tag— by order tagOrder.is_wholesale/Order.is_livestream— wholesale / livestream flagOrder.livestream_manager_ids— by livestream managerOrder.total_price— by order total price bucketOrder.ads_or_normal/Order.ad_account_id/Order.ad_id— ad partitioningUser.id/User.sale_group/User.department_id— by staff / sale group / departmentCustomer.id/Customer.level_id/Customer.new— by customer / level / new vs. oldVariation.id/Variation.product_id— by variation / productVariation.category/Variation.supplier/Variation.brand_id/Variation.tag— by product taxonomyVariation.price_range/Variation.quantity_range— by product price/quantity bucketVariation.upsale/Variation.quantity— upsell flag / sold quantityUTM.p_utm_source/UTM.p_utm_campaign/UTM.p_utm_medium/UTM.p_utm_term/UTM.p_utm_content— by UTM tagPromotion.default/Promotion.advance/Promotion.combo— by promotion / comboAds.ad_id/Ads.ad_set_id/Ads.ad_campaign_id— by ad / ad set / campaign
"Time.hour""Time.day""Time.month""Time.year""Order.source""Order.order_sources""Order.status""Order.warehouse_id""Order.post_id""Order.partner_id""Order.marketplace_id""Order.country_code""Order.province_id""Order.district_id""Order.commune_id""Order.region_filter""Order.tag""Order.is_wholesale""Order.is_livestream""Order.livestream_manager_ids""Order.total_price""Order.ads_or_normal""Order.ad_account_id""Order.ad_id""User.id""User.sale_group""User.department_id""Customer.id""Customer.level_id""Customer.new""Variation.id""Variation.product_id""Variation.category""Variation.supplier""Variation.brand_id""Variation.tag""Variation.price_range""Variation.quantity_range""Variation.upsale""Variation.quantity""UTM.p_utm_source""UTM.p_utm_campaign""UTM.p_utm_medium""UTM.p_utm_term""UTM.p_utm_content""Promotion.default""Promotion.advance""Promotion.combo""Ads.ad_id""Ads.ad_set_id""Ads.ad_campaign_id"filterobjectFilter applied to the order set. Object keyed by <Table>.<field>; each value is an array of strings.
Append _exclude to a key to negate it (e.g. Order.status_exclude, Variation.category_exclude).
Append _and to AND-combine multi-valued list filters (e.g. Variation.tags_and).
Common keys:
Variation.id/Variation.product_id— by variation / productVariation.category/Variation.supplier/Variation.brand_id/Variation.brand— by product taxonomyVariation.tag/Variation.tags/Variation.attribute— by product tag / attributeVariation.price_range/Variation.quantity_range/Variation.quantity— by product price/quantityVariation.upsale/Variation.one_time_product/Variation.is_bonus_product/Variation.product_price_of_zero/Variation.unlink_ecommerce— flag filtersOrder.source/Order.source_exclude/Order.order_sources— order sourceOrder.status— order status codeOrder.warehouse_id/Order.post_id/Order.partner_id/Order.shop_partner_id/Order.marketplace_id— operational filtersOrder.country_code/Order.province_id/Order.district_id/Order.commune_id/Order.region_filter/Order.region_filter_phil— shipping geographyOrder.tag/Order.is_wholesale/Order.is_livestream/Order.received_at_shop/Order.is_upsale_order— order flagsOrder.total_price/Order.revenue— by total/revenue bucketOrder.ad_id/Order.ads_source/Order.ad_account_id/Order.ads_or_normal— ads filtersOrder.order_currency— order currencyOrder.id/Order.project— by order id / projectOrder.p_utm_source/Order.p_utm_campaign/Order.p_utm_medium/Order.p_utm_term/Order.p_utm_content/Order.utm_affiliate/Order.link— UTM filtersOrder.instant/Order.N24H/Order.GSGN— service partner filtersOrder.livestream_manager_id/Order.livestream_manager_ids— livestream managerUser.id/User.sale_group/User.department_id/User.pke_mkter/User.assigning_seller_id/User.assigning_care_id/User.item_assign_seller_id— staff filtersCustomer.id/Customer.level_id/Customer.gender/Customer.tag/Customer.conversation_tags/Customer.new/Customer.referral_code— customer filtersPromotion.default/Promotion.advance/Promotion.id/Promotion.combo— promotion filters
success_statusstringSuccess status
success_recordstringSuccess record
user_typestringUser type
returned_recordstringReturned record
select_fields[]array<string>Select fields
Responses
dataarray<object>Statistics data
successbooleanSuccess status
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/analytics/sale?api_key=API_KEY"{
"success": true,
"data": [
{
"Time.day": "2020-07-22",
"returned": null,
"success": {
"cod": 1710000,
"discount": 0,
"order_count": 3,
"price": 1800000,
"product_count": 18,
"shipping_fee": 0,
"custom_formula_d6ae-ad02-be3d-b26e-3f65-d497-33c4": 1000000
}
},
{
"Time.day": "2020-07-27",
"returned": null,
"success": {
"cod": 570000,
"discount": 0,
"order_count": 1,
"price": 600000,
"avg_price": 600000,
"product_count": 6,
"shipping_fee": 0,
"custom_formula_d6ae-ad02-be3d-b26e-3f65-d497-33c4": 1000000
}
},
{
"Time.day": "2020-07-28",
"returned": null,
"success": {
"cod": 5130000,
"discount": 0,
"order_count": 9,
"price": 5400000,
"avg_price": 600000,
"product_count": 54,
"shipping_fee": 0,
"custom_formula_d6ae-ad02-be3d-b26e-3f65-d497-33c4": 1200000
}
},
{
"Time.day": "2020-07-30",
"returned": null,
"success": {
"cod": 570000,
"discount": 0,
"order_count": 1,
"price": 600000,
"avg_price": 600000,
"product_count": 6,
"shipping_fee": 0,
"custom_formula_d6ae-ad02-be3d-b26e-3f65-d497-33c4": 1200000
}
}
]
}List of customized formulas
/shops/{SHOP_ID}/analytics/get_list_formulaGet list of customized formulas
Path parameters
SHOP_IDintegerrequiredShop ID
Responses
dataarray<object>List of formulas
successbooleanSuccess status
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/analytics/get_list_formula?api_key=API_KEY"{
"success": true,
"data": [
{
"formula": "{price} - {shipping_fee}",
"id": "0ea7-bc72-ae51-0769-a7c9-ca34-fff6",
"name": "tien hang - phi ship",
"unit": "currency"
},
{
"formula": "{revenue} + {transfer_money}",
"id": "3db3-72a7-c426-066a-4eed-a63b-be49",
"name": "doanh thu + ck$",
"unit": "currency"
}
]
}List of analytic fields
/shops/{SHOP_ID}/analytics/get_analytic_fieldsGet list of analytic fields
Path parameters
SHOP_IDintegerrequiredShop ID
Responses
dataarray<object>List of analytic fields
successbooleanSuccess status
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/analytics/get_analytic_fields?api_key=API_KEY"{
"success": true,
"data": [
{
"id": "price",
"name": "Tiền hàng"
},
{
"id": "avg_price",
"name": "Giá bán trung bình"
},
{
"id": "shipping_fee",
"name": "Phí VC thu của khách",
"description": "Tiền vận chuyển thu của khách."
},
{
"id": "discount",
"name": "Chiết khấu",
"description": "Tổng số tiền giảm giá trên từng sản phẩm."
},
{
"id": "product_count",
"name": "SL bán thực",
"description": "Hàng bán ra đã trừ SL hoàn/đổi trả"
},
{
"id": "close_rate",
"name": "Tỷ lệ chốt",
"description": "Số đơn chốt / (Tổng số đơn - SL đơn xoá)."
},
{
"id": "commissions",
"name": "Hoa hồng",
"description": "Hoa hồng cho nhân viên, có thể cài đặt trong phần cấu hình."
}
]
}List of custom statistic folders
/shops/{SHOP_ID}/statistic_custom/foldersGet list of custom statistic folders and their report items (folder_items). Each folder groups related custom reports configured for the shop (e.g. revenue, orders, products, finance, debts).
Path parameters
SHOP_IDintegerrequiredShop ID
Responses
successbooleanSuccess status
foldersarray<object>List of custom statistic folders
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/statistic_custom/folders?api_key=API_KEY"{
"success": true,
"folders": [
{
"name": "OtherReports",
"label": "Báo cáo khác",
"order": -1,
"shop_id": 4,
"creator_id": null,
"last_editor_id": null,
"can_remove": false,
"is_removed": null,
"setting": null,
"total_price_ranges": null,
"inserted_at": "2024-02-26T08:21:01",
"updated_at": "2024-02-26T08:21:01",
"folder_items": [
{
"id": "9d80f8b9-1c68-4026-81e6-70ed2381d360",
"name": "pages.shop.statistic.salesStatistics",
"label": "Doanh số",
"description": null,
"folder_name": "employee",
"parent_id": null,
"order": 0,
"shop_id": 4,
"creator_id": null,
"last_editor_id": null,
"can_remove": false,
"is_removed": null,
"attributes": null,
"fields": [
"total_order_count",
"order_count",
"price",
"shipping_fee",
"discount",
"capital",
"product_count"
],
"filter": null,
"children": [],
"charts": null,
"compare_ranges": {
"chart": "bar-chart",
"field": "product_count",
"ranges": [
{
"range": "7"
},
{
"range": "-7"
}
]
},
"fill_color": false,
"setting": {
"returned_record": "success_record",
"success_record": "inserted_at",
"success_status": 0,
"user_type": "assign"
},
"sort_by_field": null,
"time_range": [
"90"
],
"users_can_see": null,
"inserted_at": "2024-02-26T08:21:01",
"updated_at": "2024-02-26T08:21:01"
}
]
},
{
"name": "Revenue",
"label": "Báo cáo doanh thu",
"order": 1,
"shop_id": 4,
"creator_id": null,
"last_editor_id": null,
"can_remove": false,
"is_removed": null,
"setting": null,
"total_price_ranges": null,
"inserted_at": "2023-09-20T03:01:25",
"updated_at": "2023-09-20T03:01:25",
"folder_items": [
{
"id": "9783d2e9-d973-4f6f-a735-f5883f4e678f",
"name": "commons.time",
"label": "Thời gian",
"description": null,
"folder_name": "Revenue",
"parent_id": null,
"order": 0,
"shop_id": 4,
"creator_id": null,
"last_editor_id": null,
"can_remove": false,
"is_removed": null,
"attributes": [
"Variation.product_id"
],
"fields": [
"success_order_count",
"returned_order_count",
"price",
"sales",
"revenue",
"capital",
"profit"
],
"filter": [],
"children": [],
"charts": [
{
"field": "success_order_count",
"top": "all",
"type": "bar-chart",
"width": 100
}
],
"compare_ranges": {
"chart": "bar-chart",
"field": "profit",
"ranges": [
{
"range": "7"
},
{
"range": "-7"
}
]
},
"fill_color": false,
"setting": {
"returned_record": "success_record",
"success_record": "updated_at",
"success_status": 1,
"user_type": "update"
},
"sort_by_field": {
"multi": [
{
"columnKey": "product_count",
"field": "product_count",
"order": "descend"
}
]
},
"time_range": [
"30"
],
"users_can_see": null,
"inserted_at": "2023-09-20T03:01:25",
"updated_at": "2026-05-05T04:33:58"
}
]
}
]
}