Skip to content

Income ​

INFO

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

POST /income/create ​

This method allows adding income into the account.

Тело запроса

ПолеТипОбязательноОписание
codestringНет
organization_idstringДа
responsible_idstringДа
datestring (date-time)Да
supplier_idstringДа
supplier_assistant_idstringНет
warehouse_idstringДа
currency_idstringДа
notestringНет
purchasesobject[]Да
purchases[].purchase_idstringДа
purchases[].productsobject[]Да
purchases[].products[].purchase_item_idstringДа
purchases[].products[].amountnumberДаПо умолчанию: 0
purchases[].products[].box_countnumberНетПо умолчанию: 0
purchases[].products[].box_itemnumberНетПо умолчанию: 0
purchases[].products[].product_idstringДа
purchases[].products[].costnumberДаПо умолчанию: 0
purchases[].products[].extra_costnumberДаПо умолчанию: 0
purchases[].products[].marksstring[]Да
purchases[].products[].extra_costsobject[]Да
additional_costsobject[]Нет
additional_costs[].cost_idstringДа
additional_costs[].amountnumberДаПо умолчанию: 0
additional_costs[].customer_idstringНет
additional_costs[].person_idstringНет
additional_costs[].supplier_idstringНет
additional_costs[].employee_idstringНет
json
{
  "code": "INC-2024-001",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7f2",
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7f3",
  "date": "2024-07-20T10:30:00Z",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7f4",
  "supplier_assistant_id": "64b7f4d9e2b3b6a0b7c5d7f5",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7f6",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d7f7",
  "note": "Some notes about the income",
  "purchases": [
    {
      "purchase_id": "64b7f4d9e2b3b6a0b7c5d7f8",
      "products": []
    }
  ],
  "additional_costs": [
    {
      "cost_id": "64b7f4d9e2b3b6a0b7c5d7fc",
      "amount": 0,
      "customer_id": "64b7f4d9e2b3b6a0b7c5d7fd",
      "person_id": "64b7f4d9e2b3b6a0b7c5d7fe",
      "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "employee_id": "64b7f4d9e2b3b6a0b7c5d800"
    }
  ]
}

Ответ

ПолеТипОписание
created_atstring (date-time)
updated_atnumber (date-time)
codestring
numberstring
organization_idstring
organizationobject
organization._idstring
organization.namestring
datestring (date-time)
warehouse_idstring
warehouseobject
warehouse._idstring
warehouse.namestring
responsible_idstring
responsibleobject
responsible._idstring
responsible.full_namestring
supplier_idstring
supplierobject
supplier._idstring
supplier.namestring
currency_idstring
currencyobject
currency._idstring
currency.namestring
currency.symbolstring
currency.uuidnumber
currency.valuenumber
currency.sidestring
notestring
total_amountnumber
total_costnumber
additional_costsobject[]
additional_costs[].cost_idstring
additional_costs[].amountnumber
additional_costs[].costobject
additional_costs[].cost.namestring
additional_costs[].cost.is_affect_priceboolean
additional_costs[].cost.distribution_methodstring
additional_costs[].cost.recommended_amountnumber
additional_costs[].cost.max_amountnumber
additional_costs[].cost.currency_idstring
purchasesobject[]
statestring
created_byobject
created_by._idnumber
created_by.full_namestring
created_by.phone_numberstring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": 0,
    "code": "INC-2024-001",
    "number": "string",
    "organization_id": "string",
    "organization": {
      "_id": "string",
      "name": "string"
    },
    "date": "2025-05-01T12:00:00Z",
    "warehouse_id": "string",
    "warehouse": {
      "_id": "string",
      "name": "string"
    },
    "responsible_id": "string",
    "responsible": {
      "_id": "string",
      "full_name": "string"
    },
    "supplier_id": "string",
    "supplier": {
      "_id": "string",
      "name": "string"
    },
    "currency_id": "string",
    "currency": {
      "_id": "string",
      "name": "string",
      "symbol": "string",
      "uuid": 0,
      "value": 0,
      "side": "string"
    },
    "note": "string",
    "total_amount": 0,
    "total_cost": 0,
    "additional_costs": [
      {
        "cost_id": "string",
        "amount": 0,
        "cost": {
          "name": null,
          "is_affect_price": null,
          "distribution_method": null,
          "recommended_amount": null,
          "max_amount": null,
          "currency_id": null
        }
      }
    ],
    "purchases": [
      {}
    ],
    "state": "string",
    "created_by": {
      "_id": 0,
      "full_name": "string",
      "phone_number": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /income/cancel ​

Cancel income

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
cancel_extra_costbooleanДа
with_transactionsbooleanДа
json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d801",
  "cancel_extra_cost": true,
  "with_transactions": true
}

Ответ

Структура ответа совпадает с POST /income/create.

GET /income/get-by-id/{id} ​

Get income using its _id

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

Тело запроса не требуется.

Ответ

Структура ответа совпадает с POST /income/create.

POST /income/get-paging ​

Get income by paging

Тело запроса

ПолеТипОбязательноОписание
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
searchstringНет
supplier_idstringНет
organization_idstringНет
responsible_idstringНет
date_fromstring (date-time)Нет
date_tostring (date-time)Нет
updated_atstring (date-time)Нет
json
{
  "page": 1,
  "limit": 20,
  "search": "string",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d800",
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d801",
  "date_from": "2024-07-01T00:00:00Z",
  "date_to": "2024-07-31T23:59:59Z",
  "updated_at": "2024-07-20T10:30:00Z"
}

Ответ

data.total — общее количество записей, data.data[] — записи текущей страницы. Таблица ниже описывает одну запись.

ПолеТипОписание
created_atstring (date-time)
updated_atnumber (date-time)
codestring
numberstring
organization_idstring
organizationobject
organization._idstring
organization.namestring
datestring (date-time)
responsible_idstring
responsibleobject
responsible._idstring
responsible.full_namestring
supplier_idstring
supplierobject
supplier._idstring
supplier.namestring
currency_idstring
currencyobject
currency._idstring
currency.namestring
currency.symbolstring
currency.uuidnumber
currency.valuenumber
currency.sidestring
notestring
total_amountnumber
total_costnumber
statestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": 0,
        "code": "INC-2024-001",
        "number": "string",
        "organization_id": "string",
        "organization": {
          "_id": "string",
          "name": "string"
        },
        "date": "2025-05-01T12:00:00Z",
        "responsible_id": "string",
        "responsible": {
          "_id": "string",
          "full_name": "string"
        },
        "supplier_id": "string",
        "supplier": {
          "_id": "string",
          "name": "string"
        },
        "currency_id": "string",
        "currency": {
          "_id": "string",
          "name": "string",
          "symbol": "string",
          "uuid": 0,
          "value": 0,
          "side": "string"
        },
        "note": "string",
        "total_amount": 0,
        "total_cost": 0,
        "state": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

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

Bito 2.0 Integration API