Skip to content

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

FieldTypeRequiredDescription
pagenumber (int32)YesPage number for pagination.
limitnumber (int32)YesMaximum number of items to return for pagination.
sale_typestringNoType of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade
from_datestring (date-time)NoStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)NoEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanNoIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)YesStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)YesEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]NoList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]NoList of employee IDs. Optional for GET requests.
dividerstringNoSpecifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day"
fieldstringNoSpecifies 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_idstring (mongo-id)NoID of the organization.
sort_bystringNoField to sort the results by.
price_idstring (mongo-id)NoID of the price list.
category_idstring (mongo-id)NoID of the product category.
customer_category_idstring (mongo-id)NoID of the customer category.
supplier_idstring (mongo-id)NoID of the supplier.
supplier_category_idstring (mongo-id)NoID of the supplier category.
ascintegerNoSort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1
cashbox_idstring (mongo-id)NoID of the cashbox.
income_typestringNoType of income for the report.. One of: product_income, material_income
product_idstring (mongo-id)NoID of the product.
customer_idstring (mongo-id)NoID of the customer.
date_fromstring (date-time)NoStart date for the report in ISO 8601 format.
date_tostring (date-time)NoEnd date for the report in ISO 8601 format.
sortobjectNoSorting parameters for the report.
sort.nameintegerNoSort order for 'name' field: 1 for ascending, -1 for descending.. One of: 1, -1
report_bystringNoCriteria to report employees by.. One of: created_by, responsible
is_productbooleanNoIndicates if the report includes products.
is_materialbooleanNoIndicates if the report includes materials.
is_semi_productbooleanNoIndicates if the report includes semi-products.
searchstringNoSearch string for filtering results. Optional.
trade_statestringNoCurrent state of the trade.. One of: new, draft, in_progress, canceled, done
trade_statesstring[]NoList of trade states to filter by.
typestringNoType of summary report.. One of: product, customer, employee, payment, category
statestringNoState of the income.. One of: canceled, done
min_items_soldnumber (int32)NoMinimum number of items sold.
min_gross_salesnumber (float)NoMinimum 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

FieldTypeRequiredDescription
sale_typestringNoType of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade
from_datestring (date-time)NoStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)NoEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanNoIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)YesStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)YesEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]NoList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]NoList of employee IDs. Optional for GET requests.
dividerstringNoSpecifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day"
fieldstringNoSpecifies 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_idstring (mongo-id)NoID of the organization.
sort_bystringNoField to sort the results by.
price_idstring (mongo-id)NoID of the price list.
category_idstring (mongo-id)NoID of the product category.
customer_category_idstring (mongo-id)NoID of the customer category.
supplier_idstring (mongo-id)NoID of the supplier.
supplier_category_idstring (mongo-id)NoID of the supplier category.
ascintegerNoSort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1
cashbox_idstring (mongo-id)NoID of the cashbox.
income_typestringNoType of income for the report.. One of: product_income, material_income
report_bystringNoCriteria to report employees by.. One of: created_by, responsible
searchstringNoSearch string for filtering results. Optional.
typestringNoType 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

FieldTypeDescription
totalobjectTotal aggregated sales data for the current period.
total.gross_salesnumber (float)Total gross sales.
total.refundnumber (float)Total refunds.
total.discountnumber (float)Total discounts applied.
total.giftnumber (float)Total value of gifts.
total.taxnumber (float)Total tax amount.
total.included_taxnumber (float)Total included tax.
total.added_taxnumber (float)Total added tax.
total.costnumber (float)Total cost of goods sold.
total.net_salesnumber (float)Total net sales.
total.profitnumber (float)Total profit.
total.receiptsintegerTotal number of receipts.
total.items_soldintegerTotal number of items sold.
total.refundsintegerTotal number of refunds.
total_prevobjectTotal aggregated sales data for the previous period.
total_prev.gross_salesnumber (float)Total gross sales for the previous period.
total_prev.refundnumber (float)Total refunds for the previous period.
total_prev.discountnumber (float)Total discounts applied for the previous period.
total_prev.giftnumber (float)Total value of gifts for the previous period.
total_prev.taxnumber (float)Total tax amount for the previous period.
total_prev.included_taxnumber (float)Total included tax for the previous period.
total_prev.added_taxnumber (float)Total added tax for the previous period.
total_prev.costnumber (float)Total cost of goods sold for the previous period.
total_prev.net_salesnumber (float)Total net sales for the previous period.
total_prev.profitnumber (float)Total profit for the previous period.
total_prev.receiptsintegerTotal number of receipts for the previous period.
total_prev.items_soldintegerTotal number of items sold for the previous period.
total_prev.refundsintegerTotal number of refunds for the previous period.
chartobject[]Data points for the sales chart.
chart[].datestring (date-time)Date of the chart data point.
chart[].valuenumber (float)The value for the chart data point (e.g., gross sales).
planobjectSales 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

