Skip to content
View as Markdown

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.

Required permission: income_create · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/income/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7f2",
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7f3",
  "date": "2024-07-20T10:30:00Z",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7f4",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7f6",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d7f7",
  "purchases": [
    {
      "purchase_id": "64b7f4d9e2b3b6a0b7c5d7f8",
      "products": []
    }
  ]
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/income/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "organization_id": "64b7f4d9e2b3b6a0b7c5d7f2",
    "responsible_id": "64b7f4d9e2b3b6a0b7c5d7f3",
    "date": "2024-07-20T10:30:00Z",
    "supplier_id": "64b7f4d9e2b3b6a0b7c5d7f4",
    "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7f6",
    "currency_id": "64b7f4d9e2b3b6a0b7c5d7f7",
    "purchases": [
      {
        "purchase_id": "64b7f4d9e2b3b6a0b7c5d7f8",
        "products": []
      }
    ]
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/income/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "organization_id": "64b7f4d9e2b3b6a0b7c5d7f2",
        "responsible_id": "64b7f4d9e2b3b6a0b7c5d7f3",
        "date": "2024-07-20T10:30:00Z",
        "supplier_id": "64b7f4d9e2b3b6a0b7c5d7f4",
        "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7f6",
        "currency_id": "64b7f4d9e2b3b6a0b7c5d7f7",
        "purchases": [
            {
                "purchase_id": "64b7f4d9e2b3b6a0b7c5d7f8",
                "products": [],
            },
        ],
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7f2",
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7f3",
  "date": "2024-07-20T10:30:00Z",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7f4",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7f6",
  "currency_id": "64b7f4d9e2b3b6a0b7c5d7f7",
  "purchases": [
    {
      "purchase_id": "64b7f4d9e2b3b6a0b7c5d7f8",
      "products": []
    }
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/income/create');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Request body

FieldTypeRequiredDescription
codestringNo
organization_idstringYes
responsible_idstringYes
datestring (date-time)Yes
supplier_idstringYes
supplier_assistant_idstringNo
warehouse_idstringYes
currency_idstringYes
notestringNo
purchasesobject[]Yes
purchases[].purchase_idstringYes
purchases[].productsobject[]Yes
purchases[].products[].purchase_item_idstringYes
purchases[].products[].amountnumberYesDefault: 0
purchases[].products[].box_countnumberNoDefault: 0
purchases[].products[].box_itemnumberNoDefault: 0
purchases[].products[].product_idstringYes
purchases[].products[].costnumberYesDefault: 0
purchases[].products[].extra_costnumberNoDefault: 0
purchases[].products[].marksstring[]No
purchases[].products[].extra_costsobject[]No
purchases[].products[].used_measureobjectNo
purchases[].products[].expiration_datestring (date-time)No
additional_costsobject[]No
additional_costs[].cost_idstringYes
additional_costs[].amountnumberYesDefault: 0
additional_costs[].customer_idstringNo
additional_costs[].person_idstringNo
additional_costs[].supplier_idstringNo
additional_costs[].employee_idstringNo
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

FieldTypeDescription
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

Required permission: income · how permissions work

An app that cancels documents should request income_cancel as well.

Example request

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/income/cancel' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "64b7f4d9e2b3b6a0b7c5d801"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/income/cancel', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "64b7f4d9e2b3b6a0b7c5d801"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/income/cancel",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "64b7f4d9e2b3b6a0b7c5d801",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "_id": "64b7f4d9e2b3b6a0b7c5d801"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/income/cancel');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Request body

FieldTypeRequiredDescription
_idstringYes
cancel_extra_costbooleanNo
with_transactionsbooleanNo
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

Required permission: income · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/income/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/income/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/income/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/income/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as POST /income/create.

POST /income/get-paging ​

Get income by paging

Required permission: income · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/income/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/income/get-paging', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 1,
    "limit": 20
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/income/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/income/get-paging');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
searchstringNo
supplier_idstringNo
organization_idstringNo
responsible_idstringNo
date_fromstring (date-time)No
date_tostring (date-time)No
updated_atstring (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.

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

This page is generated from the OpenAPI spec.

Bito 2.0 Integration API