Skip to content
Markdown

Tax ​

INFO

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

POST /tax/create ​

This method allows adding tax into the account.

Нужное разрешение: tax_create · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/tax/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "VAT",
  "rate": 7.25,
  "type": "included",
  "to_price": true,
  "is_manual": false,
  "organization_ids": [
    "64e944999f719902a7ff641b"
  ],
  "is_all": true,
  "is_all_categories": false,
  "is_all_suppliers": true
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/tax/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "VAT",
    "rate": 7.25,
    "type": "included",
    "to_price": true,
    "is_manual": false,
    "organization_ids": [
      "64e944999f719902a7ff641b"
    ],
    "is_all": true,
    "is_all_categories": false,
    "is_all_suppliers": true
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/tax/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "VAT",
        "rate": 7.25,
        "type": "included",
        "to_price": True,
        "is_manual": False,
        "organization_ids": [
            "64e944999f719902a7ff641b",
        ],
        "is_all": True,
        "is_all_categories": False,
        "is_all_suppliers": True,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "VAT",
  "rate": 7.25,
  "type": "included",
  "to_price": true,
  "is_manual": false,
  "organization_ids": [
    "64e944999f719902a7ff641b"
  ],
  "is_all": true,
  "is_all_categories": false,
  "is_all_suppliers": true
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/tax/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);

Тело запроса

ПолеТипОбязательноОписание
namestringДа
ratenumberДа
typestringДаДопустимые значения: included, added
to_pricebooleanДа
is_manualbooleanДа
organization_idsstring[]Да
is_allbooleanДа
is_all_categoriesbooleanДа
is_all_suppliersbooleanДа
supplier_idsstring[]Нет
category_idsstring[]Нет
item_added_idsstring[]Нет
item_removed_idsstring[]Нет
json
{
  "name": "VAT",
  "rate": 7.25,
  "type": "included",
  "to_price": true,
  "is_manual": false,
  "organization_ids": [
    "64e944999f719902a7ff641b"
  ],
  "is_all": true,
  "is_all_categories": false,
  "is_all_suppliers": true,
  "supplier_ids": [
    "64e944999f719902a7ff641c"
  ],
  "category_ids": [
    "64e944999f719902a7ff641d"
  ],
  "item_added_ids": [
    "64e944999f719902a7ff641e"
  ],
  "item_removed_ids": [
    "64e944999f719902a7ff641f"
  ]
}

Ответ

ПолеТипОписание
_idstring
namestring
ratenumber
typestringДопустимые значения: included, added
is_allboolean
is_all_categoriesboolean
is_all_suppliersboolean
supplier_idsstring[]
category_idsstring[]
item_added_idsstring[]
item_removed_idsstring[]
item_countnumber
to_priceboolean
is_manualboolean
organization_idsstring[]
last_payment_datestring (date-time)
last_payment_amountnumber
calculated_amountnumber
is_enabledboolean
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "64e944999f719902a7ff641b",
    "name": "string",
    "rate": 0,
    "type": "included",
    "is_all": false,
    "is_all_categories": false,
    "is_all_suppliers": false,
    "supplier_ids": [
      "string"
    ],
    "category_ids": [
      "string"
    ],
    "item_added_ids": [
      "string"
    ],
    "item_removed_ids": [
      "string"
    ],
    "item_count": 0,
    "to_price": false,
    "is_manual": false,
    "organization_ids": [
      "string"
    ],
    "last_payment_date": "2025-05-01T12:00:00Z",
    "last_payment_amount": 0,
    "calculated_amount": 0,
    "is_enabled": false
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /tax/update ​

This method allows updating saler-order in the account.

Нужное разрешение: tax_update · как работают разрешения

Пример запроса

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/tax/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "VAT",
  "rate": 7.25,
  "type": "included",
  "to_price": true,
  "is_manual": false,
  "_id": "64e944999f719902a7ff641b"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/tax/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "VAT",
    "rate": 7.25,
    "type": "included",
    "to_price": true,
    "is_manual": false,
    "_id": "64e944999f719902a7ff641b"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/tax/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "VAT",
        "rate": 7.25,
        "type": "included",
        "to_price": True,
        "is_manual": False,
        "_id": "64e944999f719902a7ff641b",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "VAT",
  "rate": 7.25,
  "type": "included",
  "to_price": true,
  "is_manual": false,
  "_id": "64e944999f719902a7ff641b"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/tax/update');
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);

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
namestringДа
ratenumberДа
typestringДаДопустимые значения: included, added
to_pricebooleanДа
is_manualbooleanДа
organization_idsstring[]Нет
json
{
  "_id": "64e944999f719902a7ff641b",
  "name": "VAT",
  "rate": 7.25,
  "type": "included",
  "to_price": true,
  "is_manual": false,
  "organization_ids": [
    "64e944999f719902a7ff641b"
  ]
}

Ответ

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

DELETE /tax/delete/{id} ​

Delete a tax

Нужное разрешение: tax_delete · как работают разрешения

Пример запроса

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

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/tax/delete/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/tax/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

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

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

Тело запроса

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

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}

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

Get tax using its _id

