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).
Kerakli ruxsat: cashbox_update · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/open' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "string",
"cashbox_id": "string",
"opened_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0
}
]
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/open', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "string",
"cashbox_id": "string",
"opened_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0
}
]
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/open",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "string",
"cashbox_id": "string",
"opened_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0,
},
],
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "string",
"cashbox_id": "string",
"opened_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0
}
]
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/open');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
organization_id | string | Ha | Organization ObjectId the session belongs to |
cashbox_id | string | Ha | Cashbox (till) ObjectId to open a shift on |
opened_balance | object[] | Ha | Opening balance per payment method |
opened_balance[].currency_id | string | Ha | Currency ObjectId |
opened_balance[].payment_method_id | string | Ha | Payment-method ObjectId |
opened_balance[].expected | number | Ha | Declared expected amount for this payment method |
opened_at | string (date-time) | Yo‘q | Optional shift open time (ISO 8601); defaults to now |
open_note | string | Yo‘q | Optional free-text note |
{
"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
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
session_uuid | string | |
state | string | Mumkin qiymatlar: open, closed, resolved, flagged |
organization_id | string | |
cashbox_id | string | |
user_id | string | |
opened_at | string (date-time) | |
closed_at | string (date-time) | |
opened_balance | object[] | |
opened_balance[].currency_id | string | |
opened_balance[].payment_method_id | string | |
opened_balance[].expected | number | |
opened_balance[].actual | number | |
closed_balance | object[] | |
closed_balance[].currency_id | string | |
closed_balance[].payment_method_id | string | |
closed_balance[].expected | number | |
closed_balance[].actual | number | |
has_diff_on_open | boolean | |
has_diff_on_close | boolean | |
open_note | string | |
close_note | string |
{
"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.
Kerakli ruxsat: cashbox_update · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/close' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"_id": "string",
"closed_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0
}
]
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/close', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"_id": "string",
"closed_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0
}
]
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/close",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"_id": "string",
"closed_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0,
},
],
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"_id": "string",
"closed_balance": [
{
"currency_id": "string",
"payment_method_id": "string",
"expected": 0
}
]
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/close');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
_id | string | Ha | Cashbox-session ObjectId to close |
closed_balance | object[] | Ha | Counted closing balance per payment method |
closed_balance[].currency_id | string | Ha | Currency ObjectId |
closed_balance[].payment_method_id | string | Ha | Payment-method ObjectId |
closed_balance[].expected | number | Ha | Declared expected amount for this payment method |
close_note | string | Yo‘q | Optional free-text note |
{
"_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.
Kerakli ruxsat: cashbox · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-paging' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"page": 1,
"limit": 20
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-paging', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"page": 1,
"limit": 20
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-paging",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"page": 1,
"limit": 20,
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"page": 1,
"limit": 20
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-paging');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
organization_id | string | Yo‘q | Filter by organization ObjectId |
cashbox_id | string | Yo‘q | Filter by cashbox ObjectId |
user_id | string | Yo‘q | Filter by cashier (user) ObjectId |
state | string | Yo‘q | Filter by session state. Mumkin qiymatlar: open, closed, resolved, flagged |
has_diff | boolean | Yo‘q | Filter sessions that closed with a discrepancy |
search | string | Yo‘q | Free-text search. |
date_from | string (date-time) | Yo‘q | Start of the date range. |
date_to | string (date-time) | Yo‘q | End of the date range. |
{
"page": 1,
"limit": 20,
"organization_id": "string",
"cashbox_id": "string",
"user_id": "string",
"state": "open",
"has_diff": false,
"search": "string",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z"
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
total | number | |
list | object[] | |
list[]._id | string | |
list[].session_uuid | string | |
list[].state | string | Mumkin qiymatlar: open, closed, resolved, flagged |
list[].organization_id | string | |
list[].cashbox_id | string | |
list[].user_id | string | |
list[].opened_at | string (date-time) | |
list[].closed_at | string (date-time) | |
list[].opened_balance | object[] | |
list[].opened_balance[].currency_id | string | |
list[].opened_balance[].payment_method_id | string | |
list[].opened_balance[].expected | number | |
list[].opened_balance[].actual | number | |
list[].closed_balance | object[] | |
list[].closed_balance[].currency_id | string | |
list[].closed_balance[].payment_method_id | string | |
list[].closed_balance[].expected | number | |
list[].closed_balance[].actual | number | |
list[].has_diff_on_open | boolean | |
list[].has_diff_on_close | boolean | |
list[].open_note | string | |
list[].close_note | string |
{
"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.
Kerakli ruxsat: cashbox · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-by-id/6712f0a9c4d1e87b3a0f9911', {
method: 'GET',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"GET",
"https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-by-id/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Cashbox-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.
Kerakli ruxsat: cashbox · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-active' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "string"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-active', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "string"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-active",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "string",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "string"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/cashbox-session/get-active');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
organization_id | string | Yo‘q | Organization ObjectId to find the caller's active session in |
{
"organization_id": "string"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /cashbox-session/open.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.