FieldTypeRequiredDescription
sale_typestringNoType of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade
from_datestring (date-time)NoStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)NoEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanNoIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)YesStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)YesEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]NoList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]NoList of employee IDs. Optional for GET requests.
dividerstringNoSpecifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day"
fieldstringNoSpecifies 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_idstring (mongo-id)NoID of the organization.
sort_bystringNoField to sort the results by.
price_idstring (mongo-id)NoID of the price list.
category_idstring (mongo-id)NoID of the product category.
customer_category_idstring (mongo-id)NoID of the customer category.
supplier_idstring (mongo-id)NoID of the supplier.
supplier_category_idstring (mongo-id)NoID of the supplier category.
ascintegerNoSort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1
cashbox_idstring (mongo-id)NoID of the cashbox.
income_typestringNoType of income for the report.. One of: product_income, material_income
report_bystringNoCriteria to report employees by.. One of: created_by, responsible
searchstringNoSearch string for filtering results. Optional.
typestringNoType 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

FieldTypeDescription
chartobject[]An array of data points for the chart, typically representing values over time.
chart[].datestring (date-time)The date and time for the chart data point in ISO 8601 format.
chart[].valuenumber (float)The numerical value for the given date.
totalobjectAggregated total data for the report.
total.totalnumber (float)The grand total amount.
total.dataobject[]An array containing details of various payment types and their amounts.
total.data[]._idstring (mongo-id)The unique identifier for the payment type.
total.data[].payment_typeobjectDetails of the payment type.
total.data[].amountnumber (float)The amount associated with this payment type.
dividerstringThe time unit by which the data is divided in the chart (e.g., 'week').
currencyobjectInformation about the currency used in the report.
currency._idstring (mongo-id)The unique identifier for the currency.
currency.namestringThe name of the currency (e.g., 'US Dollar').
currency.symbolstringThe symbol of the currency (e.g., '$').
currency.sidestringIndicates 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

FieldTypeRequiredDescription
sale_typestringNoType of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade
from_datestring (date-time)NoStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)NoEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanNoIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)YesStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)YesEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]NoList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]NoList of employee IDs. Optional for GET requests.
dividerstringNoSpecifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day"
fieldstringNoSpecifies 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_idstring (mongo-id)NoID of the organization.
sort_bystringNoField to sort the results by.
price_idstring (mongo-id)NoID of the price list.
category_idstring (mongo-id)NoID of the product category.
customer_category_idstring (mongo-id)NoID of the customer category.
supplier_idstring (mongo-id)NoID of the supplier.
supplier_category_idstring (mongo-id)NoID of the supplier category.
ascintegerNoSort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1
cashbox_idstring (mongo-id)NoID of the cashbox.
income_typestringNoType of income for the report.. One of: product_income, material_income
report_bystringNoCriteria to report employees by.. One of: created_by, responsible
searchstringNoSearch string for filtering results. Optional.
typestringNoType 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

FieldTypeDescription
chartobject[]Historical data points for the report, typically representing values over time.
chart[].datestring (date-time)The date and time for the data point in ISO 8601 format.
chart[].valuenumber (float)The numerical value for the given date.
totalobjectAggregated total data for the report.
total.totalnumber (float)The grand total amount.
total.dataobject[]An array containing details of various payment types and their amounts.
total.data[]._idstring (mongo-id)The unique identifier for the payment type.
total.data[].payment_typeobjectDetails of the payment type.
total.data[].amountnumber (float)The amount associated with this payment type.
dividerstringThe time unit by which the data is divided in the chart (e.g., 'day').
currencyobjectInformation about the currency used in the report.
currency._idstring (mongo-id)The unique identifier for the currency.
currency.namestringThe name of the currency (e.g., 'usd').
currency.symbolstringThe symbol of the currency (e.g., '$').
currency.sidestringIndicates 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

