Skip to content
Markdown

Customer ​

INFO

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

POST /customer/create ​

This method allows adding customer into the account.

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/customer/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "legal",
  "name": "string",
  "organization_ids": [
    "string"
  ]
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/customer/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "type": "legal",
    "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/customer/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "type": "legal",
        "name": "string",
        "organization_ids": [
            "string",
        ],
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "type": "legal",
  "name": "string",
  "organization_ids": [
    "string"
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/customer/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Да
typestringДаtype customer. Допустимые значения: legal, natural
category_idstringНет
innstringНет
director_namestringНет
addressstringНет
delivery_addressobjectНет
delivery_address.longnumberНет
delivery_address.latnumberНет
delivery_address.human_addressobjectНет
delivery_address.human_address.addressstringНетПо умолчанию: "string"
delivery_address.human_address.citystringНетПо умолчанию: "string"
delivery_address.human_address.statestringНетПо умолчанию: "string"
delivery_address.human_address.zipstringНетПо умолчанию: "string"
delivery_address.bearingnumberНет
bank_namestringНет
agent_idstringНет
responsible_idstringНет
account_numberstringНет
mfostringНет
loyalty_card_idstringНет
qqs_numberstringНет
phone_numberstringНет
phone_numbersstring[]Нет
company_phone_numberstringНет
descriptionstringНет
organization_idsstring[]Да
debt_limitsobjectНет
debt_limits.organization_idstringДа
debt_limits.limitnumberНет
person_idstringНет
okedstringНет
genderstringНетДопустимые значения: male, female
imagestringНет
last_namestringНет
middle_namestringНет
birth_datestringНет
legal_person_idstringНет
telegram_linkstringНет
is_supplierbooleanНетПо умолчанию: false
statusstringНетДопустимые значения: active, inactive
short_namestringНет
web_sitestringНет
codestringНет
postal_codestringНет
owner_idstringНет
manager_idstringНет
custom_fieldsobjectНет
custom_fields._idstringДа
custom_fields.valueanyНет
b2c_idstringНет
emailstringНет
telegram_idnumberНет
json
{
  "name": "string",
  "type": "legal",
  "category_id": "string",
  "inn": "string",
  "director_name": "string",
  "address": "string",
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "bearing": 0
  },
  "bank_name": "string",
  "agent_id": "string",
  "responsible_id": "string",
  "account_number": "string",
  "mfo": "string",
  "loyalty_card_id": "string",
  "qqs_number": "string",
  "phone_number": "string",
  "phone_numbers": [
    "string"
  ],
  "company_phone_number": "string",
  "description": "string",
  "organization_ids": [
    "string"
  ],
  "debt_limits": {
    "organization_id": "string",
    "limit": 0
  },
  "person_id": "string",
  "oked": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "is_supplier": false,
  "status": "active",
  "short_name": "string",
  "web_site": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "string",
  "manager_id": "string",
  "custom_fields": {
    "_id": "string",
    "value": null
  },
  "b2c_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "email": "string",
  "telegram_id": 0
}

Ответ

