Skip to content

Person ​

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 /person/get-by-id/{id} ​

Fetch a single person by ObjectId. Legal and natural persons are both stored as persons; the response is the aggregated legal- or natural-person record depending on the stored type.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

MaydonTurTavsif
numbernumber
typestring
namestring
short_namestring
statusstringMumkin qiymatlar: active, inactive
phone_numberstring
telegram_linkstring
emailstring
web_sitestring
addressstring
codestring
postal_codestring
innstring
imagestring
locationobject
is_customerboolean
is_supplierboolean
is_defaultboolean
updated_by_userobject
updated_by_user._idstring
updated_by_user.full_namestring
created_by_userobject
created_by_user._idstring
created_by_user.full_namestring
ownerobject
owner._idstring
owner.namestring
owner.short_namestring
managerobject
manager._idstring
manager.first_namestring
manager.last_namestring
created_atstring (date-time)
updated_atstring (date-time)
balancenumber
balance_listobject[]
total_balancenumber
customerobject
customer._idstring
customer.namestring
employeeobject
employee._idstring
employee.namestring
supplierobject
supplier._idstring
supplier.namestring
delivery_addressstring
responsible_idstring
responsibleobject
responsible._idstring
responsible.full_namestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "number": 0,
    "type": "string",
    "name": "string",
    "short_name": "string",
    "status": "active",
    "phone_number": "string",
    "telegram_link": "string",
    "email": "string",
    "web_site": "string",
    "address": "string",
    "code": "string",
    "postal_code": "string",
    "inn": "string",
    "image": "string",
    "location": {},
    "is_customer": false,
    "is_supplier": false,
    "is_default": false,
    "updated_by_user": {
      "_id": "string",
      "full_name": "string"
    },
    "created_by_user": {
      "_id": "string",
      "full_name": "string"
    },
    "owner": {
      "_id": "string",
      "name": "string",
      "short_name": "string"
    },
    "manager": {
      "_id": "string",
      "first_name": "string",
      "last_name": "string"
    },
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z",
    "balance": 0,
    "balance_list": [
      {}
    ],
    "total_balance": 0,
    "customer": {
      "_id": "string",
      "name": "string"
    },
    "employee": {
      "_id": "string",
      "name": "string"
    },
    "supplier": {
      "_id": "string",
      "name": "string"
    },
    "delivery_address": "string",
    "responsible_id": "string",
    "responsible": {
      "_id": "string",
      "full_name": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /person/balance/get-paging ​

Paginated list of persons WITH their balances per organization and currency. Filter by type, status, organization_id and balance_type. Use /person/get-paging for a plain list without balance aggregation — it is considerably cheaper.

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
typestringYo‘qMumkin qiymatlar: legal, natural
statusstringYo‘qMumkin qiymatlar: active, inactive
organization_idstringYo‘q
balance_typestringYo‘qFilter by balance state.. Mumkin qiymatlar: debt, credit, zero, not_zero
json
{
  "page": 1,
  "limit": 20,
  "type": "legal",
  "status": "active",
  "organization_id": "63f8b0c4e4b0d3a2f8e4b0c4",
  "balance_type": "not_zero"
}

Javob

data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.

MaydonTurTavsif
_idstring
namestring
last_namestring
first_namestring
typeboolean
person_idstring
phone_numberstring
statusstringMumkin qiymatlar: active, inactive
codestring
balance_listobject[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "string",
        "name": "string",
        "last_name": "string",
        "first_name": "string",
        "type": false,
        "person_id": "string",
        "phone_number": "string",
        "status": "active",
        "code": "string",
        "balance_list": [
          {}
        ]
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /person/get-paging ​

Paginated list of persons — the shared identity record behind customers, suppliers and employees. Returns a light projection (_id, name, first_name, last_name, type, phone_number, status, code). Filter by type, status, organization_id/organization_ids, is_customer, is_supplier, or free-text search. Use /person/balance/get-paging when balances are needed.

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
searchstringYo‘qFree-text search over name / phone number / code.
typestringYo‘qFilter by person type.. Mumkin qiymatlar: legal, natural
statusstringYo‘qFilter by person status.. Mumkin qiymatlar: active, inactive
organization_idstringYo‘qRestrict to persons attached to this organization.
organization_idsstring[]Yo‘qRestrict to persons attached to any of these organizations.
is_customerbooleanYo‘qKeep only persons that are also customers.
is_supplierbooleanYo‘qKeep only persons that are also suppliers.
json
{
  "page": 1,
  "limit": 20,
  "search": "string",
  "type": "natural",
  "status": "active",
  "organization_id": "63f8b0c4e4b0d3a2f8e4b0c4",
  "organization_ids": [
    "63f8b0c4e4b0d3a2f8e4b0c4"
  ],
  "is_customer": false,
  "is_supplier": false
}

Javob

data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.

MaydonTurTavsif
_idstring
namestringDisplay name. For legal persons this is the company name; for natural persons the assembled full name.
first_namestring
last_namestring
typestringMumkin qiymatlar: legal, natural
phone_numberstring
statusstringMumkin qiymatlar: active, inactive
codestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "string",
        "name": "string",
        "first_name": "string",
        "last_name": "string",
        "type": "legal",
        "phone_number": "string",
        "status": "active",
        "code": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API