Нужное разрешение: tax · как работают разрешения

Пример запроса

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/tax/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/tax/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/tax/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/tax/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);

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

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

Тело запроса

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

Ответ

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

POST /tax/get-all ​

Get all taxs

Нужное разрешение: tax · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/tax/get-all' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_id": "64e944999f719902a7ff641b",
  "type": "included",
  "is_manual": false
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/tax/get-all', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "organization_id": "64e944999f719902a7ff641b",
    "type": "included",
    "is_manual": false
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/tax/get-all",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "organization_id": "64e944999f719902a7ff641b",
        "type": "included",
        "is_manual": False,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "organization_id": "64e944999f719902a7ff641b",
  "type": "included",
  "is_manual": false
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/tax/get-all');
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);

Тело запроса

ПолеТипОбязательноОписание
organization_idstringНет
typestringНетДопустимые значения: included, added. По умолчанию: "included"
is_manualbooleanНетПо умолчанию: false
json
{
  "organization_id": "64e944999f719902a7ff641b",
  "type": "included",
  "is_manual": false
}

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "64e944999f719902a7ff641b",
      "name": "string",
      "rate": 0,
      "type": "included",
      "is_all": false,
      "is_all_categories": false,
      "is_all_suppliers": false,
      "supplier_ids": [
        "string"
      ],
      "category_ids": [
        "string"
      ],
      "item_added_ids": [
        "string"
      ],
      "item_removed_ids": [
        "string"
      ],
      "item_count": 0,
      "to_price": false,
      "is_manual": false,
      "organization_ids": [
        "string"
      ],
      "last_payment_date": "2025-05-01T12:00:00Z",
      "last_payment_amount": 0,
      "calculated_amount": 0,
      "is_enabled": false
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

POST /tax/get-paging ​

Get taxs by paging

Нужное разрешение: tax · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/tax/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/tax/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/tax/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/tax/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);

Тело запроса

ПолеТипОбязательноОписание
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
organization_idstringНет
typestringНетДопустимые значения: included, added. По умолчанию: "included"
is_manualbooleanНетПо умолчанию: false
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "64e944999f719902a7ff641b",
  "type": "included",
  "is_manual": false
}

Ответ

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

ПолеТипОписание
_idstring
namestring
ratenumber
typestringДопустимые значения: included, added
is_allboolean
is_all_categoriesboolean
is_all_suppliersboolean
supplier_idsstring[]
category_idsstring[]
item_added_idsstring[]
item_removed_idsstring[]
item_countnumber
to_priceboolean
is_manualboolean
organization_idsstring[]
last_payment_datestring (date-time)
last_payment_amountnumber
calculated_amountnumber
is_enabledboolean
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "64e944999f719902a7ff641b",
        "name": "string",
        "rate": 0,
        "type": "included",
        "is_all": false,
        "is_all_categories": false,
        "is_all_suppliers": false,
        "supplier_ids": [
          "string"
        ],
        "category_ids": [
          "string"
        ],
        "item_added_ids": [
          "string"
        ],
        "item_removed_ids": [
          "string"
        ],
        "item_count": 0,
        "to_price": false,
        "is_manual": false,
        "organization_ids": [
          "string"
        ],
        "last_payment_date": "2025-05-01T12:00:00Z",
        "last_payment_amount": 0,
        "calculated_amount": 0,
        "is_enabled": false
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /tax/get-items ​

Get tax-items

Нужное разрешение: tax · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/tax/get-items' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "tax_id": "64e944999f719902a7ff641b",
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/tax/get-items', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "tax_id": "64e944999f719902a7ff641b",
    "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/tax/get-items",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "tax_id": "64e944999f719902a7ff641b",
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "tax_id": "64e944999f719902a7ff641b",
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/tax/get-items');
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);

Тело запроса

ПолеТипОбязательноОписание
tax_idstringДа
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
updated_atstring (date-time)НетOnly records updated at or after this time.
json
{
  "tax_id": "64e944999f719902a7ff641b",
  "page": 1,
  "limit": 20,
  "updated_at": "2025-05-01T12:00:00Z"
}

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "64e944999f719902a7ff641b",
      "created_at": "2025-05-01T12:00:00Z",
      "is_material": true,
      "is_product": true,
      "item_id": "64e944999f719902a7ff641b",
      "tax_id": "64e944999f719902a7ff641b",
      "updated_at": "2025-05-01T12:00:00Z",
      "item": {
        "_id": "64e944999f719902a7ff641b",
        "name": "Item Name",
        "measure_id": "64e944999f719902a7ff641b",
        "barcode": "1234567890123"
      }
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

GET /tax/get-deleted ​

Get deleted tax ids

Нужное разрешение: tax · как работают разрешения

Пример запроса

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/tax/get-deleted?deleted_at=DELETED_AT' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/tax/get-deleted?deleted_at=DELETED_AT', {
  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/tax/get-deleted?deleted_at=DELETED_AT",
    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/tax/get-deleted?deleted_at=DELETED_AT');
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);

Параметры запроса

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

Тело запроса

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

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}

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

Bito 2.0 Integration API