Kassa tranzaksiyalari
Kassalardagi barcha pul harakatlari: moddalar bo‘yicha daromad va xarajatlar, yetkazib beruvchilarga to‘lovlar, kassalar orasidagi o‘tkazmalar, konvertatsiyalar, inkassatsiyalar, shuningdek sotuv va qarz o‘tkazmalari. Har bir tranzaksiya kassa qoldig‘ini o‘z to‘lov turi va valyutasi bo‘yicha o‘zgartiradi.
| Metod | Manzil | Vazifasi |
|---|---|---|
| POST | /company/cashbox/transaction/cashbox | Kassalar orasida o‘tkazma |
| POST | /company/cashbox/transaction/conversion | Kassa ichida konvertatsiya |
| PATCH | /company/cashbox/transaction/{model}/complete | Tranzaksiyani tasdiqlash |
| PATCH | /company/cashbox/transaction/{model}/cancel | Tranzaksiyani bekor qilish |
| GET | /company/cashbox/transaction | Tranzaksiyalar ro‘yxati |
| GET | /company/cashbox/transaction/{model} | Tranzaksiya |
| POST | /company/cashbox/transaction | Tranzaksiya yaratish |
Kassalar orasida o‘tkazma
/company/cashbox/transaction/cashboxSummani cashbox_id kassadan source_id kassaga o‘tkazadi; faqat asosiy va savdo kassasi orasida ruxsat etiladi. Asosiy kassadan o‘tkazma darhol o‘tadi (completed), savdo kassasidan — qabul qiluvchi tasdiqlashini kutadi (on_hold), pul esa allaqachon yechilgan.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
cashbox_id | integer | Ha | Yuboruvchi kassa. Foydalanuvchiga ochiq mavjud yozuv ID si |
payment_type | string | Ha | To'lov turi. Mumkin qiymatlar: bank, card, cash, system |
currency | string | Ha | Valyuta. Mumkin qiymatlar: uzs, usd, eur, rub |
amount | number | Ha | Summa. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
comment | string | Yo‘q | Izoh. Maks. 1000 belgi |
source_id | integer | Ha | Qabul qiluvchi kassa. Foydalanuvchiga ochiq mavjud yozuv ID si |
{
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"comment": "Comment 3",
"cashbox_id": 1,
"source_id": 2
}curl -X POST "https://api.wasyt.uz/company/cashbox/transaction/cashbox" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"payment_type":"cash","currency":"uzs","amount":1000,"comment":"Comment 3","cashbox_id":1,"source_id":2}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
additional | object | |
additional.balances_after | object | |
additional.balances_after.cash | object | |
additional.balances_after.cash.uzs | string | |
additional.on_hold_after | array | |
source_data | array | |
cashbox_id | integer | Kassa |
payment_type | string | To'lov turi |
currency | string | Valyuta |
amount | integer | Summa |
comment | string | Izoh |
source_id | integer | Manba |
type | string | Turi |
source_type | string | Manba |
status | string | Status |
updated_at | string | Yangilangan |
created_at | string | Yaratilgan |
company_id | integer | Kompaniya |
creator_id | integer | Yaratuvchi |
id | integer | ID |
source | null | |
contract_number | null | Shartnoma raqami |
{
"additional": {
"balances_after": {
"cash": {
"uzs": "0.00"
}
},
"on_hold_after": []
},
"source_data": [],
"cashbox_id": 1,
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"comment": "Comment 3",
"source_id": 2,
"type": "outcome",
"source_type": "cashbox",
"status": "completed",
"updated_at": "2026-09-30 12:51:24",
"created_at": "2026-09-30 12:51:24",
"company_id": 1,
"creator_id": 2,
"id": 34,
"source": null,
"contract_number": null
}Kassa ichida konvertatsiya
/company/cashbox/transaction/conversionPulni kassaning source_id hisobidan (boshqa to‘lov turi yoki valyutadagi qoldiq) xuddi shu kassaning payment_type + currency hisobiga o‘tkazadi. Valyuta faqat UZS orqali almashtiriladi; currency_rate kursi kompaniya kursidan ±20% oralig‘ida bo‘lishi kerak (UZS hisoblari orasida kurs 1 ga teng). Darhol o‘tkaziladi (completed).
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
cashbox_id | integer | Ha | Kassa. Foydalanuvchiga ochiq mavjud yozuv ID si |
payment_type | string | Ha | To'lov turi. Mumkin qiymatlar: bank, card, cash, system |
currency | string | Ha | Valyuta. Mumkin qiymatlar: uzs, usd, eur, rub |
amount | number | Ha | Yechiladigan qoldiq valyutasidagi summa. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
comment | string | Yo‘q | Izoh. Maks. 1000 belgi |
source_id | integer | Ha | Pul yechiladigan kassa qoldig‘i ID si. Foydalanuvchiga ochiq mavjud yozuv ID si |
currency_rate | number | Ha | Kurs. Verguldan keyin 2 tagacha raqam. Kamida 1. 999999999999.99 dan oshmasin |
{
"cashbox_id": 1,
"payment_type": "card",
"amount": 1000,
"comment": "Comment 3",
"source_id": 1,
"currency_rate": 1000,
"currency": "uzs"
}curl -X POST "https://api.wasyt.uz/company/cashbox/transaction/conversion" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"cashbox_id":1,"payment_type":"card","amount":1000,"comment":"Comment 3","source_id":1,"currency_rate":1000,"currency":"uzs"}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
additional | object | |
additional.balances_after | object | |
additional.balances_after.cash | object | |
additional.balances_after.cash.uzs | string | |
additional.balances_after.card | object | |
additional.balances_after.card.uzs | string | |
additional.on_hold_after | array | |
source_data | object | |
source_data.original_amount | integer | |
source_data.currency_rate | integer | Kurs |
cashbox_id | integer | Kassa |
payment_type | string | To'lov turi |
currency | string | Valyuta |
amount | integer | Summa |
comment | string | Izoh |
source_id | integer | Manba |
type | string | Turi |
status | string | Status |
source_type | string | Manba |
updated_at | string | Yangilangan |
created_at | string | Yaratilgan |
company_id | integer | Kompaniya |
creator_id | integer | Yaratuvchi |
id | integer | ID |
source | null | |
contract_number | null | Shartnoma raqami |
{
"additional": {
"balances_after": {
"cash": {
"uzs": "1000.00"
},
"card": {
"uzs": "1000.00"
}
},
"on_hold_after": []
},
"source_data": {
"original_amount": 1000,
"currency_rate": 1
},
"cashbox_id": 1,
"payment_type": "card",
"currency": "uzs",
"amount": 1000,
"comment": "Comment 3",
"source_id": 1,
"type": "income",
"status": "completed",
"source_type": "conversion",
"updated_at": "2026-09-30 12:51:26",
"created_at": "2026-09-30 12:51:26",
"company_id": 1,
"creator_id": 2,
"id": 41,
"source": null,
"contract_number": null
}Tranzaksiyani tasdiqlash
/company/cashbox/transaction/{model}/completepending yoki on_hold holatidagi o‘tkazma olinganini tasdiqlaydi: tranzaksiya completed bo‘ladi, pul qabul qiluvchi kassaga kirim qilinadi. Inkassatsiyalar alohida tasdiqlanadi; xodim faqat o‘z kassasiga kelgan o‘tkazmani tasdiqlay oladi, aks holda 400.
Formadan (
multipart/form-data)PATCHmetodiPOST+?_method=PATCHparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
message | string | Xabar |
{
"message": "Success"
}Tranzaksiyani bekor qilish
/company/cashbox/transaction/{model}/cancelTranzaksiyani bekor qiladi (canceled) va uning qoldiqlarga, bog‘liq o‘tkazmaga va yetkazib beruvchi to‘loviga ta’sirini qaytaradi. Allaqachon bekor qilingan, bog‘liq (javob) tranzaksiyani, sotuv, smena, qarz, kredit va inkassatsiya o‘tkazmalarini hamda konvertatsiyaning kirim qismini bekor qilib bo‘lmaydi — 400.
Formadan (
multipart/form-data)PATCHmetodiPOST+?_method=PATCHparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
message | string | Xabar |
{
"message": "Success"
}Tranzaksiyalar ro‘yxati
/company/cashbox/transactionFoydalanuvchiga ochiq kassalar bo‘yicha tranzaksiyalar; filter[contract_number] ICAN shartnoma raqami bo‘yicha qidiradi. show[]=total filter[total_date_from] va filter[total_date_to] (Y-m-d H:i:s) bilan birga total ni qo‘shadi — yakunlangan tranzaksiyalarning tur, to‘lov turi, manba va valyuta bo‘yicha summalari. ?format=excel ro‘yxatni yuklab beradi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov parametrlari
| Parametr | Tavsif |
|---|---|
filter[id] | ID — aniq qiymat |
filter[company_id] | Kompaniya — bitta qiymat yoki ro‘yxat filter[company_id][] |
filter[creator_id] | Yaratuvchi — aniq qiymat |
filter[cashbox_id] | Kassa — aniq qiymat |
filter[type] | Turi — aniq qiymat |
filter[payment_type] | To'lov turi — aniq qiymat |
filter[currency] | Valyuta — aniq qiymat |
filter[status] | Status — aniq qiymat |
filter[source_type] | Manba — bitta qiymat yoki ro‘yxat filter[source_type][] |
filter[source_id] | Manba — aniq qiymat |
filter[created_at] | Yaratilgan — davr: [0] — dan, [1] — gacha (Y-m-d) |
sort[] | Saralash, - — kamayish bo‘yicha: id, -id |
with[] | Bog‘liq ma’lumotlarni qo‘shish: creator.profile, cashbox, source |
page | Sahifa raqami, 1 dan |
page-size | Sahifadagi yozuvlar soni, ko‘pi bilan 20 |
GET /company/cashbox/transaction?filter[id]=1&filter[company_id][0]=1&filter[company_id][1]=2&filter[creator_id]=2&filter[cashbox_id]=1&filter[type]=income&filter[payment_type]=cash&filter[currency]=uzs&filter[status]=completed&filter[source_type][0]=cashbox&filter[source_type][1]=reason&filter[source_id]=1&filter[created_at][0]=2026-09-29&filter[created_at][1]=2026-09-30Javob · 200
Sahifalangan javob: yozuvlar data[] ichida, sahifalash links va meta da.
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].id | integer | ID |
data[].company_id | integer | Kompaniya |
data[].creator_id | integer | Yaratuvchi |
data[].cashbox_id | integer | Kassa |
data[].type | string | Turi |
data[].payment_type | string | To'lov turi |
data[].currency | string | Valyuta |
data[].amount | integer | Summa |
data[].comment | string | Izoh |
data[].status | string | Status |
data[].source_type | string | Manba |
data[].source_id | integer | Manba |
data[].source_data | array | |
data[].related_to_id | null | |
data[].reversal_of_id | null | |
data[].cancel_comment | null | O‘chirish sababi |
data[].additional | object | |
data[].additional.on_hold_after | array | |
data[].additional.balances_after | array | |
data[].created_at | string | Yaratilgan |
data[].updated_at | string | Yangilangan |
data[].source | null | |
data[].contract_number | null | Shartnoma raqami |
{
"data": [
{
"id": 1,
"company_id": 1,
"creator_id": 2,
"cashbox_id": 1,
"type": "income",
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"comment": "Comment 1",
"status": "completed",
"source_type": "reason",
"source_id": 1,
"source_data": [],
"related_to_id": null,
"reversal_of_id": null,
"cancel_comment": null,
"additional": {
"on_hold_after": [],
"balances_after": []
},
"created_at": "2026-09-30 12:47:58",
"updated_at": "2026-09-30 12:47:58",
"source": null,
"contract_number": null
}
],
"links": {
"first": "https://api.wasyt.uz/company/cashbox/transaction?page=1",
"last": "https://api.wasyt.uz/company/cashbox/transaction?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/cashbox/transaction",
"per_page": 20,
"to": 1,
"total": 1
}
}Tranzaksiya
/company/cashbox/transaction/{model}Bitta kassa tranzaksiyasi; with[]=source uning manbasini (kassa, inkassatsiya, modda yoki yetkazib beruvchi) qo‘shadi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
company_id | integer | Kompaniya |
creator_id | integer | Yaratuvchi |
cashbox_id | integer | Kassa |
type | string | Turi |
payment_type | string | To'lov turi |
currency | string | Valyuta |
amount | integer | Summa |
comment | string | Izoh |
status | string | Status |
source_type | string | Manba |
source_id | integer | Manba |
source_data | array | |
related_to_id | null | |
reversal_of_id | null | |
cancel_comment | null | O‘chirish sababi |
additional | object | |
additional.on_hold_after | array | |
additional.balances_after | array | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
source | null | |
contract_number | null | Shartnoma raqami |
{
"id": 1,
"company_id": 1,
"creator_id": 2,
"cashbox_id": 1,
"type": "income",
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"comment": "Comment 1",
"status": "completed",
"source_type": "reason",
"source_id": 1,
"source_data": [],
"related_to_id": null,
"reversal_of_id": null,
"cancel_comment": null,
"additional": {
"on_hold_after": [],
"balances_after": []
},
"created_at": "2026-09-30 12:47:58",
"updated_at": "2026-09-30 12:47:58",
"source": null,
"contract_number": null
}Tranzaksiya yaratish
/company/cashbox/transactionModda bo‘yicha kassa daromadi yoki xarajati (source_type = reason, faqat shu turdagi ichki modda) yoki yetkazib beruvchiga to‘lov (source_type = supplier, faqat xarajat). Daromad faqat asosiy kassaga kiritiladi, xarajat — istalgan ochiq kassadan. Darhol o‘tkaziladi (completed); yetkazib beruvchiga to‘lov undan bo‘lgan qarzni kamaytiradi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
cashbox_id | integer | Ha | Kassa. Foydalanuvchiga ochiq mavjud yozuv ID si |
type | string | Ha | Turi. Mumkin qiymatlar: income, outcome |
payment_type | string | Ha | To'lov turi. Mumkin qiymatlar: bank, card, cash, system |
currency | string | Ha | Valyuta. Mumkin qiymatlar: uzs, usd, eur, rub |
amount | number | Ha | Summa. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
comment | string | Ha | Izoh. Maks. 1000 belgi |
source_type | string | Ha | Manba. Mumkin qiymatlar: reason, supplier |
source_id | integer | Ha | Modda (reason) yoki yetkazib beruvchi (supplier) ID si. Foydalanuvchiga ochiq mavjud yozuv ID si |
{
"cashbox_id": 1,
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"comment": "Comment 3",
"type": "income",
"source_type": "reason",
"source_id": 2
}curl -X POST "https://api.wasyt.uz/company/cashbox/transaction" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"cashbox_id":1,"payment_type":"cash","currency":"uzs","amount":1000,"comment":"Comment 3","type":"income","source_type":"reason","source_id":2}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
additional | object | |
additional.balances_after | object | |
additional.balances_after.cash | object | |
additional.balances_after.cash.uzs | string | |
additional.on_hold_after | array | |
source_data | array | |
cashbox_id | integer | Kassa |
type | string | Turi |
payment_type | string | To'lov turi |
currency | string | Valyuta |
amount | integer | Summa |
comment | string | Izoh |
source_type | string | Manba |
source_id | integer | Manba |
status | string | Status |
updated_at | string | Yangilangan |
created_at | string | Yaratilgan |
company_id | integer | Kompaniya |
creator_id | integer | Yaratuvchi |
id | integer | ID |
source | null | |
contract_number | null | Shartnoma raqami |
{
"additional": {
"balances_after": {
"cash": {
"uzs": "2000.00"
}
},
"on_hold_after": []
},
"source_data": [],
"cashbox_id": 1,
"type": "income",
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"comment": "Comment 3",
"source_type": "reason",
"source_id": 2,
"status": "completed",
"updated_at": "2026-09-30 12:51:27",
"created_at": "2026-09-30 12:51:27",
"company_id": 1,
"creator_id": 2,
"id": 49,
"source": null,
"contract_number": null
}
