Purchase
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 /purchase/create
This method allows adding purchase into the account.
Kerakli ruxsat: purchase_create · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/purchase/create' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/purchase/create', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/purchase/create",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": [],
},
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a",
},
],
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/purchase/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 | |
state | string | Ha | Mumkin qiymatlar: canceled, new, done, in_progress, draft |
date | string (date) | Ha | |
income_date | string (date) | Yo‘q | |
responsible_id | string | Ha | |
supplier_id | string | Ha | |
supplier_assistant_id | string | Yo‘q | |
warehouse_id | string | Yo‘q | Required when is_auto_income is true. |
currency_id | string | Ha | |
note | string | Yo‘q | |
price_id | string | Yo‘q | |
orders | object[] | Ha | |
orders[].order_id | string | Yo‘q | |
orders[].products | object[] | Ha | |
orders[].products[].order_item_id | string | Yo‘q | |
orders[].products[].product_id | string | Ha | |
orders[].products[].amount | number | Ha | |
orders[].products[].box_count | number | Yo‘q | |
orders[].products[].box_item | number | Yo‘q | |
orders[].products[].cost | number | Ha | |
orders[].products[].extra_cost | number | Yo‘q | |
orders[].products[].extra_costs | object[] | Yo‘q | |
orders[].products[].marks | string[] | Yo‘q | |
orders[].products[].prices | object[] | Yo‘q | |
orders[].products[].discounts | object[] | Yo‘q | |
orders[].products[].used_measure | object | Yo‘q | |
additional_costs | object[] | Ha | |
additional_costs[].cost_id | string | Ha | |
additional_costs[].amount | number | Ha | |
additional_costs[].customer_id | string | Yo‘q | |
additional_costs[].employee_id | string | Yo‘q | |
additional_costs[].supplier_id | string | Yo‘q | |
additional_costs[].person_id | string | Yo‘q | |
is_auto_income | boolean | Yo‘q | |
contract_id | string | Yo‘q | |
state_id | string | Yo‘q | |
discounts | object[] | Yo‘q | |
discounts[].is_custom | boolean | Yo‘q | Standart: true |
discounts[].value | number | Ha | |
discounts[].apply_type | string | Ha | Mumkin qiymatlar: percent, cash |
{
"code": "PR-001",
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new",
"date": "2023-10-01",
"income_date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_assistant_id": "64b7f4d9e2b3b6a0b7c5d80a",
"warehouse_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"note": "This is a note",
"price_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"is_auto_income": true,
"contract_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"discounts": [
{
"is_custom": true,
"value": 0,
"apply_type": "percent"
}
]
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
created_at | string (date-time) | |
updated_at | string (date-time) | |
code | string | |
number | string | |
organization_id | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
state | string | |
date | string (date-time) | |
income_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 | |
created_by | object | |
created_by._id | string | |
created_by.full_name | string | |
suplier_assistant | object | |
suplier_assistant._id | string | |
suplier_assistant.name | string | |
suplier_assistant.type | string | |
supplier_assistant_hierarchy | object[] | |
supplier_assistant_hierarchy[]._id | string | |
supplier_assistant_hierarchy[].name | string | |
supplier_assistant_hierarchy[].type | string | |
supplier_assistant_hierarchy[].first_name | string | |
supplier_assistant_hierarchy[].last_name | string | |
supplier_assistant_hierarchy[].middle_name | string | |
currency_id | string | |
currency | object | |
currency._id | string | |
currency.name | string | |
currency.uuid | number | |
currency.value | number | |
currency.symbol | string | |
currency.side | string | |
note | string | |
total_amount | number | |
total_cost | number | |
additional_costs | object[] | |
orders | object[] | |
invoice | object | |
is_fully_income | boolean | |
total_income | number | |
total_refunded | number | |
is_auto_create | boolean | |
is_fully_refunded | boolean | |
incomes | object[] | |
purchase_returns | object[] | |
total_extra_cost | number | |
contract_id | string | |
contract | object | |
contract._id | string | |
contract.name | string | |
contract.code | string | |
contract.number | string | |
contract.currency_id | string | |
contract.organization_id | string | |
contract.amount | number | |
contract.date | string (date-time) | |
contract.expire_date | string (date-time) | |
contract.person_id | string | |
contract.note | string | |
contract.is_active | boolean | |
contract.contract_number | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"code": "string",
"number": "string",
"organization_id": "string",
"organization": {
"_id": "string",
"name": "string"
},
"state": "string",
"date": "2025-05-01T12:00:00Z",
"income_date": "2025-05-01T12:00:00Z",
"responsible_id": "string",
"responsible": {
"_id": "string",
"full_name": "string"
},
"supplier_id": "string",
"supplier": {
"_id": "string",
"name": "string"
},
"created_by": {
"_id": "string",
"full_name": "string"
},
"suplier_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"supplier_assistant_hierarchy": [
{
"_id": "string",
"name": "string",
"type": "string",
"first_name": "string",
"last_name": "string",
"middle_name": "string"
}
],
"currency_id": "string",
"currency": {
"_id": "string",
"name": "string",
"uuid": 0,
"value": 0,
"symbol": "string",
"side": "string"
},
"note": "string",
"total_amount": 0,
"total_cost": 0,
"additional_costs": [
{}
],
"orders": [
{}
],
"invoice": {},
"is_fully_income": false,
"total_income": 0,
"total_refunded": 0,
"is_auto_create": false,
"is_fully_refunded": false,
"incomes": [
{}
],
"purchase_returns": [
{}
],
"total_extra_cost": 0,
"contract_id": "string",
"contract": {
"_id": "string",
"name": "string",
"code": "string",
"number": "string",
"currency_id": "string",
"organization_id": "string",
"amount": 0,
"date": "2025-05-01T12:00:00Z",
"expire_date": "2025-05-01T12:00:00Z",
"person_id": "string",
"note": "string",
"is_active": false,
"contract_number": "string"
}
},
"time": "2025-05-01T12:00:00Z"
}PUT /purchase/update
This method allows updating purchase in the account.
Kerakli ruxsat: purchase_update · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/purchase/update' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/purchase/update', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/purchase/update",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": [],
},
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a",
},
],
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/purchase/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);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
_id | string | Ha | |
code | string | Yo‘q | |
organization_id | string | Ha | |
date | string (date) | Ha | |
income_date | string (date) | Yo‘q | |
responsible_id | string | Ha | |
supplier_id | string | Ha | |
supplier_assistant_id | string | Yo‘q | |
warehouse_id | string | Yo‘q | Required when is_auto_income is true. |
currency_id | string | Ha | |
note | string | Yo‘q | |
orders | object[] | Ha | |
orders[].order_id | string | Yo‘q | |
orders[].products | object[] | Ha | |
orders[].products[].order_item_id | string | Yo‘q | |
orders[].products[].product_id | string | Ha | |
orders[].products[].amount | number | Ha | |
orders[].products[].box_count | number | Yo‘q | |
orders[].products[].box_item | number | Yo‘q | |
orders[].products[].cost | number | Ha | |
orders[].products[].extra_cost | number | Yo‘q | |
orders[].products[].extra_costs | object[] | Yo‘q | |
orders[].products[].prices | object[] | Yo‘q | |
orders[].products[].discounts | object[] | Yo‘q | |
orders[].products[].marks | any[] | Yo‘q | |
orders[].products[].used_measure | object | Yo‘q | |
additional_costs | object[] | Ha | |
additional_costs[].cost_id | string | Ha | |
additional_costs[].amount | number | Ha | |
additional_costs[].customer_id | string | Yo‘q | |
additional_costs[].employee_id | string | Yo‘q | |
additional_costs[].supplier_id | string | Yo‘q | |
additional_costs[].person_id | string | Yo‘q | |
is_auto_income | boolean | Yo‘q | |
contract_id | string | Yo‘q | |
discounts | object[] | Yo‘q | |
discounts[].is_custom | boolean | Yo‘q | Standart: true |
discounts[].value | number | Ha | |
discounts[].apply_type | string | Ha | Mumkin qiymatlar: percent, cash |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"code": "PR-001",
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"date": "2023-10-01",
"income_date": "2023-10-01",
"responsible_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_assistant_id": "64b7f4d9e2b3b6a0b7c5d80a",
"warehouse_id": "64b7f4d9e2b3b6a0b7c5d80a",
"currency_id": "64b7f4d9e2b3b6a0b7c5d80a",
"note": "This is a note",
"orders": [
{
"order_id": "64b7f4d9e2b3b6a0b7c5d80a",
"products": []
}
],
"additional_costs": [
{
"cost_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"customer_id": "64b7f4d9e2b3b6a0b7c5d80a",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80a",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80a",
"person_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"is_auto_income": true,
"contract_id": "64b7f4d9e2b3b6a0b7c5d80a",
"discounts": [
{
"is_custom": true,
"value": 0,
"apply_type": "percent"
}
]
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /purchase/create.
POST /purchase/get-paging
Get purchase by paging
Kerakli ruxsat: purchase · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/purchase/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/purchase/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/purchase/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/purchase/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 | search string to filter by code or name |
states | string[] | Yo‘q | list of states to filter by state |
organization_id | string | Yo‘q | organization id to filter by organization |
responsible_id | string | Yo‘q | responsible id to filter by responsible |
date_from | string (date-time) | Yo‘q | date from to filter by date |
date_to | string (date-time) | Yo‘q | date to to filter by date |
is_fully_income | boolean | Yo‘q | is fully income to filter by fully income |
is_fully_refunded | boolean | Yo‘q | is fully refunded to filter by fully refunded |
has_any_income | boolean | Yo‘q | has any income to filter by any income |
contract_id | string | Yo‘q | contract id to filter by contract |
income_states | string[] | Yo‘q | list of states to filter by income state |
refund_states | string[] | Yo‘q | list of states to filter by refunded state |
currency_id | string | Yo‘q | currency id to filter by currency |
updated_at | string (date-time) | Yo‘q | updated at from to filter by updated at |
total_from | number | Yo‘q | total from to filter by total |
total_to | number | Yo‘q | total to to filter by total |
is_auto_create | boolean | Yo‘q | is auto created to filter by auto created |
supplier_id | string | Yo‘q |
{
"page": 1,
"limit": 20,
"search": "string",
"states": [
"canceled"
],
"organization_id": "string",
"responsible_id": "string",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z",
"is_fully_income": false,
"is_fully_refunded": false,
"has_any_income": false,
"contract_id": "string",
"income_states": [
"zero"
],
"refund_states": [
"zero"
],
"currency_id": "string",
"updated_at": "2025-05-01T12:00:00Z",
"total_from": 0,
"total_to": 0,
"is_auto_create": false,
"supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
code | string | |
message | string | |
status_code | number | status code of response. Standart: 200 |
messages | object | |
messages.uz | string | |
messages.ru | string | |
messages.en | string | |
time | string (date-time) | time of response |
created_at | string (date-time) | |
updated_at | string (date-time) | |
number | string | |
organization_id | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
state | string | |
date | string (date-time) | |
income_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 | |
total_amount | number | |
total_cost | number | |
is_fully_income | boolean | |
total_income | number | |
total_refunded | number | |
is_fully_refunded | boolean | |
contract | object | |
contract._id | string | |
contract.name | string | |
contract.code | string | |
contract.number | string | |
contract.currency_id | string | |
contract.organization_id | string | |
contract.amount | number | |
contract.date | string (date-time) | |
contract.expire_date | string (date-time) | |
contract.person_id | string | |
contract.note | string | |
contract.is_active | boolean | |
contract.contract_number | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"code": "string",
"message": "Success",
"status_code": 200,
"messages": {
"uz": "Muvaffaqiyatli",
"ru": "Успешно",
"en": "Successful"
},
"time": "2025-05-01T12:00:00Z",
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"number": "string",
"organization_id": "string",
"organization": {
"_id": "string",
"name": "string"
},
"state": "string",
"date": "2025-05-01T12:00:00Z",
"income_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",
"total_amount": 0,
"total_cost": 0,
"is_fully_income": false,
"total_income": 0,
"total_refunded": 0,
"is_fully_refunded": false,
"contract": {
"_id": "string",
"name": "string",
"code": "string",
"number": "string",
"currency_id": "string",
"organization_id": "string",
"amount": 0,
"date": "2025-05-01T12:00:00Z",
"expire_date": "2025-05-01T12:00:00Z",
"person_id": "string",
"note": "string",
"is_active": false,
"contract_number": "string"
}
},
"time": "2025-05-01T12:00:00Z"
}GET /purchase/get-by-id/{id}
Get purchase using its _id
Kerakli ruxsat: purchase · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/purchase/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/purchase/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/purchase/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/purchase/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 /purchase/create.
PUT /purchase/set-state
setState purchase
Kerakli ruxsat: purchase_update · ruxsatlar qanday ishlaydi
Hujjatni bekor qiladigan ilova purchase_cancel ruxsatini ham so‘rasin.
So‘rov namunasi
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/purchase/set-state' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"state": "new",
"_id": "64b7f4d9e2b3b6a0b7c5d80a"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/purchase/set-state', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"state": "new",
"_id": "64b7f4d9e2b3b6a0b7c5d80a"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/purchase/set-state",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"state": "new",
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"state": "new",
"_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/purchase/set-state');
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 | |
state | string | Ha | Mumkin qiymatlar: canceled, new, done, in_progress, draft |
cancel_extra_cost | boolean | Yo‘q | cancel extra costs when canceling the purchase. Standart: false |
with_transactions | boolean | Yo‘q | cancel transactions when canceling the purchase. Standart: false |
state_id | string | Yo‘q |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new",
"cancel_extra_cost": false,
"with_transactions": false,
"state_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /purchase/create.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.