Skip to content

Cashbox session ​

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 /cashbox-session/open ​

Open a cashier shift (cashbox session) on a cashbox with a declared opening balance. The acting cashier is resolved from the integration token (the optional user_id header, else the tenant owner).

So‘rov tanasi

MaydonTurMajburiyTavsif
organization_idstringHaOrganization ObjectId the session belongs to
cashbox_idstringHaCashbox (till) ObjectId to open a shift on
opened_balanceobject[]HaOpening balance per payment method
opened_balance[].currency_idstringHaCurrency ObjectId
opened_balance[].payment_method_idstringHaPayment-method ObjectId
opened_balance[].expectednumberHaDeclared expected amount for this payment method
opened_atstring (date-time)Yo‘qOptional shift open time (ISO 8601); defaults to now
open_notestringYo‘qOptional free-text note
json
{
  "organization_id": "string",
  "cashbox_id": "string",
  "opened_balance": [
    {
      "currency_id": "string",
      "payment_method_id": "string",
      "expected": 0
    }
  ],
  "opened_at": "2025-05-01T12:00:00Z",
  "open_note": "string"
}

Javob

MaydonTurTavsif
_idstring
session_uuidstring
statestringMumkin qiymatlar: open, closed, resolved, flagged
organization_idstring
cashbox_idstring
user_idstring
opened_atstring (date-time)
closed_atstring (date-time)
opened_balanceobject[]
opened_balance[].currency_idstring
opened_balance[].payment_method_idstring
opened_balance[].expectednumber
opened_balance[].actualnumber
closed_balanceobject[]
closed_balance[].currency_idstring
closed_balance[].payment_method_idstring
closed_balance[].expectednumber
closed_balance[].actualnumber
has_diff_on_openboolean
has_diff_on_closeboolean
open_notestring
close_notestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "session_uuid": "string",
    "state": "open",
    "organization_id": "string",
    "cashbox_id": "string",
    "user_id": "string",
    "opened_at": "2025-05-01T12:00:00Z",
    "closed_at": "2025-05-01T12:00:00Z",
    "opened_balance": [
      {
        "currency_id": "string",
        "payment_method_id": "string",
        "expected": 0,
        "actual": 0
      }
    ],
    "closed_balance": [
      {
        "currency_id": "string",
        "payment_method_id": "string",
        "expected": 0,
        "actual": 0
      }
    ],
    "has_diff_on_open": false,
    "has_diff_on_close": false,
    "open_note": "string",
    "close_note": "string"
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /cashbox-session/close ​

Close an open shift, reconciling the declared closing balance against the expected totals.

So‘rov tanasi

MaydonTurMajburiyTavsif
_idstringHaCashbox-session ObjectId to close
closed_balanceobject[]HaCounted closing balance per payment method
closed_balance[].currency_idstringHaCurrency ObjectId
closed_balance[].payment_method_idstringHaPayment-method ObjectId
closed_balance[].expectednumberHaDeclared expected amount for this payment method
close_notestringYo‘qOptional free-text note
json
{
  "_id": "string",
  "closed_balance": [
    {
      "currency_id": "string",
      "payment_method_id": "string",
      "expected": 0
    }
  ],
  "close_note": "string"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /cashbox-session/open.

POST /cashbox-session/get-paging ​

Paginated list of cashbox sessions, filterable by organization, cashbox, cashier, state, and discrepancy.

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
organization_idstringYo‘qFilter by organization ObjectId
cashbox_idstringYo‘qFilter by cashbox ObjectId
user_idstringYo‘qFilter by cashier (user) ObjectId
statestringYo‘qFilter by session state. Mumkin qiymatlar: open, closed, resolved, flagged
has_diffbooleanYo‘qFilter sessions that closed with a discrepancy
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "string",
  "cashbox_id": "string",
  "user_id": "string",
  "state": "open",
  "has_diff": false
}

Javob

MaydonTurTavsif
totalnumber
listobject[]
list[]._idstring
list[].session_uuidstring
list[].statestringMumkin qiymatlar: open, closed, resolved, flagged
list[].organization_idstring
list[].cashbox_idstring
list[].user_idstring
list[].opened_atstring (date-time)
list[].closed_atstring (date-time)
list[].opened_balanceobject[]
list[].opened_balance[].currency_idstring
list[].opened_balance[].payment_method_idstring
list[].opened_balance[].expectednumber
list[].opened_balance[].actualnumber
list[].closed_balanceobject[]
list[].closed_balance[].currency_idstring
list[].closed_balance[].payment_method_idstring
list[].closed_balance[].expectednumber
list[].closed_balance[].actualnumber
list[].has_diff_on_openboolean
list[].has_diff_on_closeboolean
list[].open_notestring
list[].close_notestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "list": [
      {
        "_id": "string",
        "session_uuid": "string",
        "state": "open",
        "organization_id": "string",
        "cashbox_id": "string",
        "user_id": "string",
        "opened_at": "2025-05-01T12:00:00Z",
        "closed_at": "2025-05-01T12:00:00Z",
        "opened_balance": [],
        "closed_balance": [],
        "has_diff_on_open": false,
        "has_diff_on_close": false,
        "open_note": "string",
        "close_note": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /cashbox-session/get-by-id/{id} ​

Fetch a single cashbox session by ObjectId.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaCashbox-session ObjectId

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /cashbox-session/open.

POST /cashbox-session/get-active ​

Return the caller's active (open) session in the given organization, if any.

So‘rov tanasi

MaydonTurMajburiyTavsif
organization_idstringHaOrganization ObjectId to find the caller's active session in
json
{
  "organization_id": "string"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /cashbox-session/open.


Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API