Skip to content

Report ​

INFO

Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.

POST /summary/chart-pagin ​

Report summary chart paging

Тело запроса

ПолеТипОбязательноОписание
pagenumber (int32)ДаPage number for pagination.
limitnumber (int32)ДаMaximum number of items to return for pagination.
sale_typestringНетType of sale report. Optional for GET requests.. Допустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)НетEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanНетIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)ДаStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)ДаEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]НетList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]НетList of employee IDs. Optional for GET requests.
dividerstringНетSpecifies how data should be divided in the chart. Defaults to 'day'.. Допустимые значения: hour, day, week, month, quarter, year. По умолчанию: "day"
fieldstringНетSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstring (mongo-id)НетID of the organization.
sort_bystringНетField to sort the results by.
price_idstring (mongo-id)НетID of the price list.
category_idstring (mongo-id)НетID of the product category.
customer_category_idstring (mongo-id)НетID of the customer category.
supplier_idstring (mongo-id)НетID of the supplier.
supplier_category_idstring (mongo-id)НетID of the supplier category.
ascintegerНетSort order: 1 for ascending, -1 for descending. Defaults to descending.. Допустимые значения: 1, -1. По умолчанию: -1
cashbox_idstring (mongo-id)НетID of the cashbox.
income_typestringНетType of income for the report.. Допустимые значения: product_income, material_income
product_idstring (mongo-id)НетID of the product.
customer_idstring (mongo-id)НетID of the customer.
date_fromstring (date-time)НетStart date for the report in ISO 8601 format.
date_tostring (date-time)НетEnd date for the report in ISO 8601 format.
sortobjectНетSorting parameters for the report.
sort.nameintegerНетSort order for 'name' field: 1 for ascending, -1 for descending.. Допустимые значения: 1, -1
report_bystringНетCriteria to report employees by.. Допустимые значения: created_by, responsible
is_productbooleanНетIndicates if the report includes products.
is_materialbooleanНетIndicates if the report includes materials.
is_semi_productbooleanНетIndicates if the report includes semi-products.
searchstringНетSearch string for filtering results. Optional.
trade_statestringНетCurrent state of the trade.. Допустимые значения: new, draft, in_progress, canceled, done
trade_statesstring[]НетList of trade states to filter by.
typestringНетType of summary report.. Допустимые значения: product, customer, employee, payment, category
statestringНетState of the income.. Допустимые значения: canceled, done
min_items_soldnumber (int32)НетMinimum number of items sold.
min_gross_salesnumber (float)Нет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
}

Ответ

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

Тело запроса

ПолеТипОбязательноОписание
sale_typestringНетType of sale report. Optional for GET requests.. Допустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)НетEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanНетIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)ДаStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)ДаEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]НетList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]НетList of employee IDs. Optional for GET requests.
dividerstringНетSpecifies how data should be divided in the chart. Defaults to 'day'.. Допустимые значения: hour, day, week, month, quarter, year. По умолчанию: "day"
fieldstringНетSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstring (mongo-id)НетID of the organization.
sort_bystringНетField to sort the results by.
price_idstring (mongo-id)НетID of the price list.
category_idstring (mongo-id)НетID of the product category.
customer_category_idstring (mongo-id)НетID of the customer category.
supplier_idstring (mongo-id)НетID of the supplier.
supplier_category_idstring (mongo-id)НетID of the supplier category.
ascintegerНетSort order: 1 for ascending, -1 for descending. Defaults to descending.. Допустимые значения: 1, -1. По умолчанию: -1
cashbox_idstring (mongo-id)НетID of the cashbox.
income_typestringНетType of income for the report.. Допустимые значения: product_income, material_income
report_bystringНетCriteria to report employees by.. Допустимые значения: created_by, responsible
searchstringНетSearch string for filtering results. Optional.
typestringНетType of summary report.. Допустимые значения: 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"
}

Ответ

ПолеТипОписание
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

Тело запроса