ПолеТипОписание
_idstringid of customer
created_atstring
updated_atstring
namestring
typestring
innstring
director_namestring
addressstring
bank_namestring
account_numberstring
pinflstring
director_pinflstring
mfostring
okedstring
qqs_numberstring
phone_numberstring
phone_numbersstring[]
company_phone_numberstring
descriptionstring
organization_idsstring[]
last_sale_atstring
first_sale_atstring
total_salenumber
avg_salenumber
pointnumber
balancenumber
balance_currency_idstring
balancesobject
balances.balancenumber
balances.balance_currency_idstring
balance_listobject[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "created_at": "string",
    "updated_at": "string",
    "name": "string",
    "type": "string",
    "inn": "string",
    "director_name": "string",
    "address": "string",
    "bank_name": "string",
    "account_number": "string",
    "pinfl": "string",
    "director_pinfl": "string",
    "mfo": "string",
    "oked": "string",
    "qqs_number": "string",
    "phone_number": "string",
    "phone_numbers": [
      "string"
    ],
    "company_phone_number": "string",
    "description": "string",
    "organization_ids": [
      "string"
    ],
    "last_sale_at": "string",
    "first_sale_at": "string",
    "total_sale": 0,
    "avg_sale": 0,
    "point": 0,
    "balance": 0,
    "balance_currency_id": "string",
    "balances": {
      "balance": 0,
      "balance_currency_id": "string"
    },
    "balance_list": [
      {}
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /customer/update ​

This method allows updating customer in the account.

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

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

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/customer/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "organization_ids": [
    "string"
  ],
  "_id": "string"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/customer/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "organization_ids": [
      "string"
    ],
    "_id": "string"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/customer/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "organization_ids": [
            "string",
        ],
        "_id": "string",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string",
  "organization_ids": [
    "string"
  ],
  "_id": "string"
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
namestringДа
category_idstringНет
innstringНет
director_namestringНет
addressstringНет
delivery_addressobjectНет
delivery_address.longnumberНет
delivery_address.latnumberНет
delivery_address.human_addressobjectНет
delivery_address.human_address.addressstringНетПо умолчанию: "string"
delivery_address.human_address.citystringНетПо умолчанию: "string"
delivery_address.human_address.statestringНетПо умолчанию: "string"
delivery_address.human_address.zipstringНетПо умолчанию: "string"
delivery_address.bearingnumberНет
bank_namestringНет
agent_idstringНет
responsible_idstringНет
account_numberstringНет
mfostringНет
loyalty_card_idstringНет
qqs_numberstringНет
phone_numberstringНет
phone_numbersstring[]Нет
company_phone_numberstringНет
descriptionstringНет
organization_idsstring[]Да
debt_limitsobjectНет
debt_limits.organization_idstringДа
debt_limits.limitnumberНет
okedstringНет
genderstringНетДопустимые значения: male, female
imagestringНет
last_namestringНет
middle_namestringНет
birth_datestringНет
legal_person_idstringНет
telegram_linkstringНет
statusstringНетДопустимые значения: active, inactive
short_namestringНет
web_sitestringНет
codestringНет
postal_codestringНет
owner_idstringНет
manager_idstringНет
custom_fieldsobjectНет
custom_fields._idstringДа
custom_fields.valueanyНет
_idstringДаid of customer
emailstringНет
telegram_idnumberНет
json
{
  "name": "string",
  "category_id": "string",
  "inn": "string",
  "director_name": "string",
  "address": "string",
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "bearing": 0
  },
  "bank_name": "string",
  "agent_id": "string",
  "responsible_id": "string",
  "account_number": "string",
  "mfo": "string",
  "loyalty_card_id": "string",
  "qqs_number": "string",
  "phone_number": "string",
  "phone_numbers": [
    "string"
  ],
  "company_phone_number": "string",
  "description": "string",
  "organization_ids": [
    "string"
  ],
  "debt_limits": {
    "organization_id": "string",
    "limit": 0
  },
  "oked": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "status": "active",
  "short_name": "string",
  "web_site": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "string",
  "manager_id": "string",
  "custom_fields": {
    "_id": "string",
    "value": null
  },
  "_id": "string",
  "email": "string",
  "telegram_id": 0
}

Ответ

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

DELETE /customer/delete/{id} ​

Delete a customer

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

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

bash
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/customer/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/customer/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/customer/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/customer/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 /customer/get-by-id/{id} ​

Get customer using its _id

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

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

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

POST /customer/get-paging ​

Get customers by paging

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/customer/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/customer/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/customer/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/customer/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
updated_atstringНет
organization_idstringНет
searchstringНет
phone_numberstringНет
is_debtbooleanНет
balance_typestringНетДопустимые значения: debt, credit, not_zero, zero
statesstring[]Нет
organization_idsstring[]НетOrganization ObjectIds.
ninstring[]Нет
category_idstringНет
typestringНетДопустимые значения: legal, natural
last_sale_fromstring (date-time)Нет
last_sale_tostring (date-time)Нет
this_rangebooleanНет
first_sale_fromstring (date-time)Нет
first_sale_tostring (date-time)Нет
responsible_idstringНет
json
{
  "page": 1,
  "limit": 20,
  "updated_at": "string",
  "organization_id": "string",
  "search": "string",
  "phone_number": "string",
  "is_debt": false,
  "balance_type": "debt",
  "states": [
    "new"
  ],
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "nin": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "type": "legal",
  "last_sale_from": "2025-05-01T12:00:00Z",
  "last_sale_to": "2025-05-01T12:00:00Z",
  "this_range": false,
  "first_sale_from": "2025-05-01T12:00:00Z",
  "first_sale_to": "2025-05-01T12:00:00Z",
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}

Ответ

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

ПолеТипОписание
_idstringid of customer
created_atstring
updated_atstring
namestring
typestring
innstring
director_namestring
addressstring
bank_namestring
account_numberstring
pinflstring
director_pinflstring
mfostring
okedstring
qqs_numberstring
phone_numberstring
phone_numbersstring[]
company_phone_numberstring
descriptionstring
organization_idsstring[]
last_sale_atstring
first_sale_atstring
total_salenumber
avg_salenumber
pointnumber
balancenumber
balance_currency_idstring
balancesobject
balances.balancenumber
balances.balance_currency_idstring
balance_listobject[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "string",
        "created_at": "string",
        "updated_at": "string",
        "name": "string",
        "type": "string",
        "inn": "string",
        "director_name": "string",
        "address": "string",
        "bank_name": "string",
        "account_number": "string",
        "pinfl": "string",
        "director_pinfl": "string",
        "mfo": "string",
        "oked": "string",
        "qqs_number": "string",
        "phone_number": "string",
        "phone_numbers": [
          "string"
        ],
        "company_phone_number": "string",
        "description": "string",
        "organization_ids": [
          "string"
        ],
        "last_sale_at": "string",
        "first_sale_at": "string",
        "total_sale": 0,
        "avg_sale": 0,
        "point": 0,
        "balance": 0,
        "balance_currency_id": "string",
        "balances": {
          "balance": 0,
          "balance_currency_id": "string"
        },
        "balance_list": [
          {}
        ]
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /customer/get-deleted ​

Get deleted customer ids

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

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

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/customer/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/customer/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/customer/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/customer/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"
}

PUT /customer/set-state ​

setState customer

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

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

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/customer/set-state' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "state": "new",
  "_id": "64b7f4d9e2b3b6a0b7c5d80a"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/customer/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()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/customer/set-state",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "state": "new",
        "_id": "64b7f4d9e2b3b6a0b7c5d80a",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "state": "new",
  "_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
statestringДаДопустимые значения: black_list, new, active, warning
json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a",
  "state": "new"
}

Ответ

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

GET /customer/get-by-phone-number ​

Find a customer by phone number.

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

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

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/customer/get-by-phone-number?phone_number=%2B998901234567' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/customer/get-by-phone-number?phone_number=%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/customer/get-by-phone-number?phone_number=%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/customer/get-by-phone-number?phone_number=%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);

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

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

Тело запроса

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

Ответ

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


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

Bito 2.0 Integration API