/owner/products/products_profit, which backs 4 cards on the Sales Reports tab. type chooses the card.reports/ for grouping only. This report comes from the Product Sales Profit screen rather than the report pages, but shares the reports/ prefix so the five read as one family.meta.currency names the account base currency, and every figure is already converted into it.sort. Key off rows[].key.refunds_amount is absolute per row but signed in the total, sales_qty totals the undivided quantities while the rows show them divided by the multi-unit factor, and profit_pct_of_total in the total is 100 / (rows with non-zero net sales) rather than the column's sum. These reproduce the page and are not defects in the API.| Bound | Default | Applies to |
|---|---|---|
max_products_profit_rows | 7000 | groups in the response |
| list length | 200 | product_id, staff_id, branch_id |
400, not a truncated report. Defaults are per-deployment configuration and can differ between accounts.curl --location '/api2/reports/products_profit?type=&date_range_selector=&date_range_from=&date_range_to=&category=&item_group_id=&product_id=&brand=&supplier_id=&staff_id=&branch_id=' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json'{
"result": "successful",
"code": 200,
"data": {
"report": {
"key": "products_profit",
"type": "product",
"group_dimension": "product",
"title": "string"
},
"filters": {
"type": "product",
"date_range_selector": "lastmonth",
"date_range_from": "2019-08-24",
"date_range_to": "2019-08-24",
"category": 0,
"item_group_id": "string",
"product_id": [
0
],
"brand": "string",
"supplier_id": 0,
"staff_id": [
0
],
"branch_id": [
0
]
},
"columns": [
{
"key": "string",
"label": "string"
}
],
"rows": [
{
"key": "string",
"label": "string",
"id": 0,
"sales_qty": 0,
"sales_amount": 0,
"refunds_qty": 0,
"refunds_amount": 0,
"net_qty": 0,
"net_amount": 0,
"cost": 0,
"profit": 0,
"profit_pct_of_total": 0,
"profit_pct_to_sales": 0,
"profit_pct_to_cost": 0,
"supplier_name": "string",
"unit_factor": {
"factor": 0,
"name": "string"
}
}
],
"totals": {
"sales_qty": 0,
"sales_amount": 0,
"refunds_qty": 0,
"refunds_amount": 0,
"net_qty": 0,
"net_amount": 0,
"cost": 0,
"profit": 0,
"profit_pct_of_total": 0,
"profit_pct_to_sales": 0,
"profit_pct_to_cost": 0
},
"meta": {
"row_count": 0,
"currency": "string",
"calculation_method": "average",
"multi_units_enabled": true,
"supplier_column_available": true
}
}
}