ПолеТипОбязательноОписание
sale_typestringНетType of sale report. Optional for GET requests.. Допустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)НетEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanНетIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)ДаStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)ДаEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]НетList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]НетList of employee IDs. Optional for GET requests.
dividerstringНетSpecifies how data should be divided in the chart. Defaults to 'day'.. Допустимые значения: hour, day, week, month, quarter, year. По умолчанию: "day"
fieldstringНетSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstring (mongo-id)НетID of the organization.
sort_bystringНетField to sort the results by.
price_idstring (mongo-id)НетID of the price list.
category_idstring (mongo-id)НетID of the product category.
customer_category_idstring (mongo-id)НетID of the customer category.
supplier_idstring (mongo-id)НетID of the supplier.
supplier_category_idstring (mongo-id)НетID of the supplier category.
ascintegerНетSort order: 1 for ascending, -1 for descending. Defaults to descending.. Допустимые значения: 1, -1. По умолчанию: -1
cashbox_idstring (mongo-id)НетID of the cashbox.
income_typestringНетType of income for the report.. Допустимые значения: product_income, material_income
report_bystringНетCriteria to report employees by.. Допустимые значения: created_by, responsible
searchstringНетSearch string for filtering results. Optional.
typestringНетType of summary report.. Допустимые значения: 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"
}

Ответ

ПолеТипОписание
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

Тело запроса

ПолеТипОбязательноОписание
sale_typestringНетType of sale report. Optional for GET requests.. Допустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)НетEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanНетIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)ДаStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)ДаEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]НетList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]НетList of employee IDs. Optional for GET requests.
dividerstringНетSpecifies how data should be divided in the chart. Defaults to 'day'.. Допустимые значения: hour, day, week, month, quarter, year. По умолчанию: "day"
fieldstringНетSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstring (mongo-id)НетID of the organization.
sort_bystringНетField to sort the results by.
price_idstring (mongo-id)НетID of the price list.
category_idstring (mongo-id)НетID of the product category.
customer_category_idstring (mongo-id)НетID of the customer category.
supplier_idstring (mongo-id)НетID of the supplier.
supplier_category_idstring (mongo-id)НетID of the supplier category.
ascintegerНетSort order: 1 for ascending, -1 for descending. Defaults to descending.. Допустимые значения: 1, -1. По умолчанию: -1
cashbox_idstring (mongo-id)НетID of the cashbox.
income_typestringНетType of income for the report.. Допустимые значения: product_income, material_income
report_bystringНетCriteria to report employees by.. Допустимые значения: created_by, responsible
searchstringНетSearch string for filtering results. Optional.
typestringНетType of summary report.. Допустимые значения: 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"
}

Ответ

ПолеТипОписание
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

Тело запроса

ПолеТипОбязательноОписание
pagenumber (int32)ДаPage number for pagination.
limitnumber (int32)ДаMaximum number of items to return for pagination.
sale_typestringНетType of sale report. Optional for GET requests.. Допустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)НетEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanНетIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)ДаStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)ДаEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]НетList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]НетList of employee IDs. Optional for GET requests.
dividerstringНетSpecifies how data should be divided in the chart. Defaults to 'day'.. Допустимые значения: hour, day, week, month, quarter, year. По умолчанию: "day"
fieldstringНетSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstring (mongo-id)НетID of the organization.
sort_bystringНетField to sort the results by.
price_idstring (mongo-id)НетID of the price list.
category_idstring (mongo-id)НетID of the product category.
customer_category_idstring (mongo-id)НетID of the customer category.
supplier_idstring (mongo-id)НетID of the supplier.
supplier_category_idstring (mongo-id)НетID of the supplier category.
ascintegerНетSort order: 1 for ascending, -1 for descending. Defaults to descending.. Допустимые значения: 1, -1. По умолчанию: -1
cashbox_idstring (mongo-id)НетID of the cashbox.
income_typestringНетType of income for the report.. Допустимые значения: product_income, material_income
product_idstring (mongo-id)НетID of the product.
customer_idstring (mongo-id)НетID of the customer.
date_fromstring (date-time)НетStart date for the report in ISO 8601 format.
date_tostring (date-time)НетEnd date for the report in ISO 8601 format.
sortobjectНетSorting parameters for the report.
sort.nameintegerНетSort order for 'name' field: 1 for ascending, -1 for descending.. Допустимые значения: 1, -1
report_bystringНетCriteria to report employees by.. Допустимые значения: created_by, responsible
is_productbooleanНетIndicates if the report includes products.
is_materialbooleanНетIndicates if the report includes materials.
is_semi_productbooleanНетIndicates if the report includes semi-products.
searchstringНетSearch string for filtering results. Optional.
trade_statestringНетCurrent state of the trade.. Допустимые значения: new, draft, in_progress, canceled, done
trade_statesstring[]НетList of trade states to filter by.
typestringНетType of summary report.. Допустимые значения: product, customer, employee, payment, category
statestringНетState of the income.. Допустимые значения: canceled, done
min_items_soldnumber (int32)НетMinimum number of items sold.
min_gross_salesnumber (float)Нет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
}

