Skip to content

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

MaydonTurMajburiyTavsif
namestringHaDevice display name
record_callsbooleanYo‘qWhether the device records calls
multiple_userbooleanYo‘qWhether multiple users can share the device
json
{
  "name": "string",
  "record_calls": false,
  "multiple_user": false
}

Javob

MaydonTurTavsif
_idstringDevice ObjectId
namestringDevice display name
statusstringDevice lifecycle status. Mumkin qiymatlar: pending, approved, blocked
device_signstringAuto-generated unique device sign (counter-based)
device_namestringOS-reported device name (set during device activation)
imeistringDevice IMEI (set during activation; absent for unused devices)
release_typestringAndroid release type (set during activation). Mumkin qiymatlar: store, standalone
record_callsbooleanWhether the device records calls
multiple_userbooleanWhether multiple users can share the device
osstringOperating system reported by the device
used_bystringObjectId of the user who last activated the device
receipt_counternumberLast receipt counter value on this device
created_atstring (date-time)
updated_atstring (date-time)
json
{
  "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

ParametrTurMajburiyTavsif
idstringHaDevice ObjectId

So‘rov tanasi

MaydonTurMajburiyTavsif
namestringHaDevice display name
record_callsbooleanYo‘qWhether the device records calls
multiple_userbooleanYo‘qWhether multiple users can share the device
json
{
  "name": "string",
  "record_calls": false,
  "multiple_user": false
}

Javob

json
{
  "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

ParametrTurMajburiyTavsif
idstringHaDevice ObjectId

So‘rov tanasi

MaydonTurMajburiyTavsif
statusstringHaNew device status. Transitioning to blocked terminates all active sessions for the device.. Mumkin qiymatlar: pending, approved, blocked
json
{
  "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

ParametrTurMajburiyTavsif
idstringHaDevice 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

ParametrTurMajburiyTavsif
idstringHaDevice 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

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
is_usedbooleanYo‘qFilter by whether the device is currently in use (has an IMEI)
imeistringYo‘qFilter by exact IMEI string
release_typestringYo‘qFilter by Android release type. Mumkin qiymatlar: store, standalone
json
{
  "page": 1,
  "limit": 20,
  "is_used": false,
  "imei": "string",
  "release_type": "store"
}

Javob

MaydonTurTavsif
totalnumber
listobject[]
list[]._idstringDevice ObjectId
list[].namestringDevice display name
list[].statusstringDevice lifecycle status. Mumkin qiymatlar: pending, approved, blocked
list[].device_signstringAuto-generated unique device sign (counter-based)
list[].device_namestringOS-reported device name (set during device activation)
list[].imeistringDevice IMEI (set during activation; absent for unused devices)
list[].release_typestringAndroid release type (set during activation). Mumkin qiymatlar: store, standalone
list[].record_callsbooleanWhether the device records calls
list[].multiple_userbooleanWhether multiple users can share the device
list[].osstringOperating system reported by the device
list[].used_bystringObjectId of the user who last activated the device
list[].receipt_counternumberLast receipt counter value on this device
list[].created_atstring (date-time)
list[].updated_atstring (date-time)
json
{
  "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.

Bito 2.0 Integration API