Customer
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 /customer/create
This method allows adding customer into the account.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | |
type | string | Yo‘q | type customer. Mumkin qiymatlar: legal, natural |
category_id | string | Yo‘q | |
state | string | Yo‘q | Mumkin qiymatlar: new, warning, black_list, active |
inn | string | Yo‘q | |
director_name | string | Yo‘q | |
address | 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 | Standart: "string" |
delivery_address.human_address.city | string | Yo‘q | Standart: "string" |
delivery_address.human_address.state | string | Yo‘q | Standart: "string" |
delivery_address.human_address.zip | string | Yo‘q | Standart: "string" |
bank_name | string | Yo‘q | |
agent_id | string | Yo‘q | |
responsible_id | string | Yo‘q | |
account_number | string | Yo‘q | |
mfo | string | Yo‘q | |
loyalty_card_id | string | Yo‘q | |
qqs_number | string | Yo‘q | |
phone_number | string | Yo‘q | |
phone_numbers | string[] | Yo‘q | |
company_phone_number | string | Yo‘q | |
description | string | Yo‘q | |
organization_ids | string[] | Ha | |
debt_limits | object | Yo‘q | |
debt_limits.organization_id | string | Yo‘q | |
debt_limits.limit | number | Yo‘q | |
debt_limits.customer_id | string | Yo‘q | |
organization_id | string | Yo‘q | |
person_id | string | Yo‘q | |
oked | 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 | Yo‘q | |
legal_person_id | string | Yo‘q | |
telegram_link | string | Yo‘q | |
is_supplier | boolean | Yo‘q | Standart: false |
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 | |
custom_fields | object | Yo‘q | |
custom_fields._id | string | Yo‘q | |
custom_fields.value | any | Yo‘q |
{
"name": "string",
"type": "legal",
"category_id": "string",
"state": "new",
"inn": "string",
"director_name": "string",
"address": "string",
"delivery_address": {
"long": 0,
"lat": 0,
"human_address": {
"address": "string",
"city": "string",
"state": "string",
"zip": "string"
}
},
"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,
"customer_id": "string"
},
"organization_id": "string",
"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
}
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | id of customer |
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 | number | |
avg_sale | number | |
point | number | |
balance | number | |
balance_currency_id | string | |
balances | object | |
balances.balance | number | |
balances.balance_currency_id | string | |
balance_list | object[] |
{
"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.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | |
type | string | Yo‘q | type customer. Mumkin qiymatlar: legal, natural |
category_id | string | Yo‘q | |
state | string | Yo‘q | Mumkin qiymatlar: new, warning, black_list, active |
inn | string | Yo‘q | |
director_name | string | Yo‘q | |
address | 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 | Standart: "string" |
delivery_address.human_address.city | string | Yo‘q | Standart: "string" |
delivery_address.human_address.state | string | Yo‘q | Standart: "string" |
delivery_address.human_address.zip | string | Yo‘q | Standart: "string" |
bank_name | string | Yo‘q | |
agent_id | string | Yo‘q | |
responsible_id | string | Yo‘q | |
account_number | string | Yo‘q | |
mfo | string | Yo‘q | |
loyalty_card_id | string | Yo‘q | |
qqs_number | string | Yo‘q | |
phone_number | string | Yo‘q | |
phone_numbers | string[] | Yo‘q | |
company_phone_number | string | Yo‘q | |
description | string | Yo‘q | |
organization_ids | string[] | Ha | |
debt_limits | object | Yo‘q | |
debt_limits.organization_id | string | Yo‘q | |
debt_limits.limit | number | Yo‘q | |
debt_limits.customer_id | string | Yo‘q | |
organization_id | string | Yo‘q | |
person_id | string | Yo‘q | |
oked | 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 | Yo‘q | |
legal_person_id | string | Yo‘q | |
telegram_link | string | Yo‘q | |
is_supplier | boolean | Yo‘q | Standart: false |
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 | |
custom_fields | object | Yo‘q | |
custom_fields._id | string | Yo‘q | |
custom_fields.value | any | Yo‘q | |
_id | string | Ha | id of customer |
{
"name": "string",
"type": "legal",
"category_id": "string",
"state": "new",
"inn": "string",
"director_name": "string",
"address": "string",
"delivery_address": {
"long": 0,
"lat": 0,
"human_address": {
"address": "string",
"city": "string",
"state": "string",
"zip": "string"
}
},
"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,
"customer_id": "string"
},
"organization_id": "string",
"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
},
"_id": "string"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.
DELETE /customer/delete/{id}
Delete a customer
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"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
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.
POST /customer/get-paging
Get customers by paging
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
updated_at | string | Yo‘q | |
organization_id | string | Yo‘q | |
search | string | Yo‘q | |
phone_number | string | Yo‘q |
{
"page": 1,
"limit": 20,
"updated_at": "string",
"organization_id": "string",
"search": "string",
"phone_number": "string"
}Javob
data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | id of customer |
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 | number | |
avg_sale | number | |
point | number | |
balance | number | |
balance_currency_id | string | |
balances | object | |
balances.balance | number | |
balances.balance_currency_id | string | |
balance_list | object[] |
{
"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
So‘rov parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
deleted_at | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}PUT /customer/set-state
setState customer
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
_id | string | Ha | |
state | string | Ha | Mumkin qiymatlar: black_list, new, active, warning |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.
GET /customer/get-by-phone-number
Find a customer by phone number.
So‘rov parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
phone_number | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.