Skip to content

Report ​

INFO

Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.

POST /summary/chart-pagin ​

Report summary chart paging

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumber (int32)HaPage number for pagination.
limitnumber (int32)HaMaximum number of items to return for pagination.
sale_typestringYo‘qType of sale report. Optional for GET requests.. Mumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)Yo‘qEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanYo‘qIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)HaStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)HaEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]Yo‘qList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]Yo‘qList of employee IDs. Optional for GET requests.
dividerstringYo‘qSpecifies how data should be divided in the chart. Defaults to 'day'.. Mumkin qiymatlar: hour, day, week, month, quarter, year. Standart: "day"
fieldstringYo‘qSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstring (mongo-id)Yo‘qID of the organization.
sort_bystringYo‘qField to sort the results by.
price_idstring (mongo-id)Yo‘qID of the price list.
category_idstring (mongo-id)Yo‘qID of the product category.
customer_category_idstring (mongo-id)Yo‘qID of the customer category.
supplier_idstring (mongo-id)Yo‘qID of the supplier.
supplier_category_idstring (mongo-id)Yo‘qID of the supplier category.
ascintegerYo‘qSort order: 1 for ascending, -1 for descending. Defaults to descending.. Mumkin qiymatlar: 1, -1. Standart: -1
cashbox_idstring (mongo-id)Yo‘qID of the cashbox.
income_typestringYo‘qType of income for the report.. Mumkin qiymatlar: product_income, material_income
product_idstring (mongo-id)Yo‘qID of the product.
customer_idstring (mongo-id)Yo‘qID of the customer.
date_fromstring (date-time)Yo‘qStart date for the report in ISO 8601 format.
date_tostring (date-time)Yo‘qEnd date for the report in ISO 8601 format.
sortobjectYo‘qSorting parameters for the report.
sort.nameintegerYo‘qSort order for 'name' field: 1 for ascending, -1 for descending.. Mumkin qiymatlar: 1, -1
report_bystringYo‘qCriteria to report employees by.. Mumkin qiymatlar: created_by, responsible
is_productbooleanYo‘qIndicates if the report includes products.
is_materialbooleanYo‘qIndicates if the report includes materials.
is_semi_productbooleanYo‘qIndicates if the report includes semi-products.
searchstringYo‘qSearch string for filtering results. Optional.
trade_statestringYo‘qCurrent state of the trade.. Mumkin qiymatlar: new, draft, in_progress, canceled, done
trade_statesstring[]Yo‘qList of trade states to filter by.
typestringYo‘qType of summary report.. Mumkin qiymatlar: product, customer, employee, payment, category
statestringYo‘qState of the income.. Mumkin qiymatlar: canceled, done
min_items_soldnumber (int32)Yo‘qMinimum number of items sold.
min_gross_salesnumber (float)Yo‘qMinimum 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
}

Javob

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

So‘rov tanasi

MaydonTurMajburiyTavsif
sale_typestringYo‘qType of sale report. Optional for GET requests.. Mumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)Yo‘qEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanYo‘qIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)HaStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)HaEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]Yo‘qList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]Yo‘qList of employee IDs. Optional for GET requests.
dividerstringYo‘qSpecifies how data should be divided in the chart. Defaults to 'day'.. Mumkin qiymatlar: hour, day, week, month, quarter, year. Standart: "day"
fieldstringYo‘qSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstring (mongo-id)Yo‘qID of the organization.
sort_bystringYo‘qField to sort the results by.
price_idstring (mongo-id)Yo‘qID of the price list.
category_idstring (mongo-id)Yo‘qID of the product category.
customer_category_idstring (mongo-id)Yo‘qID of the customer category.
supplier_idstring (mongo-id)Yo‘qID of the supplier.
supplier_category_idstring (mongo-id)Yo‘qID of the supplier category.
ascintegerYo‘qSort order: 1 for ascending, -1 for descending. Defaults to descending.. Mumkin qiymatlar: 1, -1. Standart: -1
cashbox_idstring (mongo-id)Yo‘qID of the cashbox.
income_typestringYo‘qType of income for the report.. Mumkin qiymatlar: product_income, material_income
report_bystringYo‘qCriteria to report employees by.. Mumkin qiymatlar: created_by, responsible
searchstringYo‘qSearch string for filtering results. Optional.
typestringYo‘qType of summary report.. Mumkin qiymatlar: 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"
}

Javob

MaydonTurTavsif
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

So‘rov tanasi

