Income
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 /income/create
This method allows adding income into the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
code | string | No | |
organization_id | string | Yes | |
responsible_id | string | Yes | |
date | string (date-time) | Yes | |
supplier_id | string | Yes | |
supplier_assistant_id | string | No | |
warehouse_id | string | Yes | |
currency_id | string | Yes | |
note | string | No | |
purchases | object[] | Yes | |
purchases[].purchase_id | string | Yes | |
purchases[].products | object[] | Yes | |
purchases[].products[].purchase_item_id | string | Yes | |
purchases[].products[].amount | number | Yes | Default: 0 |
purchases[].products[].box_count | number | No | Default: 0 |
purchases[].products[].box_item | number | No | Default: 0 |
purchases[].products[].product_id | string | Yes | |
purchases[].products[].cost | number | Yes | Default: 0 |
purchases[].products[].extra_cost | number | Yes | Default: 0 |
purchases[].products[].marks | string[] | Yes | |
purchases[].products[].extra_costs | object[] | Yes | |
additional_costs | object[] | No | |
additional_costs[].cost_id | string | Yes | |
additional_costs[].amount | number | Yes | Default: 0 |
additional_costs[].customer_id | string | No | |
additional_costs[].person_id | string | No | |
additional_costs[].supplier_id | string | No | |
additional_costs[].employee_id | string | No |
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"
}
]
}Response
| Field | Type | Description |
|---|---|---|
created_at | string (date-time) | |
updated_at | number (date-time) | |
code | string | |
number | string | |
organization_id | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
date | string (date-time) | |
warehouse_id | string | |
warehouse | object | |
warehouse._id | string | |
warehouse.name | string | |
responsible_id | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
supplier_id | string | |
supplier | object | |
supplier._id | string | |
supplier.name | string | |
currency_id | string | |
currency | object | |
currency._id | string | |
currency.name | string | |
currency.symbol | string | |
currency.uuid | number | |
currency.value | number | |
currency.side | string | |
note | string | |
total_amount | number | |
total_cost | number | |
additional_costs | object[] | |
additional_costs[].cost_id | string | |
additional_costs[].amount | number | |
additional_costs[].cost | object | |
additional_costs[].cost.name | string | |
additional_costs[].cost.is_affect_price | boolean | |
additional_costs[].cost.distribution_method | string | |
additional_costs[].cost.recommended_amount | number | |
additional_costs[].cost.max_amount | number | |
additional_costs[].cost.currency_id | string | |
purchases | object[] | |
state | string | |
created_by | object | |
created_by._id | number | |
created_by.full_name | string | |
created_by.phone_number | string |
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
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
cancel_extra_cost | boolean | Yes | |
with_transactions | boolean | Yes |
json
{
"_id": "64b7f4d9e2b3b6a0b7c5d801",
"cancel_extra_cost": true,
"with_transactions": true
}Response
Same response shape as POST /income/create.
GET /income/get-by-id/{id}
Get income using its _id
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
Same response shape as POST /income/create.
POST /income/get-paging
Get income by paging
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
search | string | No | |
supplier_id | string | No | |
organization_id | string | No | |
responsible_id | string | No | |
date_from | string (date-time) | No | |
date_to | string (date-time) | No | |
updated_at | string (date-time) | No |
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"
}Response
data.total is the total number of records and data.data[] holds the current page. The table below describes one record.
| Field | Type | Description |
|---|---|---|
created_at | string (date-time) | |
updated_at | number (date-time) | |
code | string | |
number | string | |
organization_id | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
date | string (date-time) | |
responsible_id | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
supplier_id | string | |
supplier | object | |
supplier._id | string | |
supplier.name | string | |
currency_id | string | |
currency | object | |
currency._id | string | |
currency.name | string | |
currency.symbol | string | |
currency.uuid | number | |
currency.value | number | |
currency.side | string | |
note | string | |
total_amount | number | |
total_cost | number | |
state | string |
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"
}This page is generated from the OpenAPI spec.