Skip to content
View as Markdown

Supplier ​

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.

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

Get supplier using its _id

Required permission: supplier · how permissions work

Example request

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

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

FieldTypeDescription
namestring
numbernumber
typestring
parent_idstring
json
{
  "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

Required permission: supplier · how permissions work

Example request

bash
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
}'
js
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()
python
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
<?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);

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
searchstringNo
category_idstringNo
updated_atstring (date-time)No
organization_idstringNoOrganization ObjectId.
organization_idsstringNoOrganization ObjectIds.
typestringNoOne of: legal, natural
balance_typestringNoOne of: debt, credit, not_zero, zero
balance_actionstringNoOne of: merged, separated
search_bystringNoOne of: inn, phone_number, name, full_name, first_name, email, passport_number, number
balance_atstring (date-time)No
tag_idsstring[]No
supplier_idsstring[]No
sort_bystringNoField name to sort by.
ascintegerNoSort direction: 1 ascending, -1 descending.. One of: -1, 1
json
{
  "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
}

Response

data.total is the total number of records and data.data[] holds the current page. The table below describes one record.

FieldTypeDescription
completely_deletedboolean
is_deletedboolean
created_atstring (date-time)
director_namestring
namestring
phone_numberstring
refund_countnumber
sale_countnumber
total_salenumber
first_sale_atstring (date-time)
last_sale_atstring (date-time)
typestring
updatedAtstring (date-time)
updated_atstring (date-time)
total_balancenumber
balancenumber
balance_currency_idstring
addressstring
innstring
commentstring
avg_productnumber
avg_salenumber
total_spentnumber
categoryobject
category._idstring
category.namestring
notestring
json
{
  "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.

Required permission: supplier_update · how permissions work

Example request

bash
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"
  ]
}'
js
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()
python
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
<?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);

Request body

FieldTypeRequiredDescription
_idstringYes
namestringYes
phone_numberstringNo
phone_numbersstring[]No
emailstringNo
innstringNo
addressstringNo
notestringNo
category_idstringNo
responsible_idstringNo
organization_idsstring[]Yes
first_namestringNo
director_namestringNo
mfostringNo
faxstringNo
bank_namestringNo
card_numberstringNo
qqs_numberstringNo
okedstringNo
commentstringNo
person_idstringNo
genderstringNoOne of: male, female
imagestringNo
last_namestringNo
middle_namestringNo
birth_datestring (date-time)No
legal_person_idstringNo
telegram_linkstringNo
statusstringNoOne of: active, inactive
short_namestringNo
web_sitestringNo
codestringNo
postal_codestringNo
owner_idstringNo
manager_idstringNo
delivery_addressobjectNo
delivery_address.longnumberNo
delivery_address.latnumberNo
delivery_address.human_addressobjectNo
delivery_address.human_address.addressstringNo
delivery_address.human_address.citystringNo
delivery_address.human_address.statestringNo
delivery_address.human_address.zipstringNo
delivery_address.bearingnumberNo
localestringNoOne of: uz, uz_cyrillic, ru, en, kk, tg, ky
tag_idsstring[]No
attachmentsobject[]No
attachments[].namestringNo
attachments[].pathstringYes
attachments[].sizenumberNo
attachments[].notestringNo
opening_balanceobjectNo
opening_balance.amountnumberYes
opening_balance.currency_idstringYes
opening_balance.organization_idstringYesOrganization ObjectId.
json
{
  "_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"
  }
}

Response

Same response shape as GET /supplier/get-by-id/{id}.

GET /supplier/get-by-phone/{phone_number} ​

Find a supplier by phone number.

Required permission: supplier · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/supplier/get-by-phone/%2B998901234567' \
  -H "api-key: $BITO_API_KEY"
js
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()
python
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
<?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);

Path parameters

ParameterTypeRequiredDescription
phone_numberstringYes

Request body

No request body.

Response

Same response shape as 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.

Required permission: supplier_create · how permissions work

Example request

bash
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"
  ]
}'
js
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()
python
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
<?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);

Request body

FieldTypeRequiredDescription
namestringYesSupplier name (required). For a legal person this is the company name; for a natural person the display name.
typestringNoPerson type. Drives which of the conditional field groups below apply. Defaults to the backend default when omitted.. One of: legal, natural
organization_idsstring[]YesOrganizations the supplier is available in (required, at least one).
first_namestringNo
last_namestringNoNatural persons only.
middle_namestringNoNatural persons only.
birth_datestring (date-time)NoNatural persons only.
genderstringNoNatural persons only.. One of: male, female
short_namestringNoLegal persons only.
web_sitestringNoLegal persons only.
codestringNoLegal persons only.
postal_codestringNoLegal persons only.
owner_idstringNoLegal persons only — owning person ObjectId.
manager_idstringNoLegal persons only — manager person ObjectId.
phone_numberstringNoPrimary phone number in international format.
phone_numbersstring[]NoAdditional phone numbers. Must be unique.
faxstringNo
emailstringNo
telegram_linkstringNo
innstringNoTaxpayer INN. Validated for format.
qqs_numberstringNoVAT registration number.
okedstringNo
director_namestringNo
bank_namestringNo
mfostringNo
card_numberstringNoValidated as a credit-card number.
addressstringNo
delivery_addressobjectNoLocation object (lat/lng + address).
category_idstringNo
person_idstringNoLink to an existing person record instead of creating a new one.
responsible_idstringNo
legal_person_idstringNoNatural persons only — the legal person they represent.
statusstringNoOne of: active, inactive
is_customerbooleanNoAlso register this person as a customer.
localestringNoOne of: uz, ru, en, kk, ky, tg
commentstringNo
notestringNo
imagestringNo
tag_idsstring[]No
attachmentsobject[]NoAttached files: { name, path, size, note }.
opening_balanceobjectNo
opening_balance.amountnumberYes
opening_balance.currency_idstringYes
opening_balance.organization_idstringYesOrganization ObjectId.
json
{
  "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"
  }
}

Response

Same response shape as GET /supplier/get-by-id/{id}.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API