MaydonTurMajburiyTavsif
sale_typestringYo‘qType of sale report. Optional for GET requests.. Mumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)Yo‘qEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanYo‘qIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)HaStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)HaEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]Yo‘qList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]Yo‘qList of employee IDs. Optional for GET requests.
dividerstringYo‘qSpecifies how data should be divided in the chart. Defaults to 'day'.. Mumkin qiymatlar: hour, day, week, month, quarter, year. Standart: "day"
fieldstringYo‘qSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstring (mongo-id)Yo‘qID of the organization.
sort_bystringYo‘qField to sort the results by.
price_idstring (mongo-id)Yo‘qID of the price list.
category_idstring (mongo-id)Yo‘qID of the product category.
customer_category_idstring (mongo-id)Yo‘qID of the customer category.
supplier_idstring (mongo-id)Yo‘qID of the supplier.
supplier_category_idstring (mongo-id)Yo‘qID of the supplier category.
ascintegerYo‘qSort order: 1 for ascending, -1 for descending. Defaults to descending.. Mumkin qiymatlar: 1, -1. Standart: -1
cashbox_idstring (mongo-id)Yo‘qID of the cashbox.
income_typestringYo‘qType of income for the report.. Mumkin qiymatlar: product_income, material_income
report_bystringYo‘qCriteria to report employees by.. Mumkin qiymatlar: created_by, responsible
searchstringYo‘qSearch string for filtering results. Optional.
typestringYo‘qType of summary report.. Mumkin qiymatlar: 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"
}

Javob

MaydonTurTavsif
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

So‘rov tanasi

MaydonTurMajburiyTavsif
sale_typestringYo‘qType of sale report. Optional for GET requests.. Mumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)Yo‘qEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanYo‘qIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)HaStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)HaEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]Yo‘qList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]Yo‘qList of employee IDs. Optional for GET requests.
dividerstringYo‘qSpecifies how data should be divided in the chart. Defaults to 'day'.. Mumkin qiymatlar: hour, day, week, month, quarter, year. Standart: "day"
fieldstringYo‘qSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstring (mongo-id)Yo‘qID of the organization.
sort_bystringYo‘qField to sort the results by.
price_idstring (mongo-id)Yo‘qID of the price list.
category_idstring (mongo-id)Yo‘qID of the product category.
customer_category_idstring (mongo-id)Yo‘qID of the customer category.
supplier_idstring (mongo-id)Yo‘qID of the supplier.
supplier_category_idstring (mongo-id)Yo‘qID of the supplier category.
ascintegerYo‘qSort order: 1 for ascending, -1 for descending. Defaults to descending.. Mumkin qiymatlar: 1, -1. Standart: -1
cashbox_idstring (mongo-id)Yo‘qID of the cashbox.
income_typestringYo‘qType of income for the report.. Mumkin qiymatlar: product_income, material_income
report_bystringYo‘qCriteria to report employees by.. Mumkin qiymatlar: created_by, responsible
searchstringYo‘qSearch string for filtering results. Optional.
typestringYo‘qType of summary report.. Mumkin qiymatlar: 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"
}

Javob

MaydonTurTavsif
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

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumber (int32)HaPage number for pagination.
limitnumber (int32)HaMaximum number of items to return for pagination.
sale_typestringYo‘qType of sale report. Optional for GET requests.. Mumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)Yo‘qEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanYo‘qIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)HaStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)HaEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]Yo‘qList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]Yo‘qList of employee IDs. Optional for GET requests.
dividerstringYo‘qSpecifies how data should be divided in the chart. Defaults to 'day'.. Mumkin qiymatlar: hour, day, week, month, quarter, year. Standart: "day"
fieldstringYo‘qSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstring (mongo-id)Yo‘qID of the organization.
sort_bystringYo‘qField to sort the results by.
price_idstring (mongo-id)Yo‘qID of the price list.
category_idstring (mongo-id)Yo‘qID of the product category.
customer_category_idstring (mongo-id)Yo‘qID of the customer category.
supplier_idstring (mongo-id)Yo‘qID of the supplier.
supplier_category_idstring (mongo-id)Yo‘qID of the supplier category.
ascintegerYo‘qSort order: 1 for ascending, -1 for descending. Defaults to descending.. Mumkin qiymatlar: 1, -1. Standart: -1
cashbox_idstring (mongo-id)Yo‘qID of the cashbox.
income_typestringYo‘qType of income for the report.. Mumkin qiymatlar: product_income, material_income
product_idstring (mongo-id)Yo‘qID of the product.
customer_idstring (mongo-id)Yo‘qID of the customer.
date_fromstring (date-time)Yo‘qStart date for the report in ISO 8601 format.
date_tostring (date-time)Yo‘qEnd date for the report in ISO 8601 format.
sortobjectYo‘qSorting parameters for the report.
sort.nameintegerYo‘qSort order for 'name' field: 1 for ascending, -1 for descending.. Mumkin qiymatlar: 1, -1
report_bystringYo‘qCriteria to report employees by.. Mumkin qiymatlar: created_by, responsible
is_productbooleanYo‘qIndicates if the report includes products.
is_materialbooleanYo‘qIndicates if the report includes materials.
is_semi_productbooleanYo‘qIndicates if the report includes semi-products.
searchstringYo‘qSearch string for filtering results. Optional.
trade_statestringYo‘qCurrent state of the trade.. Mumkin qiymatlar: new, draft, in_progress, canceled, done
trade_statesstring[]Yo‘qList of trade states to filter by.
typestringYo‘qType of summary report.. Mumkin qiymatlar: product, customer, employee, payment, category
statestringYo‘qState of the income.. Mumkin qiymatlar: canceled, done
min_items_soldnumber (int32)Yo‘qMinimum number of items sold.
min_gross_salesnumber (float)Yo‘qMinimum 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
}

