Report
INFO
Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.
POST /summary/chart-pagin
Report summary chart paging
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number (int32) | Yes | Page number for pagination. |
limit | number (int32) | Yes | Maximum number of items to return for pagination. |
sale_type | string | No | Type of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade |
from_date | string (date-time) | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
to_date | string (date-time) | No | End date for the report in ISO 8601 format. Optional for GET requests. |
custom | boolean | No | Indicates if custom time ranges are used. Optional for GET requests. |
from_time | integer (int32) | Yes | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
to_time | integer (int32) | Yes | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
organizations | string (mongo-id)[] | No | List of organization IDs. Optional for GET requests. |
employees | string (mongo-id)[] | No | List of employee IDs. Optional for GET requests. |
divider | string | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day" |
field | string | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales" |
organization_id | string (mongo-id) | No | ID of the organization. |
sort_by | string | No | Field to sort the results by. |
price_id | string (mongo-id) | No | ID of the price list. |
category_id | string (mongo-id) | No | ID of the product category. |
customer_category_id | string (mongo-id) | No | ID of the customer category. |
supplier_id | string (mongo-id) | No | ID of the supplier. |
supplier_category_id | string (mongo-id) | No | ID of the supplier category. |
asc | integer | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1 |
cashbox_id | string (mongo-id) | No | ID of the cashbox. |
income_type | string | No | Type of income for the report.. One of: product_income, material_income |
product_id | string (mongo-id) | No | ID of the product. |
customer_id | string (mongo-id) | No | ID of the customer. |
date_from | string (date-time) | No | Start date for the report in ISO 8601 format. |
date_to | string (date-time) | No | End date for the report in ISO 8601 format. |
sort | object | No | Sorting parameters for the report. |
sort.name | integer | No | Sort order for 'name' field: 1 for ascending, -1 for descending.. One of: 1, -1 |
report_by | string | No | Criteria to report employees by.. One of: created_by, responsible |
is_product | boolean | No | Indicates if the report includes products. |
is_material | boolean | No | Indicates if the report includes materials. |
is_semi_product | boolean | No | Indicates if the report includes semi-products. |
search | string | No | Search string for filtering results. Optional. |
trade_state | string | No | Current state of the trade.. One of: new, draft, in_progress, canceled, done |
trade_states | string[] | No | List of trade states to filter by. |
type | string | No | Type of summary report.. One of: product, customer, employee, payment, category |
state | string | No | State of the income.. One of: canceled, done |
min_items_sold | number (int32) | No | Minimum number of items sold. |
min_gross_sales | number (float) | No | Minimum gross sales amount. |
json
{
"page": 0,
"limit": 0,
"sale_type": "receipt",
"from_date": "2025-05-01T12:00:00Z",
"to_date": "2025-05-01T12:00:00Z",
"custom": false,
"from_time": 0,
"to_time": 0,
"organizations": [
"string"
],
"employees": [
"string"
],
"divider": "hour",
"field": "gross_sales",
"organization_id": "string",
"sort_by": "string",
"price_id": "string",
"category_id": "string",
"customer_category_id": "string",
"supplier_id": "string",
"supplier_category_id": "string",
"asc": 1,
"cashbox_id": "string",
"income_type": "product_income",
"product_id": "string",
"customer_id": "string",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z",
"sort": {
"name": 1
},
"report_by": "created_by",
"is_product": false,
"is_material": false,
"is_semi_product": false,
"search": "string",
"trade_state": "new",
"trade_states": [
"new"
],
"type": "product",
"state": "canceled",
"min_items_sold": 0,
"min_gross_sales": 0
}Response
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"date": "2025-05-01T12:00:00Z",
"_id": {
"year": 0,
"month": 0,
"day": 0
},
"gross_sales": 0,
"refund": 0,
"discount": 0,
"gift": 0,
"tax": 0,
"cost": 0,
"net_sales": 0,
"profit": 0,
"included_tax": 0,
"added_tax": 0,
"receipts": 0,
"refunds": 0,
"items_sold": 0,
"items_refunded": 0,
"average_receipt": 0
}
],
"time": "2025-05-01T12:00:00Z"
}POST /summary/chart
Report summary chart
Request body
| Field | Type | Required | Description |
|---|---|---|---|
sale_type | string | No | Type of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade |
from_date | string (date-time) | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
to_date | string (date-time) | No | End date for the report in ISO 8601 format. Optional for GET requests. |
custom | boolean | No | Indicates if custom time ranges are used. Optional for GET requests. |
from_time | integer (int32) | Yes | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
to_time | integer (int32) | Yes | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
organizations | string (mongo-id)[] | No | List of organization IDs. Optional for GET requests. |
employees | string (mongo-id)[] | No | List of employee IDs. Optional for GET requests. |
divider | string | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day" |
field | string | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales" |
organization_id | string (mongo-id) | No | ID of the organization. |
sort_by | string | No | Field to sort the results by. |
price_id | string (mongo-id) | No | ID of the price list. |
category_id | string (mongo-id) | No | ID of the product category. |
customer_category_id | string (mongo-id) | No | ID of the customer category. |
supplier_id | string (mongo-id) | No | ID of the supplier. |
supplier_category_id | string (mongo-id) | No | ID of the supplier category. |
asc | integer | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1 |
cashbox_id | string (mongo-id) | No | ID of the cashbox. |
income_type | string | No | Type of income for the report.. One of: product_income, material_income |
report_by | string | No | Criteria to report employees by.. One of: created_by, responsible |
search | string | No | Search string for filtering results. Optional. |
type | string | No | Type of summary report.. One of: product, customer, employee, payment, category |
json
{
"sale_type": "receipt",
"from_date": "2025-05-01T12:00:00Z",
"to_date": "2025-05-01T12:00:00Z",
"custom": false,
"from_time": 0,
"to_time": 0,
"organizations": [
"string"
],
"employees": [
"string"
],
"divider": "hour",
"field": "gross_sales",
"organization_id": "string",
"sort_by": "string",
"price_id": "string",
"category_id": "string",
"customer_category_id": "string",
"supplier_id": "string",
"supplier_category_id": "string",
"asc": 1,
"cashbox_id": "string",
"income_type": "product_income",
"report_by": "created_by",
"search": "string",
"type": "product"
}Response
| Field | Type | Description |
|---|---|---|
total | object | Total aggregated sales data for the current period. |
total.gross_sales | number (float) | Total gross sales. |
total.refund | number (float) | Total refunds. |
total.discount | number (float) | Total discounts applied. |
total.gift | number (float) | Total value of gifts. |
total.tax | number (float) | Total tax amount. |
total.included_tax | number (float) | Total included tax. |
total.added_tax | number (float) | Total added tax. |
total.cost | number (float) | Total cost of goods sold. |
total.net_sales | number (float) | Total net sales. |
total.profit | number (float) | Total profit. |
total.receipts | integer | Total number of receipts. |
total.items_sold | integer | Total number of items sold. |
total.refunds | integer | Total number of refunds. |
total_prev | object | Total aggregated sales data for the previous period. |
total_prev.gross_sales | number (float) | Total gross sales for the previous period. |
total_prev.refund | number (float) | Total refunds for the previous period. |
total_prev.discount | number (float) | Total discounts applied for the previous period. |
total_prev.gift | number (float) | Total value of gifts for the previous period. |
total_prev.tax | number (float) | Total tax amount for the previous period. |
total_prev.included_tax | number (float) | Total included tax for the previous period. |
total_prev.added_tax | number (float) | Total added tax for the previous period. |
total_prev.cost | number (float) | Total cost of goods sold for the previous period. |
total_prev.net_sales | number (float) | Total net sales for the previous period. |
total_prev.profit | number (float) | Total profit for the previous period. |
total_prev.receipts | integer | Total number of receipts for the previous period. |
total_prev.items_sold | integer | Total number of items sold for the previous period. |
total_prev.refunds | integer | Total number of refunds for the previous period. |
chart | object[] | Data points for the sales chart. |
chart[].date | string (date-time) | Date of the chart data point. |
chart[].value | number (float) | The value for the chart data point (e.g., gross sales). |
plan | object | Sales plan data, can be null. |
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": {
"gross_sales": 0,
"refund": 0,
"discount": 0,
"gift": 0,
"tax": 0,
"included_tax": 0,
"added_tax": 0,
"cost": 0,
"net_sales": 0,
"profit": 0,
"receipts": 0,
"items_sold": 0,
"refunds": 0
},
"total_prev": {
"gross_sales": 0,
"refund": 0,
"discount": 0,
"gift": 0,
"tax": 0,
"included_tax": 0,
"added_tax": 0,
"cost": 0,
"net_sales": 0,
"profit": 0,
"receipts": 0,
"items_sold": 0,
"refunds": 0
},
"chart": [
{
"date": "2025-05-01T12:00:00Z",
"value": 0
}
],
"plan": {}
},
"time": "2025-05-01T12:00:00Z"
}POST /summary/income/chart
Report summary income chart
Request body
| Field | Type | Required | Description |
|---|---|---|---|
sale_type | string | No | Type of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade |
from_date | string (date-time) | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
to_date | string (date-time) | No | End date for the report in ISO 8601 format. Optional for GET requests. |
custom | boolean | No | Indicates if custom time ranges are used. Optional for GET requests. |
from_time | integer (int32) | Yes | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
to_time | integer (int32) | Yes | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
organizations | string (mongo-id)[] | No | List of organization IDs. Optional for GET requests. |
employees | string (mongo-id)[] | No | List of employee IDs. Optional for GET requests. |
divider | string | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day" |
field | string | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales" |
organization_id | string (mongo-id) | No | ID of the organization. |
sort_by | string | No | Field to sort the results by. |
price_id | string (mongo-id) | No | ID of the price list. |
category_id | string (mongo-id) | No | ID of the product category. |
customer_category_id | string (mongo-id) | No | ID of the customer category. |
supplier_id | string (mongo-id) | No | ID of the supplier. |
supplier_category_id | string (mongo-id) | No | ID of the supplier category. |
asc | integer | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1 |
cashbox_id | string (mongo-id) | No | ID of the cashbox. |
income_type | string | No | Type of income for the report.. One of: product_income, material_income |
report_by | string | No | Criteria to report employees by.. One of: created_by, responsible |
search | string | No | Search string for filtering results. Optional. |
type | string | No | Type of summary report.. One of: product, customer, employee, payment, category |
json
{
"sale_type": "receipt",
"from_date": "2025-05-01T12:00:00Z",
"to_date": "2025-05-01T12:00:00Z",
"custom": false,
"from_time": 0,
"to_time": 0,
"organizations": [
"string"
],
"employees": [
"string"
],
"divider": "hour",
"field": "gross_sales",
"organization_id": "string",
"sort_by": "string",
"price_id": "string",
"category_id": "string",
"customer_category_id": "string",
"supplier_id": "string",
"supplier_category_id": "string",
"asc": 1,
"cashbox_id": "string",
"income_type": "product_income",
"report_by": "created_by",
"search": "string",
"type": "product"
}Response
| Field | Type | Description |
|---|---|---|
chart | object[] | An array of data points for the chart, typically representing values over time. |
chart[].date | string (date-time) | The date and time for the chart data point in ISO 8601 format. |
chart[].value | number (float) | The numerical value for the given date. |
total | object | Aggregated total data for the report. |
total.total | number (float) | The grand total amount. |
total.data | object[] | An array containing details of various payment types and their amounts. |
total.data[]._id | string (mongo-id) | The unique identifier for the payment type. |
total.data[].payment_type | object | Details of the payment type. |
total.data[].amount | number (float) | The amount associated with this payment type. |
divider | string | The time unit by which the data is divided in the chart (e.g., 'week'). |
currency | object | Information about the currency used in the report. |
currency._id | string (mongo-id) | The unique identifier for the currency. |
currency.name | string | The name of the currency (e.g., 'US Dollar'). |
currency.symbol | string | The symbol of the currency (e.g., '$'). |
currency.side | string | Indicates where the currency symbol should be placed ('start' or 'end'). |
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"chart": [
{
"date": "2025-05-01T12:00:00Z",
"value": 0
}
],
"total": {
"total": 0,
"data": [
{
"_id": null,
"payment_type": null,
"amount": null
}
]
},
"divider": "string",
"currency": {
"_id": "string",
"name": "string",
"symbol": "string",
"side": "string"
}
},
"time": "2025-05-01T12:00:00Z"
}POST /summary/expense/chart
Report summary expense chart
Request body
| Field | Type | Required | Description |
|---|---|---|---|
sale_type | string | No | Type of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade |
from_date | string (date-time) | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
to_date | string (date-time) | No | End date for the report in ISO 8601 format. Optional for GET requests. |
custom | boolean | No | Indicates if custom time ranges are used. Optional for GET requests. |
from_time | integer (int32) | Yes | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
to_time | integer (int32) | Yes | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
organizations | string (mongo-id)[] | No | List of organization IDs. Optional for GET requests. |
employees | string (mongo-id)[] | No | List of employee IDs. Optional for GET requests. |
divider | string | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day" |
field | string | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales" |
organization_id | string (mongo-id) | No | ID of the organization. |
sort_by | string | No | Field to sort the results by. |
price_id | string (mongo-id) | No | ID of the price list. |
category_id | string (mongo-id) | No | ID of the product category. |
customer_category_id | string (mongo-id) | No | ID of the customer category. |
supplier_id | string (mongo-id) | No | ID of the supplier. |
supplier_category_id | string (mongo-id) | No | ID of the supplier category. |
asc | integer | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1 |
cashbox_id | string (mongo-id) | No | ID of the cashbox. |
income_type | string | No | Type of income for the report.. One of: product_income, material_income |
report_by | string | No | Criteria to report employees by.. One of: created_by, responsible |
search | string | No | Search string for filtering results. Optional. |
type | string | No | Type of summary report.. One of: product, customer, employee, payment, category |
json
{
"sale_type": "receipt",
"from_date": "2025-05-01T12:00:00Z",
"to_date": "2025-05-01T12:00:00Z",
"custom": false,
"from_time": 0,
"to_time": 0,
"organizations": [
"string"
],
"employees": [
"string"
],
"divider": "hour",
"field": "gross_sales",
"organization_id": "string",
"sort_by": "string",
"price_id": "string",
"category_id": "string",
"customer_category_id": "string",
"supplier_id": "string",
"supplier_category_id": "string",
"asc": 1,
"cashbox_id": "string",
"income_type": "product_income",
"report_by": "created_by",
"search": "string",
"type": "product"
}Response
| Field | Type | Description |
|---|---|---|
chart | object[] | Historical data points for the report, typically representing values over time. |
chart[].date | string (date-time) | The date and time for the data point in ISO 8601 format. |
chart[].value | number (float) | The numerical value for the given date. |
total | object | Aggregated total data for the report. |
total.total | number (float) | The grand total amount. |
total.data | object[] | An array containing details of various payment types and their amounts. |
total.data[]._id | string (mongo-id) | The unique identifier for the payment type. |
total.data[].payment_type | object | Details of the payment type. |
total.data[].amount | number (float) | The amount associated with this payment type. |
divider | string | The time unit by which the data is divided in the chart (e.g., 'day'). |
currency | object | Information about the currency used in the report. |
currency._id | string (mongo-id) | The unique identifier for the currency. |
currency.name | string | The name of the currency (e.g., 'usd'). |
currency.symbol | string | The symbol of the currency (e.g., '$'). |
currency.side | string | Indicates where the currency symbol should be placed ('start' or 'end'). |
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"chart": [
{
"date": "2025-05-01T12:00:00Z",
"value": 0
}
],
"total": {
"total": 0,
"data": [
{
"_id": null,
"payment_type": null,
"amount": null
}
]
},
"divider": "string",
"currency": {
"_id": "string",
"name": "string",
"symbol": "string",
"side": "string"
}
},
"time": "2025-05-01T12:00:00Z"
}POST /sales/by-item-pagin
Report summary by-item-pagin
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number (int32) | Yes | Page number for pagination. |
limit | number (int32) | Yes | Maximum number of items to return for pagination. |
sale_type | string | No | Type of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade |
from_date | string (date-time) | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
to_date | string (date-time) | No | End date for the report in ISO 8601 format. Optional for GET requests. |
custom | boolean | No | Indicates if custom time ranges are used. Optional for GET requests. |
from_time | integer (int32) | Yes | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
to_time | integer (int32) | Yes | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
organizations | string (mongo-id)[] | No | List of organization IDs. Optional for GET requests. |
employees | string (mongo-id)[] | No | List of employee IDs. Optional for GET requests. |
divider | string | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day" |
field | string | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales" |
organization_id | string (mongo-id) | No | ID of the organization. |
sort_by | string | No | Field to sort the results by. |
price_id | string (mongo-id) | No | ID of the price list. |
category_id | string (mongo-id) | No | ID of the product category. |
customer_category_id | string (mongo-id) | No | ID of the customer category. |
supplier_id | string (mongo-id) | No | ID of the supplier. |
supplier_category_id | string (mongo-id) | No | ID of the supplier category. |
asc | integer | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1 |
cashbox_id | string (mongo-id) | No | ID of the cashbox. |
income_type | string | No | Type of income for the report.. One of: product_income, material_income |
product_id | string (mongo-id) | No | ID of the product. |
customer_id | string (mongo-id) | No | ID of the customer. |
date_from | string (date-time) | No | Start date for the report in ISO 8601 format. |
date_to | string (date-time) | No | End date for the report in ISO 8601 format. |
sort | object | No | Sorting parameters for the report. |
sort.name | integer | No | Sort order for 'name' field: 1 for ascending, -1 for descending.. One of: 1, -1 |
report_by | string | No | Criteria to report employees by.. One of: created_by, responsible |
is_product | boolean | No | Indicates if the report includes products. |
is_material | boolean | No | Indicates if the report includes materials. |
is_semi_product | boolean | No | Indicates if the report includes semi-products. |
search | string | No | Search string for filtering results. Optional. |
trade_state | string | No | Current state of the trade.. One of: new, draft, in_progress, canceled, done |
trade_states | string[] | No | List of trade states to filter by. |
type | string | No | Type of summary report.. One of: product, customer, employee, payment, category |
state | string | No | State of the income.. One of: canceled, done |
min_items_sold | number (int32) | No | Minimum number of items sold. |
min_gross_sales | number (float) | No | Minimum gross sales amount. |
json
{
"page": 0,
"limit": 0,
"sale_type": "receipt",
"from_date": "2025-05-01T12:00:00Z",
"to_date": "2025-05-01T12:00:00Z",
"custom": false,
"from_time": 0,
"to_time": 0,
"organizations": [
"string"
],
"employees": [
"string"
],
"divider": "hour",
"field": "gross_sales",
"organization_id": "string",
"sort_by": "string",
"price_id": "string",
"category_id": "string",
"customer_category_id": "string",
"supplier_id": "string",
"supplier_category_id": "string",
"asc": 1,
"cashbox_id": "string",
"income_type": "product_income",
"product_id": "string",
"customer_id": "string",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z",
"sort": {
"name": 1
},
"report_by": "created_by",
"is_product": false,
"is_material": false,
"is_semi_product": false,
"search": "string",
"trade_state": "new",
"trade_states": [
"new"
],
"type": "product",
"state": "canceled",
"min_items_sold": 0,
"min_gross_sales": 0
}Response
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"date": "2025-05-01T12:00:00Z",
"product_id": "string",
"category_id": "string",
"gross_sales": 0,
"refund": 0,
"discount": 0,
"gift": 0,
"tax": 0,
"included_tax": 0,
"added_tax": 0,
"cost": 0,
"net_sales": 0,
"profit": 0,
"items_sold": 0,
"items_refunded": 0,
"product_name": "string",
"dimension": {
"shape": "string",
"netto_weight": 0,
"gross_weight": 0,
"height": 0,
"volume": 0,
"diameter": 0,
"width": 0,
"length": 0,
"_id": "string"
},
"measure": {
"system_code": "string",
"code": "string",
"short_name": "string",
"name": "string",
"decimal_count": 0,
"_id": "string"
},
"category_name": "string"
}
],
"time": "2025-05-01T12:00:00Z"
}POST /sales/by-item
Report summary by-item
Request body
| Field | Type | Required | Description |
|---|---|---|---|
sale_type | string | No | Type of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade |
from_date | string (date-time) | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
to_date | string (date-time) | No | End date for the report in ISO 8601 format. Optional for GET requests. |
custom | boolean | No | Indicates if custom time ranges are used. Optional for GET requests. |
from_time | integer (int32) | Yes | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
to_time | integer (int32) | Yes | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
organizations | string (mongo-id)[] | No | List of organization IDs. Optional for GET requests. |
employees | string (mongo-id)[] | No | List of employee IDs. Optional for GET requests. |
divider | string | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day" |
field | string | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales" |
organization_id | string (mongo-id) | No | ID of the organization. |
sort_by | string | No | Field to sort the results by. |
price_id | string (mongo-id) | No | ID of the price list. |
category_id | string (mongo-id) | No | ID of the product category. |
customer_category_id | string (mongo-id) | No | ID of the customer category. |
supplier_id | string (mongo-id) | No | ID of the supplier. |
supplier_category_id | string (mongo-id) | No | ID of the supplier category. |
asc | integer | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1 |
cashbox_id | string (mongo-id) | No | ID of the cashbox. |
income_type | string | No | Type of income for the report.. One of: product_income, material_income |
report_by | string | No | Criteria to report employees by.. One of: created_by, responsible |
search | string | No | Search string for filtering results. Optional. |
type | string | No | Type of summary report.. One of: product, customer, employee, payment, category |
json
{
"sale_type": "receipt",
"from_date": "2025-05-01T12:00:00Z",
"to_date": "2025-05-01T12:00:00Z",
"custom": false,
"from_time": 0,
"to_time": 0,
"organizations": [
"string"
],
"employees": [
"string"
],
"divider": "hour",
"field": "gross_sales",
"organization_id": "string",
"sort_by": "string",
"price_id": "string",
"category_id": "string",
"customer_category_id": "string",
"supplier_id": "string",
"supplier_category_id": "string",
"asc": 1,
"cashbox_id": "string",
"income_type": "product_income",
"report_by": "created_by",
"search": "string",
"type": "product"
}Response
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"product": {
"name": "string",
"sku": "string"
},
"net_sales": 0,
"chart": [
{
"date": null,
"value": null
}
]
}
],
"time": "2025-05-01T12:00:00Z"
}POST /sales/by-customer-pagin
Report summary by-customer-pagin
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number (int32) | Yes | Page number for pagination. |
limit | number (int32) | Yes | Maximum number of items to return for pagination. |
sale_type | string | No | Type of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade |
from_date | string (date-time) | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
to_date | string (date-time) | No | End date for the report in ISO 8601 format. Optional for GET requests. |
custom | boolean | No | Indicates if custom time ranges are used. Optional for GET requests. |
from_time | integer (int32) | Yes | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
to_time | integer (int32) | Yes | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
organizations | string (mongo-id)[] | No | List of organization IDs. Optional for GET requests. |
employees | string (mongo-id)[] | No | List of employee IDs. Optional for GET requests. |
divider | string | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day" |
field | string | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales" |
organization_id | string (mongo-id) | No | ID of the organization. |
sort_by | string | No | Field to sort the results by. |
price_id | string (mongo-id) | No | ID of the price list. |
category_id | string (mongo-id) | No | ID of the product category. |
customer_category_id | string (mongo-id) | No | ID of the customer category. |
supplier_id | string (mongo-id) | No | ID of the supplier. |
supplier_category_id | string (mongo-id) | No | ID of the supplier category. |
asc | integer | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1 |
cashbox_id | string (mongo-id) | No | ID of the cashbox. |
income_type | string | No | Type of income for the report.. One of: product_income, material_income |
product_id | string (mongo-id) | No | ID of the product. |
customer_id | string (mongo-id) | No | ID of the customer. |
date_from | string (date-time) | No | Start date for the report in ISO 8601 format. |
date_to | string (date-time) | No | End date for the report in ISO 8601 format. |
sort | object | No | Sorting parameters for the report. |
sort.name | integer | No | Sort order for 'name' field: 1 for ascending, -1 for descending.. One of: 1, -1 |
report_by | string | No | Criteria to report employees by.. One of: created_by, responsible |
is_product | boolean | No | Indicates if the report includes products. |
is_material | boolean | No | Indicates if the report includes materials. |
is_semi_product | boolean | No | Indicates if the report includes semi-products. |
search | string | No | Search string for filtering results. Optional. |
trade_state | string | No | Current state of the trade.. One of: new, draft, in_progress, canceled, done |
trade_states | string[] | No | List of trade states to filter by. |
type | string | No | Type of summary report.. One of: product, customer, employee, payment, category |
state | string | No | State of the income.. One of: canceled, done |
min_items_sold | number (int32) | No | Minimum number of items sold. |
min_gross_sales | number (float) | No | Minimum gross sales amount. |
json
{
"page": 0,
"limit": 0,
"sale_type": "receipt",
"from_date": "2025-05-01T12:00:00Z",
"to_date": "2025-05-01T12:00:00Z",
"custom": false,
"from_time": 0,
"to_time": 0,
"organizations": [
"string"
],
"employees": [
"string"
],
"divider": "hour",
"field": "gross_sales",
"organization_id": "string",
"sort_by": "string",
"price_id": "string",
"category_id": "string",
"customer_category_id": "string",
"supplier_id": "string",
"supplier_category_id": "string",
"asc": 1,
"cashbox_id": "string",
"income_type": "product_income",
"product_id": "string",
"customer_id": "string",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z",
"sort": {
"name": 1
},
"report_by": "created_by",
"is_product": false,
"is_material": false,
"is_semi_product": false,
"search": "string",
"trade_state": "new",
"trade_states": [
"new"
],
"type": "product",
"state": "canceled",
"min_items_sold": 0,
"min_gross_sales": 0
}Response
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"customer_id": "string",
"customer_category_id": "string",
"gross_sales": 0,
"refund": 0,
"discount": 0,
"included_tax": 0,
"added_tax": 0,
"gift": 0,
"net_sales": 0,
"profit": 0,
"receipts": 0,
"refunds": 0,
"sale_contracts": 0,
"customer": {
"_id": "string",
"is_deleted": false,
"is_archived": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"completely_deleted": false,
"type": "string",
"number": "string",
"state": "string",
"name": "string",
"phone_number": "string",
"phone_numbers": [],
"organization_ids": [],
"total_sale": 0,
"avg_sale": 0,
"avg_product": 0,
"total_spent": 0,
"point": 0,
"balance": 0,
"refund": 0,
"queue_status": "string",
"person_id": "string",
"used_count": 0,
"created_from_bot": false,
"balance_action": "string",
"custom_fields": [],
"__v": 0,
"telegram_id": 0,
"locale": "string",
"balance_currency_id": "string",
"balances": {},
"first_sale_at": "2025-05-01T12:00:00Z",
"first_sale_id": "string",
"first_sale_uuid": "string",
"last_sale_at": "2025-05-01T12:00:00Z",
"last_sale_id": "string",
"last_sale_uuid": "string",
"organizations": {},
"updated_by": "string",
"category_id": "string",
"send_notification": false,
"created_by": "string",
"delivery_address": {
"long": null,
"lat": null,
"human_address": null,
"_id": null
},
"responsible_id": "string"
},
"customer_category": {
"_id": "string",
"is_deleted": false,
"is_archived": false,
"created_by": "string",
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"completely_deleted": false,
"name": "string",
"organization_ids": [],
"child_count": 0,
"item_count": 0,
"__v": 0
},
"average_sale": 0
}
],
"time": "2025-05-01T12:00:00Z"
}This page is generated from the OpenAPI spec.