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
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
| Maydon | Tur | Tavsif |
|---|---|---|
number | number | |
type | string | |
name | string | |
short_name | string | |
status | string | Mumkin qiymatlar: active, inactive |
phone_number | string | |
telegram_link | string | |
email | string | |
web_site | string | |
address | string | |
code | string | |
postal_code | string | |
inn | string | |
image | string | |
location | object | |
is_customer | boolean | |
is_supplier | boolean | |
is_default | boolean | |
updated_by_user | object | |
updated_by_user._id | string | |
updated_by_user.full_name | string | |
created_by_user | object | |
created_by_user._id | string | |
created_by_user.full_name | string | |
owner | object | |
owner._id | string | |
owner.name | string | |
owner.short_name | string | |
manager | object | |
manager._id | string | |
manager.first_name | string | |
manager.last_name | string | |
created_at | string (date-time) | |
updated_at | string (date-time) | |
balance | number | |
balance_list | object[] | |
total_balance | number | |
customer | object | |
customer._id | string | |
customer.name | string | |
employee | object | |
employee._id | string | |
employee.name | string | |
supplier | object | |
supplier._id | string | |
supplier.name | string | |
delivery_address | string | |
responsible_id | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string |
{
"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
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
type | string | Yo‘q | Mumkin qiymatlar: legal, natural |
status | string | Yo‘q | Mumkin qiymatlar: active, inactive |
organization_id | string | Yo‘q | |
balance_type | string | Yo‘q | Filter by balance state.. Mumkin qiymatlar: debt, credit, zero, not_zero |
{
"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.
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
name | string | |
last_name | string | |
first_name | string | |
type | boolean | |
person_id | string | |
phone_number | string | |
status | string | Mumkin qiymatlar: active, inactive |
code | string | |
balance_list | object[] |
{
"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
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
search | string | Yo‘q | Free-text search over name / phone number / code. |
type | string | Yo‘q | Filter by person type.. Mumkin qiymatlar: legal, natural |
status | string | Yo‘q | Filter by person status.. Mumkin qiymatlar: active, inactive |
organization_id | string | Yo‘q | Restrict to persons attached to this organization. |
organization_ids | string[] | Yo‘q | Restrict to persons attached to any of these organizations. |
is_customer | boolean | Yo‘q | Keep only persons that are also customers. |
is_supplier | boolean | Yo‘q | Keep only persons that are also suppliers. |
{
"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.
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
name | string | Display name. For legal persons this is the company name; for natural persons the assembled full name. |
first_name | string | |
last_name | string | |
type | string | Mumkin qiymatlar: legal, natural |
phone_number | string | |
status | string | Mumkin qiymatlar: active, inactive |
code | string |
{
"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.