Device
POS devices registered on the account
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 /device/create
Register a new POS device. The backend auto-assigns a device_sign and sets status=approved.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | Device display name |
record_calls | boolean | Yo‘q | Whether the device records calls |
multiple_user | boolean | Yo‘q | Whether multiple users can share the device |
{
"name": "string",
"record_calls": false,
"multiple_user": false
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | Device ObjectId |
name | string | Device display name |
status | string | Device lifecycle status. Mumkin qiymatlar: 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). Mumkin qiymatlar: 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.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Device ObjectId |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | Device display name |
record_calls | boolean | Yo‘q | Whether the device records calls |
multiple_user | boolean | Yo‘q | Whether multiple users can share the device |
{
"name": "string",
"record_calls": false,
"multiple_user": false
}Javob
{
"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.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Device ObjectId |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
status | string | Ha | New device status. Transitioning to blocked terminates all active sessions for the device.. Mumkin qiymatlar: pending, approved, blocked |
{
"status": "pending"
}Javob
Javob tuzilishi quyidagi bilan bir xil: 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.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Device ObjectId |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: PUT /device/update/{id}.
GET /device/get-by-id/{id}
Fetch a single POS device by ObjectId.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Device ObjectId |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /device/create.
POST /device/get-paging
Paginated list of registered POS devices. Filterable by usage state, IMEI, and Android release type.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
is_used | boolean | Yo‘q | Filter by whether the device is currently in use (has an IMEI) |
imei | string | Yo‘q | Filter by exact IMEI string |
release_type | string | Yo‘q | Filter by Android release type. Mumkin qiymatlar: store, standalone |
{
"page": 1,
"limit": 20,
"is_used": false,
"imei": "string",
"release_type": "store"
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
total | number | |
list | object[] | |
list[]._id | string | Device ObjectId |
list[].name | string | Device display name |
list[].status | string | Device lifecycle status. Mumkin qiymatlar: 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). Mumkin qiymatlar: 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"
}Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.