Supplier
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
GET /supplier/get-by-id/{id}
Get supplier using its _id
Kerakli ruxsat: supplier · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/supplier/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/supplier/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/supplier/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/supplier/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
| Maydon | Tur | Tavsif |
|---|---|---|
name | string | |
number | number | |
type | string | |
parent_id | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"name": "string",
"number": 0,
"type": "string",
"parent_id": "string"
},
"time": "2025-05-01T12:00:00Z"
}POST /supplier/get-paging
Get suppliers by paging
Kerakli ruxsat: supplier · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/supplier/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/supplier/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/supplier/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/supplier/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 | |
category_id | string | Yo‘q | |
updated_at | string (date-time) | Yo‘q | |
organization_id | string | Yo‘q | Organization ObjectId. |
organization_ids | string | Yo‘q | Organization ObjectIds. |
type | string | Yo‘q | Mumkin qiymatlar: legal, natural |
balance_type | string | Yo‘q | Mumkin qiymatlar: debt, credit, not_zero, zero |
balance_action | string | Yo‘q | Mumkin qiymatlar: merged, separated |
search_by | string | Yo‘q | Mumkin qiymatlar: inn, phone_number, name, full_name, first_name, email, passport_number, number |
balance_at | string (date-time) | Yo‘q | |
tag_ids | string[] | Yo‘q | |
supplier_ids | string[] | Yo‘q | |
sort_by | string | Yo‘q | Field name to sort by. |
asc | integer | Yo‘q | Sort direction: 1 ascending, -1 descending.. Mumkin qiymatlar: -1, 1 |
{
"page": 1,
"limit": 20,
"search": "string",
"category_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"updated_at": "2024-07-20T10:30:00Z",
"organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"organization_ids": "64b7f4d9e2b3b6a0b7c5d7ff",
"type": "legal",
"balance_type": "debt",
"balance_action": "merged",
"search_by": "inn",
"balance_at": "2025-05-01T12:00:00Z",
"tag_ids": [
"64b7f4d9e2b3b6a0b7c5d7ff"
],
"supplier_ids": [
"64b7f4d9e2b3b6a0b7c5d7ff"
],
"sort_by": "string",
"asc": -1
}Javob
data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.
| Maydon | Tur | Tavsif |
|---|---|---|
completely_deleted | boolean | |
is_deleted | boolean | |
created_at | string (date-time) | |
director_name | string | |
name | string | |
phone_number | string | |
refund_count | number | |
sale_count | number | |
total_sale | number | |
first_sale_at | string (date-time) | |
last_sale_at | string (date-time) | |
type | string | |
updatedAt | string (date-time) | |
updated_at | string (date-time) | |
total_balance | number | |
balance | number | |
balance_currency_id | string | |
address | string | |
inn | string | |
comment | string | |
avg_product | number | |
avg_sale | number | |
total_spent | number | |
category | object | |
category._id | string | |
category.name | string | |
note | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"completely_deleted": false,
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"director_name": "string",
"name": "string",
"phone_number": "string",
"refund_count": 0,
"sale_count": 0,
"total_sale": 0,
"first_sale_at": "2025-05-01T12:00:00Z",
"last_sale_at": "2025-05-01T12:00:00Z",
"type": "string",
"updatedAt": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"total_balance": 0,
"balance": 0,
"balance_currency_id": "string",
"address": "string",
"inn": "string",
"comment": "string",
"avg_product": 0,
"avg_sale": 0,
"total_spent": 0,
"category": {
"_id": "string",
"name": "string"
},
"note": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}POST /supplier/update
Update a supplier.
Kerakli ruxsat: supplier_update · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/supplier/update' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"name": "string",
"organization_ids": [
"string"
]
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/supplier/update', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"name": "string",
"organization_ids": [
"string"
]
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/supplier/update",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"name": "string",
"organization_ids": [
"string",
],
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"name": "string",
"organization_ids": [
"string"
]
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/supplier/update');
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 |
|---|---|---|---|
_id | string | Ha | |
name | string | Ha | |
phone_number | string | Yo‘q | |
phone_numbers | string[] | Yo‘q | |
email | string | Yo‘q | |
inn | string | Yo‘q | |
address | string | Yo‘q | |
note | string | Yo‘q | |
category_id | string | Yo‘q | |
responsible_id | string | Yo‘q | |
organization_ids | string[] | Ha | |
first_name | string | Yo‘q | |
director_name | string | Yo‘q | |
mfo | string | Yo‘q | |
fax | string | Yo‘q | |
bank_name | string | Yo‘q | |
card_number | string | Yo‘q | |
qqs_number | string | Yo‘q | |
oked | string | Yo‘q | |
comment | string | Yo‘q | |
person_id | string | Yo‘q | |
gender | string | Yo‘q | Mumkin qiymatlar: male, female |
image | string | Yo‘q | |
last_name | string | Yo‘q | |
middle_name | string | Yo‘q | |
birth_date | string (date-time) | Yo‘q | |
legal_person_id | string | Yo‘q | |
telegram_link | string | Yo‘q | |
status | string | Yo‘q | Mumkin qiymatlar: active, inactive |
short_name | string | Yo‘q | |
web_site | string | Yo‘q | |
code | string | Yo‘q | |
postal_code | string | Yo‘q | |
owner_id | string | Yo‘q | |
manager_id | string | Yo‘q | |
delivery_address | object | Yo‘q | |
delivery_address.long | number | Yo‘q | |
delivery_address.lat | number | Yo‘q | |
delivery_address.human_address | object | Yo‘q | |
delivery_address.human_address.address | string | Yo‘q | |
delivery_address.human_address.city | string | Yo‘q | |
delivery_address.human_address.state | string | Yo‘q | |
delivery_address.human_address.zip | string | Yo‘q | |
delivery_address.bearing | number | Yo‘q | |
locale | string | Yo‘q | Mumkin qiymatlar: uz, uz_cyrillic, ru, en, kk, tg, ky |
tag_ids | string[] | Yo‘q | |
attachments | object[] | Yo‘q | |
attachments[].name | string | Yo‘q | |
attachments[].path | string | Ha | |
attachments[].size | number | Yo‘q | |
attachments[].note | string | Yo‘q | |
opening_balance | object | Yo‘q | |
opening_balance.amount | number | Ha | |
opening_balance.currency_id | string | Ha | |
opening_balance.organization_id | string | Ha | Organization ObjectId. |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"name": "string",
"phone_number": "string",
"phone_numbers": [
"string"
],
"email": "string",
"inn": "string",
"address": "string",
"note": "string",
"category_id": "string",
"responsible_id": "string",
"organization_ids": [
"string"
],
"first_name": "string",
"director_name": "string",
"mfo": "string",
"fax": "string",
"bank_name": "string",
"card_number": "string",
"qqs_number": "string",
"oked": "string",
"comment": "string",
"person_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"gender": "male",
"image": "string",
"last_name": "string",
"middle_name": "string",
"birth_date": "2025-05-01T12:00:00Z",
"legal_person_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"telegram_link": "string",
"status": "active",
"short_name": "string",
"web_site": "string",
"code": "string",
"postal_code": "string",
"owner_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"manager_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"delivery_address": {
"long": 0,
"lat": 0,
"human_address": {
"address": "string",
"city": "string",
"state": "string",
"zip": "string"
},
"bearing": 0
},
"locale": "uz",
"tag_ids": [
"64b7f4d9e2b3b6a0b7c5d7ff"
],
"attachments": [
{
"name": "string",
"path": "string",
"size": 0,
"note": "string"
}
],
"opening_balance": {
"amount": 0,
"currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"organization_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
}Javob
Javob tuzilishi quyidagi bilan bir xil: GET /supplier/get-by-id/{id}.
GET /supplier/get-by-phone/{phone_number}
Find a supplier by phone number.
Kerakli ruxsat: supplier · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/supplier/get-by-phone/%2B998901234567' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/supplier/get-by-phone/%2B998901234567', {
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/supplier/get-by-phone/%2B998901234567",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/supplier/get-by-phone/%2B998901234567');
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 |
|---|---|---|---|
phone_number | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: GET /supplier/get-by-id/{id}.
POST /supplier/create
Create a supplier. name and organization_ids (at least one) are required. Conditional fields depend on type: legal persons use short_name / web_site / code / postal_code / owner_id / manager_id, natural persons use last_name / middle_name / birth_date / gender / legal_person_id. Returns the created supplier.
Kerakli ruxsat: supplier_create · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/supplier/create' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"organization_ids": [
"64b7f4d9e2b3b6a0b7c5d80a"
]
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/supplier/create', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "string",
"organization_ids": [
"64b7f4d9e2b3b6a0b7c5d80a"
]
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/supplier/create",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"name": "string",
"organization_ids": [
"64b7f4d9e2b3b6a0b7c5d80a",
],
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"name": "string",
"organization_ids": [
"64b7f4d9e2b3b6a0b7c5d80a"
]
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/supplier/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 |
|---|---|---|---|
name | string | Ha | Supplier name (required). For a legal person this is the company name; for a natural person the display name. |
type | string | Yo‘q | Person type. Drives which of the conditional field groups below apply. Defaults to the backend default when omitted.. Mumkin qiymatlar: legal, natural |
organization_ids | string[] | Ha | Organizations the supplier is available in (required, at least one). |
first_name | string | Yo‘q | |
last_name | string | Yo‘q | Natural persons only. |
middle_name | string | Yo‘q | Natural persons only. |
birth_date | string (date-time) | Yo‘q | Natural persons only. |
gender | string | Yo‘q | Natural persons only.. Mumkin qiymatlar: male, female |
short_name | string | Yo‘q | Legal persons only. |
web_site | string | Yo‘q | Legal persons only. |
code | string | Yo‘q | Legal persons only. |
postal_code | string | Yo‘q | Legal persons only. |
owner_id | string | Yo‘q | Legal persons only — owning person ObjectId. |
manager_id | string | Yo‘q | Legal persons only — manager person ObjectId. |
phone_number | string | Yo‘q | Primary phone number in international format. |
phone_numbers | string[] | Yo‘q | Additional phone numbers. Must be unique. |
fax | string | Yo‘q | |
email | string | Yo‘q | |
telegram_link | string | Yo‘q | |
inn | string | Yo‘q | Taxpayer INN. Validated for format. |
qqs_number | string | Yo‘q | VAT registration number. |
oked | string | Yo‘q | |
director_name | string | Yo‘q | |
bank_name | string | Yo‘q | |
mfo | string | Yo‘q | |
card_number | string | Yo‘q | Validated as a credit-card number. |
address | string | Yo‘q | |
delivery_address | object | Yo‘q | Location object (lat/lng + address). |
category_id | string | Yo‘q | |
person_id | string | Yo‘q | Link to an existing person record instead of creating a new one. |
responsible_id | string | Yo‘q | |
legal_person_id | string | Yo‘q | Natural persons only — the legal person they represent. |
status | string | Yo‘q | Mumkin qiymatlar: active, inactive |
is_customer | boolean | Yo‘q | Also register this person as a customer. |
locale | string | Yo‘q | Mumkin qiymatlar: uz, ru, en, kk, ky, tg |
comment | string | Yo‘q | |
note | string | Yo‘q | |
image | string | Yo‘q | |
tag_ids | string[] | Yo‘q | |
attachments | object[] | Yo‘q | Attached files: { name, path, size, note }. |
opening_balance | object | Yo‘q | |
opening_balance.amount | number | Ha | |
opening_balance.currency_id | string | Ha | |
opening_balance.organization_id | string | Ha | Organization ObjectId. |
{
"name": "string",
"type": "legal",
"organization_ids": [
"64b7f4d9e2b3b6a0b7c5d80a"
],
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"birth_date": "2025-05-01T12:00:00Z",
"gender": "male",
"short_name": "string",
"web_site": "string",
"code": "string",
"postal_code": "string",
"owner_id": "string",
"manager_id": "string",
"phone_number": "string",
"phone_numbers": [
"string"
],
"fax": "string",
"email": "string",
"telegram_link": "string",
"inn": "string",
"qqs_number": "string",
"oked": "string",
"director_name": "string",
"bank_name": "string",
"mfo": "string",
"card_number": "string",
"address": "string",
"delivery_address": {},
"category_id": "string",
"person_id": "string",
"responsible_id": "string",
"legal_person_id": "string",
"status": "active",
"is_customer": false,
"locale": "uz",
"comment": "string",
"note": "string",
"image": "string",
"tag_ids": [
"string"
],
"attachments": [
{}
],
"opening_balance": {
"amount": 0,
"currency_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"organization_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
}Javob
Javob tuzilishi quyidagi bilan bir xil: GET /supplier/get-by-id/{id}.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.