Income
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 /income/create
This method allows adding income into the account.
Kerakli ruxsat: income_create · ruxsatlar qanday ishlaydi
So‘rov namunasi
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": []
}
]
}'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()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
$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);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
code | string | Yo‘q | |
organization_id | string | Ha | |
responsible_id | string | Ha | |
date | string (date-time) | Ha | |
supplier_id | string | Ha | |
supplier_assistant_id | string | Yo‘q | |
warehouse_id | string | Ha | |
currency_id | string | Ha | |
note | string | Yo‘q | |
purchases | object[] | Ha | |
purchases[].purchase_id | string | Ha | |
purchases[].products | object[] | Ha | |
purchases[].products[].purchase_item_id | string | Ha | |
purchases[].products[].amount | number | Ha | Standart: 0 |
purchases[].products[].box_count | number | Yo‘q | Standart: 0 |
purchases[].products[].box_item | number | Yo‘q | Standart: 0 |
purchases[].products[].product_id | string | Ha | |
purchases[].products[].cost | number | Ha | Standart: 0 |
purchases[].products[].extra_cost | number | Yo‘q | Standart: 0 |
purchases[].products[].marks | string[] | Yo‘q | |
purchases[].products[].extra_costs | object[] | Yo‘q | |
purchases[].products[].used_measure | object | Yo‘q | |
purchases[].products[].expiration_date | string (date-time) | Yo‘q | |
additional_costs | object[] | Yo‘q | |
additional_costs[].cost_id | string | Ha | |
additional_costs[].amount | number | Ha | Standart: 0 |
additional_costs[].customer_id | string | Yo‘q | |
additional_costs[].person_id | string | Yo‘q | |
additional_costs[].supplier_id | string | Yo‘q | |
additional_costs[].employee_id | string | Yo‘q |
{
"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"
}
]
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
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 |
{
"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
Kerakli ruxsat: income · ruxsatlar qanday ishlaydi
Hujjatni bekor qiladigan ilova income_cancel ruxsatini ham so‘rasin.
So‘rov namunasi
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"
}'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()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
$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);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
_id | string | Ha | |
cancel_extra_cost | boolean | Yo‘q | |
with_transactions | boolean | Yo‘q |
{
"_id": "64b7f4d9e2b3b6a0b7c5d801",
"cancel_extra_cost": true,
"with_transactions": true
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /income/create.
GET /income/get-by-id/{id}
Get income using its _id
Kerakli ruxsat: income · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/income/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"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()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
$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);Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /income/create.
POST /income/get-paging
Get income by paging
Kerakli ruxsat: income · ruxsatlar qanday ishlaydi
So‘rov namunasi
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
}'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()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
$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);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
search | string | Yo‘q | |
supplier_id | string | Yo‘q | |
organization_id | string | Yo‘q | |
responsible_id | string | Yo‘q | |
date_from | string (date-time) | Yo‘q | |
date_to | string (date-time) | Yo‘q | |
updated_at | string (date-time) | Yo‘q |
{
"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"
}Javob
data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.
| Maydon | Tur | Tavsif |
|---|---|---|
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 |
{
"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"
}Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.