Ответ

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

Тело запроса

ПолеТипОбязательноОписание
sale_typestringНетType of sale report. Optional for GET requests.. Допустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)НетEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanНетIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)ДаStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)ДаEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]НетList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]НетList of employee IDs. Optional for GET requests.
dividerstringНетSpecifies how data should be divided in the chart. Defaults to 'day'.. Допустимые значения: hour, day, week, month, quarter, year. По умолчанию: "day"
fieldstringНетSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstring (mongo-id)НетID of the organization.
sort_bystringНетField to sort the results by.
price_idstring (mongo-id)НетID of the price list.
category_idstring (mongo-id)НетID of the product category.
customer_category_idstring (mongo-id)НетID of the customer category.
supplier_idstring (mongo-id)НетID of the supplier.
supplier_category_idstring (mongo-id)НетID of the supplier category.
ascintegerНетSort order: 1 for ascending, -1 for descending. Defaults to descending.. Допустимые значения: 1, -1. По умолчанию: -1
cashbox_idstring (mongo-id)НетID of the cashbox.
income_typestringНетType of income for the report.. Допустимые значения: product_income, material_income
report_bystringНетCriteria to report employees by.. Допустимые значения: created_by, responsible
searchstringНетSearch string for filtering results. Optional.
typestringНетType of summary report.. Допустимые значения: 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"
}

Ответ

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

Тело запроса

ПолеТипОбязательноОписание
pagenumber (int32)ДаPage number for pagination.
limitnumber (int32)ДаMaximum number of items to return for pagination.
sale_typestringНетType of sale report. Optional for GET requests.. Допустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)НетEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanНетIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)ДаStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)ДаEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]НетList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]НетList of employee IDs. Optional for GET requests.
dividerstringНетSpecifies how data should be divided in the chart. Defaults to 'day'.. Допустимые значения: hour, day, week, month, quarter, year. По умолчанию: "day"
fieldstringНетSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstring (mongo-id)НетID of the organization.
sort_bystringНетField to sort the results by.
price_idstring (mongo-id)НетID of the price list.
category_idstring (mongo-id)НетID of the product category.
customer_category_idstring (mongo-id)НетID of the customer category.
supplier_idstring (mongo-id)НетID of the supplier.
supplier_category_idstring (mongo-id)НетID of the supplier category.
ascintegerНетSort order: 1 for ascending, -1 for descending. Defaults to descending.. Допустимые значения: 1, -1. По умолчанию: -1
cashbox_idstring (mongo-id)НетID of the cashbox.
income_typestringНетType of income for the report.. Допустимые значения: product_income, material_income
product_idstring (mongo-id)НетID of the product.
customer_idstring (mongo-id)НетID of the customer.
date_fromstring (date-time)НетStart date for the report in ISO 8601 format.
date_tostring (date-time)НетEnd date for the report in ISO 8601 format.
sortobjectНетSorting parameters for the report.
sort.nameintegerНетSort order for 'name' field: 1 for ascending, -1 for descending.. Допустимые значения: 1, -1
report_bystringНетCriteria to report employees by.. Допустимые значения: created_by, responsible
is_productbooleanНетIndicates if the report includes products.
is_materialbooleanНетIndicates if the report includes materials.
is_semi_productbooleanНетIndicates if the report includes semi-products.
searchstringНетSearch string for filtering results. Optional.
trade_statestringНетCurrent state of the trade.. Допустимые значения: new, draft, in_progress, canceled, done
trade_statesstring[]НетList of trade states to filter by.
typestringНетType of summary report.. Допустимые значения: product, customer, employee, payment, category
statestringНетState of the income.. Допустимые значения: canceled, done
min_items_soldnumber (int32)НетMinimum number of items sold.
min_gross_salesnumber (float)Нет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
}

Ответ

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"
}

Эта страница сгенерирована из спецификации OpenAPI.

Bito 2.0 Integration API