Customer
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.
POST /customer/create
This method allows adding customer into the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
type | string | No | type customer. One of: legal, natural |
category_id | string | No | |
state | string | No | One of: new, warning, black_list, active |
inn | string | No | |
director_name | string | No | |
address | string | No | |
delivery_address | object | No | |
delivery_address.long | number | No | |
delivery_address.lat | number | No | |
delivery_address.human_address | object | No | |
delivery_address.human_address.address | string | No | Default: "string" |
delivery_address.human_address.city | string | No | Default: "string" |
delivery_address.human_address.state | string | No | Default: "string" |
delivery_address.human_address.zip | string | No | Default: "string" |
bank_name | string | No | |
agent_id | string | No | |
responsible_id | string | No | |
account_number | string | No | |
mfo | string | No | |
loyalty_card_id | string | No | |
qqs_number | string | No | |
phone_number | string | No | |
phone_numbers | string[] | No | |
company_phone_number | string | No | |
description | string | No | |
organization_ids | string[] | Yes | |
debt_limits | object | No | |
debt_limits.organization_id | string | No | |
debt_limits.limit | number | No | |
debt_limits.customer_id | string | No | |
organization_id | string | No | |
person_id | string | No | |
oked | string | No | |
gender | string | No | One of: male, female |
image | string | No | |
last_name | string | No | |
middle_name | string | No | |
birth_date | string | No | |
legal_person_id | string | No | |
telegram_link | string | No | |
is_supplier | boolean | No | Default: false |
status | string | No | One of: active, inactive |
short_name | string | No | |
web_site | string | No | |
code | string | No | |
postal_code | string | No | |
owner_id | string | No | |
manager_id | string | No | |
custom_fields | object | No | |
custom_fields._id | string | No | |
custom_fields.value | any | No |
{
"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
}
}Response
| Field | Type | Description |
|---|---|---|
_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.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
type | string | No | type customer. One of: legal, natural |
category_id | string | No | |
state | string | No | One of: new, warning, black_list, active |
inn | string | No | |
director_name | string | No | |
address | string | No | |
delivery_address | object | No | |
delivery_address.long | number | No | |
delivery_address.lat | number | No | |
delivery_address.human_address | object | No | |
delivery_address.human_address.address | string | No | Default: "string" |
delivery_address.human_address.city | string | No | Default: "string" |
delivery_address.human_address.state | string | No | Default: "string" |
delivery_address.human_address.zip | string | No | Default: "string" |
bank_name | string | No | |
agent_id | string | No | |
responsible_id | string | No | |
account_number | string | No | |
mfo | string | No | |
loyalty_card_id | string | No | |
qqs_number | string | No | |
phone_number | string | No | |
phone_numbers | string[] | No | |
company_phone_number | string | No | |
description | string | No | |
organization_ids | string[] | Yes | |
debt_limits | object | No | |
debt_limits.organization_id | string | No | |
debt_limits.limit | number | No | |
debt_limits.customer_id | string | No | |
organization_id | string | No | |
person_id | string | No | |
oked | string | No | |
gender | string | No | One of: male, female |
image | string | No | |
last_name | string | No | |
middle_name | string | No | |
birth_date | string | No | |
legal_person_id | string | No | |
telegram_link | string | No | |
is_supplier | boolean | No | Default: false |
status | string | No | One of: active, inactive |
short_name | string | No | |
web_site | string | No | |
code | string | No | |
postal_code | string | No | |
owner_id | string | No | |
manager_id | string | No | |
custom_fields | object | No | |
custom_fields._id | string | No | |
custom_fields.value | any | No | |
_id | string | Yes | 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"
}Response
Same response shape as POST /customer/create.
DELETE /customer/delete/{id}
Delete a customer
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
{
"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
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
Same response shape as POST /customer/create.
POST /customer/get-paging
Get customers by paging
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
updated_at | string | No | |
organization_id | string | No | |
search | string | No | |
phone_number | string | No |
{
"page": 1,
"limit": 20,
"updated_at": "string",
"organization_id": "string",
"search": "string",
"phone_number": "string"
}Response
data.total is the total number of records and data.data[] holds the current page. The table below describes one record.
| Field | Type | Description |
|---|---|---|
_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
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
deleted_at | string | Yes |
Request body
No request body.
Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}PUT /customer/set-state
setState customer
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
state | string | Yes | One of: black_list, new, active, warning |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new"
}Response
Same response shape as POST /customer/create.
GET /customer/get-by-phone-number
Find a customer by phone number.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phone_number | string | Yes |
Request body
No request body.
Response
Same response shape as POST /customer/create.
This page is generated from the OpenAPI spec.