Custom field
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
GET /custom-field/get-all
List custom fields, optionally filtered by the target collection (table_name).
Параметры запроса
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
table_name | string | Нет | Filter by target collection (e.g. customers, products, trades). |
Тело запроса
Тело запроса не требуется.
Ответ
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"table_name": "string",
"type": "string",
"name": "string",
"code": "string",
"regex": "string",
"error_message": "string",
"is_required": false,
"is_api_only": false,
"is_visible": false,
"order": 0,
"options": [
{
"position": null,
"value": null
}
],
"organization_specs": [
{
"organization_id": null,
"required_state_id": null
}
],
"accessed_user_ids": [
"string"
],
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
],
"time": "2025-05-01T12:00:00Z"
}POST /custom-field/create
Create a custom field on a target collection.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
table_name | string | Да | Target collection (e.g. customers, products, trades, saleOrders). |
type | string | Да | Допустимые значения: text, number, date, boolean, select, multi_select, radio_button, textarea |
name | string | Да | |
code | string | Нет | |
regex | string | Нет | Optional regex for client-side validation. |
error_message | string | Нет | Error message shown when regex fails. |
is_required | boolean | Да | По умолчанию: false |
is_api_only | boolean | Нет | Hide from UI; only available via API.. По умолчанию: false |
is_visible | boolean | Нет | По умолчанию: true |
order | number | Нет | |
organization_specs | object[] | Нет | Per-organization required-state overrides. |
organization_specs[].organization_id | string | Нет | |
organization_specs[].required_state_id | string | Нет | |
accessed_user_ids | string[] | Нет | |
options | object[] | Нет | Required when type is select / multi_select / radio_button. |
options[].position | number | Да | |
options[].value | string | Да |
json
{
"table_name": "customers",
"type": "text",
"name": "Loyalty tier",
"code": "loyalty_tier",
"regex": "string",
"error_message": "string",
"is_required": false,
"is_api_only": false,
"is_visible": true,
"order": 1,
"organization_specs": [
{
"organization_id": "64b7f4d9e2b3b6a0b7c5d80a",
"required_state_id": "64b7f4d9e2b3b6a0b7c5d80a"
}
],
"accessed_user_ids": [
"64b7f4d9e2b3b6a0b7c5d80a"
],
"options": [
{
"position": 1,
"value": "Gold"
}
]
}Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | |
table_name | string | |
type | string | |
name | string | |
code | string | |
regex | string | |
error_message | string | |
is_required | boolean | |
is_api_only | boolean | |
is_visible | boolean | |
order | number | |
options | object[] | |
options[].position | number | |
options[].value | string | |
organization_specs | object[] | |
organization_specs[].organization_id | string | |
organization_specs[].required_state_id | string | |
accessed_user_ids | string[] | |
created_at | string (date-time) | |
updated_at | string (date-time) |
json
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"table_name": "string",
"type": "string",
"name": "string",
"code": "string",
"regex": "string",
"error_message": "string",
"is_required": false,
"is_api_only": false,
"is_visible": false,
"order": 0,
"options": [
{
"position": 0,
"value": "string"
}
],
"organization_specs": [
{
"organization_id": "string",
"required_state_id": "string"
}
],
"accessed_user_ids": [
"string"
],
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.