Device
POS devices registered on the account
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /device/create
Register a new POS device. The backend auto-assigns a device_sign and sets status=approved.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | Device display name |
record_calls | boolean | Нет | Whether the device records calls |
multiple_user | boolean | Нет | Whether multiple users can share the device |
{
"name": "string",
"record_calls": false,
"multiple_user": false
}Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | Device ObjectId |
name | string | Device display name |
status | string | Device lifecycle status. Допустимые значения: pending, approved, blocked |
device_sign | string | Auto-generated unique device sign (counter-based) |
device_name | string | OS-reported device name (set during device activation) |
imei | string | Device IMEI (set during activation; absent for unused devices) |
release_type | string | Android release type (set during activation). Допустимые значения: store, standalone |
record_calls | boolean | Whether the device records calls |
multiple_user | boolean | Whether multiple users can share the device |
os | string | Operating system reported by the device |
used_by | string | ObjectId of the user who last activated the device |
receipt_counter | number | Last receipt counter value on this device |
created_at | string (date-time) | |
updated_at | string (date-time) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"status": "pending",
"device_sign": "string",
"device_name": "string",
"imei": "string",
"release_type": "store",
"record_calls": false,
"multiple_user": false,
"os": "string",
"used_by": "string",
"receipt_counter": 0,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}PUT /device/update/{id}
Update an existing POS device's name, record_calls, or multiple_user flag.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Device ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | Device display name |
record_calls | boolean | Нет | Whether the device records calls |
multiple_user | boolean | Нет | Whether multiple users can share the device |
{
"name": "string",
"record_calls": false,
"multiple_user": false
}Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "string",
"time": "2025-05-01T12:00:00Z"
}PUT /device/set-status/{id}
Transition a device to a new status (pending | approved | blocked). Transitioning to blocked terminates all active sessions for the device. No-op when the target status equals the current status.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Device ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
status | string | Да | New device status. Transitioning to blocked terminates all active sessions for the device.. Допустимые значения: pending, approved, blocked |
{
"status": "pending"
}Ответ
Структура ответа совпадает с PUT /device/update/{id}.
DELETE /device/delete/{id}
Soft-delete a POS device (sets is_deleted=true). Fails if the device has an open cashbox session.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Device ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с PUT /device/update/{id}.
GET /device/get-by-id/{id}
Fetch a single POS device by ObjectId.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Device ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /device/create.
POST /device/get-paging
Paginated list of registered POS devices. Filterable by usage state, IMEI, and Android release type.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
is_used | boolean | Нет | Filter by whether the device is currently in use (has an IMEI) |
imei | string | Нет | Filter by exact IMEI string |
release_type | string | Нет | Filter by Android release type. Допустимые значения: store, standalone |
{
"page": 1,
"limit": 20,
"is_used": false,
"imei": "string",
"release_type": "store"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
total | number | |
list | object[] | |
list[]._id | string | Device ObjectId |
list[].name | string | Device display name |
list[].status | string | Device lifecycle status. Допустимые значения: pending, approved, blocked |
list[].device_sign | string | Auto-generated unique device sign (counter-based) |
list[].device_name | string | OS-reported device name (set during device activation) |
list[].imei | string | Device IMEI (set during activation; absent for unused devices) |
list[].release_type | string | Android release type (set during activation). Допустимые значения: store, standalone |
list[].record_calls | boolean | Whether the device records calls |
list[].multiple_user | boolean | Whether multiple users can share the device |
list[].os | string | Operating system reported by the device |
list[].used_by | string | ObjectId of the user who last activated the device |
list[].receipt_counter | number | Last receipt counter value on this device |
list[].created_at | string (date-time) | |
list[].updated_at | string (date-time) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": [
{
"_id": "string",
"name": "string",
"status": "pending",
"device_sign": "string",
"device_name": "string",
"imei": "string",
"release_type": "store",
"record_calls": false,
"multiple_user": false,
"os": "string",
"used_by": "string",
"receipt_counter": 0,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
]
},
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.