FieldTypeRequiredDescription
pagenumber (int32)YesPage number for pagination.
limitnumber (int32)YesMaximum number of items to return for pagination.
sale_typestringNoType of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade
from_datestring (date-time)NoStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)NoEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanNoIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)YesStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)YesEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]NoList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]NoList of employee IDs. Optional for GET requests.
dividerstringNoSpecifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day"
fieldstringNoSpecifies 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_idstring (mongo-id)NoID of the organization.
sort_bystringNoField to sort the results by.
price_idstring (mongo-id)NoID of the price list.
category_idstring (mongo-id)NoID of the product category.
customer_category_idstring (mongo-id)NoID of the customer category.
supplier_idstring (mongo-id)NoID of the supplier.
supplier_category_idstring (mongo-id)NoID of the supplier category.
ascintegerNoSort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1
cashbox_idstring (mongo-id)NoID of the cashbox.
income_typestringNoType of income for the report.. One of: product_income, material_income
product_idstring (mongo-id)NoID of the product.
customer_idstring (mongo-id)NoID of the customer.
date_fromstring (date-time)NoStart date for the report in ISO 8601 format.
date_tostring (date-time)NoEnd date for the report in ISO 8601 format.
sortobjectNoSorting parameters for the report.
sort.nameintegerNoSort order for 'name' field: 1 for ascending, -1 for descending.. One of: 1, -1
report_bystringNoCriteria to report employees by.. One of: created_by, responsible
is_productbooleanNoIndicates if the report includes products.
is_materialbooleanNoIndicates if the report includes materials.
is_semi_productbooleanNoIndicates if the report includes semi-products.
searchstringNoSearch string for filtering results. Optional.
trade_statestringNoCurrent state of the trade.. One of: new, draft, in_progress, canceled, done
trade_statesstring[]NoList of trade states to filter by.
typestringNoType of summary report.. One of: product, customer, employee, payment, category
statestringNoState of the income.. One of: canceled, done
min_items_soldnumber (int32)NoMinimum number of items sold.
min_gross_salesnumber (float)NoMinimum 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

FieldTypeRequiredDescription
sale_typestringNoType of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade
from_datestring (date-time)NoStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)NoEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanNoIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)YesStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)YesEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]NoList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]NoList of employee IDs. Optional for GET requests.
dividerstringNoSpecifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day"
fieldstringNoSpecifies 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_idstring (mongo-id)NoID of the organization.
sort_bystringNoField to sort the results by.
price_idstring (mongo-id)NoID of the price list.
category_idstring (mongo-id)NoID of the product category.
customer_category_idstring (mongo-id)NoID of the customer category.
supplier_idstring (mongo-id)NoID of the supplier.
supplier_category_idstring (mongo-id)NoID of the supplier category.
ascintegerNoSort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1
cashbox_idstring (mongo-id)NoID of the cashbox.
income_typestringNoType of income for the report.. One of: product_income, material_income
report_bystringNoCriteria to report employees by.. One of: created_by, responsible
searchstringNoSearch string for filtering results. Optional.
typestringNoType 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

FieldTypeRequiredDescription
pagenumber (int32)YesPage number for pagination.
limitnumber (int32)YesMaximum number of items to return for pagination.
sale_typestringNoType of sale report. Optional for GET requests.. One of: receipt, sale_contract, trade
from_datestring (date-time)NoStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)NoEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanNoIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)YesStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)YesEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]NoList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]NoList of employee IDs. Optional for GET requests.
dividerstringNoSpecifies how data should be divided in the chart. Defaults to 'day'.. One of: hour, day, week, month, quarter, year. Default: "day"
fieldstringNoSpecifies 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_idstring (mongo-id)NoID of the organization.
sort_bystringNoField to sort the results by.
price_idstring (mongo-id)NoID of the price list.
category_idstring (mongo-id)NoID of the product category.
customer_category_idstring (mongo-id)NoID of the customer category.
supplier_idstring (mongo-id)NoID of the supplier.
supplier_category_idstring (mongo-id)NoID of the supplier category.
ascintegerNoSort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: 1, -1. Default: -1
cashbox_idstring (mongo-id)NoID of the cashbox.
income_typestringNoType of income for the report.. One of: product_income, material_income
product_idstring (mongo-id)NoID of the product.
customer_idstring (mongo-id)NoID of the customer.
date_fromstring (date-time)NoStart date for the report in ISO 8601 format.
date_tostring (date-time)NoEnd date for the report in ISO 8601 format.
sortobjectNoSorting parameters for the report.
sort.nameintegerNoSort order for 'name' field: 1 for ascending, -1 for descending.. One of: 1, -1
report_bystringNoCriteria to report employees by.. One of: created_by, responsible
is_productbooleanNoIndicates if the report includes products.
is_materialbooleanNoIndicates if the report includes materials.
is_semi_productbooleanNoIndicates if the report includes semi-products.
searchstringNoSearch string for filtering results. Optional.
trade_statestringNoCurrent state of the trade.. One of: new, draft, in_progress, canceled, done
trade_statesstring[]NoList of trade states to filter by.
typestringNoType of summary report.. One of: product, customer, employee, payment, category
statestringNoState of the income.. One of: canceled, done
min_items_soldnumber (int32)NoMinimum number of items sold.
min_gross_salesnumber (float)NoMinimum 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.

Bito 2.0 Integration API