Javob

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

So‘rov tanasi

MaydonTurMajburiyTavsif
sale_typestringYo‘qType of sale report. Optional for GET requests.. Mumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)Yo‘qEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanYo‘qIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)HaStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)HaEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]Yo‘qList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]Yo‘qList of employee IDs. Optional for GET requests.
dividerstringYo‘qSpecifies how data should be divided in the chart. Defaults to 'day'.. Mumkin qiymatlar: hour, day, week, month, quarter, year. Standart: "day"
fieldstringYo‘qSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstring (mongo-id)Yo‘qID of the organization.
sort_bystringYo‘qField to sort the results by.
price_idstring (mongo-id)Yo‘qID of the price list.
category_idstring (mongo-id)Yo‘qID of the product category.
customer_category_idstring (mongo-id)Yo‘qID of the customer category.
supplier_idstring (mongo-id)Yo‘qID of the supplier.
supplier_category_idstring (mongo-id)Yo‘qID of the supplier category.
ascintegerYo‘qSort order: 1 for ascending, -1 for descending. Defaults to descending.. Mumkin qiymatlar: 1, -1. Standart: -1
cashbox_idstring (mongo-id)Yo‘qID of the cashbox.
income_typestringYo‘qType of income for the report.. Mumkin qiymatlar: product_income, material_income
report_bystringYo‘qCriteria to report employees by.. Mumkin qiymatlar: created_by, responsible
searchstringYo‘qSearch string for filtering results. Optional.
typestringYo‘qType of summary report.. Mumkin qiymatlar: 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"
}

Javob

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

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumber (int32)HaPage number for pagination.
limitnumber (int32)HaMaximum number of items to return for pagination.
sale_typestringYo‘qType of sale report. Optional for GET requests.. Mumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart date for the report in ISO 8601 format. Optional for GET requests.
to_datestring (date-time)Yo‘qEnd date for the report in ISO 8601 format. Optional for GET requests.
custombooleanYo‘qIndicates if custom time ranges are used. Optional for GET requests.
from_timeinteger (int32)HaStart hour for custom time range (0-24). Required if 'custom' is true for GET requests.
to_timeinteger (int32)HaEnd hour for custom time range (0-24). Required if 'custom' is true for GET requests.
organizationsstring (mongo-id)[]Yo‘qList of organization IDs. Optional for GET requests.
employeesstring (mongo-id)[]Yo‘qList of employee IDs. Optional for GET requests.
dividerstringYo‘qSpecifies how data should be divided in the chart. Defaults to 'day'.. Mumkin qiymatlar: hour, day, week, month, quarter, year. Standart: "day"
fieldstringYo‘qSpecifies the field to be displayed in the chart. Defaults to 'gross_sales'.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstring (mongo-id)Yo‘qID of the organization.
sort_bystringYo‘qField to sort the results by.
price_idstring (mongo-id)Yo‘qID of the price list.
category_idstring (mongo-id)Yo‘qID of the product category.
customer_category_idstring (mongo-id)Yo‘qID of the customer category.
supplier_idstring (mongo-id)Yo‘qID of the supplier.
supplier_category_idstring (mongo-id)Yo‘qID of the supplier category.
ascintegerYo‘qSort order: 1 for ascending, -1 for descending. Defaults to descending.. Mumkin qiymatlar: 1, -1. Standart: -1
cashbox_idstring (mongo-id)Yo‘qID of the cashbox.
income_typestringYo‘qType of income for the report.. Mumkin qiymatlar: product_income, material_income
product_idstring (mongo-id)Yo‘qID of the product.
customer_idstring (mongo-id)Yo‘qID of the customer.
date_fromstring (date-time)Yo‘qStart date for the report in ISO 8601 format.
date_tostring (date-time)Yo‘qEnd date for the report in ISO 8601 format.
sortobjectYo‘qSorting parameters for the report.
sort.nameintegerYo‘qSort order for 'name' field: 1 for ascending, -1 for descending.. Mumkin qiymatlar: 1, -1
report_bystringYo‘qCriteria to report employees by.. Mumkin qiymatlar: created_by, responsible
is_productbooleanYo‘qIndicates if the report includes products.
is_materialbooleanYo‘qIndicates if the report includes materials.
is_semi_productbooleanYo‘qIndicates if the report includes semi-products.
searchstringYo‘qSearch string for filtering results. Optional.
trade_statestringYo‘qCurrent state of the trade.. Mumkin qiymatlar: new, draft, in_progress, canceled, done
trade_statesstring[]Yo‘qList of trade states to filter by.
typestringYo‘qType of summary report.. Mumkin qiymatlar: product, customer, employee, payment, category
statestringYo‘qState of the income.. Mumkin qiymatlar: canceled, done
min_items_soldnumber (int32)Yo‘qMinimum number of items sold.
min_gross_salesnumber (float)Yo‘qMinimum 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
}

Javob

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

Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API