Qarz to‘lovlari
Mijozlarning qarz hisobiga to‘lovlari. Har bir to‘lov qarzni kamaytiradi va savdo kassasiga kirim sifatida o‘tkaziladi; oxirgi to‘lovni bekor qilish mumkin.
| Metod | Manzil | Vazifasi |
|---|---|---|
| POST | /company/client/debt-payment/{model}/refund | To‘lovni bekor qilish |
| GET | /company/client/debt-payment | To‘lovlar ro‘yxati |
| GET | /company/client/debt-payment/{model} | To‘lov |
| POST | /company/client/debt-payment | Qarzni to‘lash |
To‘lovni bekor qilish
/company/client/debt-payment/{model}/refundTo‘lovni bekor qiladi: summa qarzga qaytadi va qabul qilingan kassadan chiqim bo‘lib ketadi; yozuv tarixda is_refunded = true bilan qoladi. Faqat mijoz to‘lovlarining oxirgi kunidagi, import qilinmagan va hali bekor qilinmagan to‘lovlarni (is_refundable) bekor qilish mumkin, aks holda 400.
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 |
creator_id | integer | Yaratuvchi |
company_id | integer | Kompaniya |
client_id | integer | Mijoz |
debt_id | integer | |
cashbox_id | integer | Kassa |
is_refunded | boolean | |
payment_type | string | To'lov turi |
currency | string | Valyuta |
amount | integer | Summa |
is_imported | boolean | |
created_at | string | Yaratilgan |
is_refundable | boolean |
{
"id": 78,
"creator_id": 2,
"company_id": 1,
"client_id": 1,
"debt_id": 92,
"cashbox_id": 2,
"is_refunded": true,
"payment_type": "cash",
"currency": "uzs",
"amount": 500,
"is_imported": false,
"created_at": "2026-09-30 12:51:52",
"is_refundable": false
}To‘lovlar ro‘yxati
/company/client/debt-paymentMavjud kompaniyalarning qarz to‘lovlari; har bir qatorda is_refundable — uni hali bekor qilish mumkinmi. Bekor qilinganlar is_refunded bilan belgilanadi va to‘lovlar summasiga kirmaydi.
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[creator_id] | Yaratuvchi — aniq qiymat |
filter[company_id] | Kompaniya — bitta qiymat yoki ro‘yxat filter[company_id][] |
filter[client_id] | Mijoz — aniq qiymat |
filter[debt_id] | aniq qiymat |
filter[cashbox_id] | Kassa — aniq qiymat |
filter[payment_type] | To'lov turi — aniq qiymat |
filter[currency] | Valyuta — bitta qiymat yoki ro‘yxat filter[currency][] |
filter[is_refunded] | aniq qiymat |
filter[created_at] | Yaratilgan — davr: [0] — dan, [1] — gacha (Y-m-d) |
sort[] | Saralash, - — kamayish bo‘yicha: id, -id, created_at, -created_at |
with[] | Bog‘liq ma’lumotlarni qo‘shish: creator.profile, company, client, debt, cashbox |
page | Sahifa raqami, 1 dan |
page-size | Sahifadagi yozuvlar soni, ko‘pi bilan 20 |
GET /company/client/debt-payment?with[0]=client&with[1]=debt&with[2]=cashbox&with[3]=creator.profileJavob · 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[].creator_id | integer | Yaratuvchi |
data[].company_id | integer | Kompaniya |
data[].client_id | integer | Mijoz |
data[].debt_id | integer | |
data[].cashbox_id | integer | Kassa |
data[].is_refunded | boolean | |
data[].payment_type | string | To'lov turi |
data[].currency | string | Valyuta |
data[].amount | integer | Summa |
data[].is_imported | boolean | |
data[].created_at | string | Yaratilgan |
data[].is_refundable | boolean | |
data[].client | object | |
data[].client.id | integer | ID |
data[].client.creator_id | integer | Yaratuvchi |
data[].client.company_id | integer | Kompaniya |
data[].client.bonus_tariff_id | integer | Bonus tarifi |
data[].client.bonus_entries_amount | integer | Bonus yozuvlari summasi |
data[].client.bonus_accumulations_amount | integer | Bonus balansi |
data[].client.full_name | string | FISH |
data[].client.gender | string | Jinsi |
data[].client.birth_date | string | Tug'ilgan kuni |
data[].client.image | string | Rasm |
data[].client.image_thumbs | object | |
data[].client.image_thumbs.widen_100 | object | |
data[].client.image_thumbs.widen_100.raw | string | |
data[].client.image_thumbs.widen_100.webp | string | |
data[].client.image_thumbs.widen_500 | object | |
data[].client.image_thumbs.widen_500.raw | string | |
data[].client.image_thumbs.widen_500.webp | string | |
data[].client.image_thumbs.original | object | |
data[].client.image_thumbs.original.raw | string | |
data[].client.image_thumbs.original.webp | string | |
data[].client.main_phone | string | Asosiy telefon |
data[].client.additional_phones | array | Qo‘shimcha telefonlar |
data[].client.languages | array | Tillar |
data[].client.address | null | Manzil |
data[].client.latitude | null | Kenglik |
data[].client.longitude | null | Uzunlik |
data[].client.socials | object | Ijtimoiy tarmoqlar |
data[].client.socials.other | string | |
data[].client.socials.facebook | string | |
data[].client.socials.telegram | string | |
data[].client.socials.instagram | string | |
data[].client.is_imported | boolean | |
data[].client.created_at | string | Yaratilgan |
data[].client.updated_at | string | Yangilangan |
data[].client.is_deleted | boolean | |
data[].debt | object | Qarz |
data[].debt.id | integer | ID |
data[].debt.creator_id | integer | Yaratuvchi |
data[].debt.company_id | integer | Kompaniya |
data[].debt.client_id | integer | Mijoz |
data[].debt.sale_id | integer | Sotish |
data[].debt.currency | string | Valyuta |
data[].debt.amount | integer | Summa |
data[].debt.repaid_amount | integer | To'langan summa |
data[].debt.returned_amount | integer | Qaytarilgan summa |
data[].debt.due_date | string | Toʻlov muddati |
data[].debt.comment | string | Izoh |
data[].debt.status | string | Status |
data[].debt.created_at | string | Yaratilgan |
data[].debt.updated_at | string | Yangilangan |
data[].debt.remaining_amount | integer | |
data[].debt.overdue_days | integer | Qarzdorlik kuni |
data[].debt.by_currency | object | |
data[].debt.by_currency.uzs | object | |
data[].debt.by_currency.uzs.amount | integer | Summa |
data[].debt.by_currency.uzs.repaid_amount | integer | To'langan summa |
data[].debt.by_currency.uzs.returned_amount | integer | Qaytarilgan summa |
data[].debt.by_currency.uzs.remaining_amount | integer | |
data[].cashbox | object | |
data[].cashbox.id | integer | ID |
data[].cashbox.creator_id | integer | Yaratuvchi |
data[].cashbox.company_id | integer | Kompaniya |
data[].cashbox.name | string | Nomlanish |
data[].cashbox.type | string | Turi |
data[].cashbox.created_at | string | Yaratilgan |
data[].cashbox.updated_at | string | Yangilangan |
data[].cashbox.is_deleted | boolean | |
data[].creator | object | |
data[].creator.id | integer | ID |
data[].creator.type | string | Turi |
data[].creator.role_id | integer | Roli |
data[].creator.company_id | integer | Kompaniya |
data[].creator.partner_id | null | Hamkor |
data[].creator.username | string | Login |
data[].creator.pinfl | null | PINFL |
data[].creator.phone | string | Telefon |
data[].creator.sipuni_sip_number | string | Sipuni (SIP-raqam) |
data[].creator.is_confirmed | boolean | |
data[].creator.are_all_companies_available | boolean | |
data[].creator.last_login_at | null | |
data[].creator.created_at | string | Yaratilgan |
data[].creator.updated_at | string | Yangilangan |
data[].creator.is_deleted | boolean | |
data[].creator.profile | object | |
data[].creator.profile.first_name | null | Ism |
data[].creator.profile.last_name | null | Familiya |
data[].creator.profile.position | null | Lavozim |
data[].creator.profile.birth_date | null | Tug'ilgan kuni |
data[].creator.profile.gender | null | Jinsi |
data[].creator.profile.full_name | string | FISH |
{
"data": [
{
"id": 67,
"creator_id": 2,
"company_id": 1,
"client_id": 1,
"debt_id": 84,
"cashbox_id": 1,
"is_refunded": false,
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"is_imported": false,
"created_at": "2026-09-30 12:51:51",
"is_refundable": true,
"client": {
"id": 1,
"creator_id": 2,
"company_id": 1,
"bonus_tariff_id": 1,
"bonus_entries_amount": 1000,
"bonus_accumulations_amount": 1000,
"full_name": "Full name 1",
"gender": "male",
"birth_date": "1990-01-01",
"image": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"image_thumbs": {
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
}
},
"main_phone": "998000000001",
"additional_phones": [
"998000000011",
"998000000012"
],
"languages": [
"ru",
"uz"
],
"address": null,
"latitude": null,
"longitude": null,
"socials": {
"other": "6abcbeafac861",
"facebook": "6abcbeafac860",
"telegram": "6abcbeafac85e",
"instagram": "6abcbeafac85f"
},
"is_imported": false,
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:51:51",
"is_deleted": false
},
"debt": {
"id": 84,
"creator_id": 2,
"company_id": 1,
"client_id": 1,
"sale_id": 1,
"currency": "uzs",
"amount": 4000,
"repaid_amount": 1000,
"returned_amount": 0,
"due_date": "2030-12-31 00:00:00",
"comment": "Initial debt note",
"status": "partially_repaid",
"created_at": "2026-09-30 12:51:51",
"updated_at": "2026-09-30 12:51:51",
"remaining_amount": 3000,
"overdue_days": 0,
"by_currency": {
"uzs": {
"amount": 4000,
"repaid_amount": 1000,
"returned_amount": 0,
"remaining_amount": 3000
}
}
},
"cashbox": {
"id": 1,
"creator_id": 2,
"company_id": 1,
"name": "Cashbox 1",
"type": "sale",
"created_at": "2026-09-30 12:47:58",
"updated_at": "2026-09-30 12:47:58",
"is_deleted": false
},
"creator": {
"id": 2,
"type": "director",
"role_id": 2,
"company_id": 1,
"partner_id": null,
"username": "director_1@local.host",
"pinfl": null,
"phone": "998020000001",
"sipuni_sip_number": "210",
"is_confirmed": true,
"are_all_companies_available": false,
"last_login_at": null,
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"profile": {
"first_name": null,
"last_name": null,
"position": null,
"birth_date": null,
"gender": null,
"full_name": " "
}
}
}
],
"links": {
"first": "https://api.wasyt.uz/company/client/debt-payment?page=1",
"last": "https://api.wasyt.uz/company/client/debt-payment?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/client/debt-payment",
"per_page": 20,
"to": 1,
"total": 1
}
}To‘lov
/company/client/debt-payment/{model}id bo‘yicha bitta qarz to‘lovi.
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
Javob misoli hali testlar tomonidan yozib olinmagan.
Qarzni to‘lash
/company/client/debt-paymentMijoz qarzi to‘lovini bitta valyutada qabul qiladi (standart UZS), bir nechta to‘lov turi bilan birga ham mumkin (bonus va nasiya bilan emas). Summa shu valyutadagi qarzlar bo‘yicha eng erta muddatdan boshlab taqsimlanadi; har bir qism — alohida to‘lov va savdo kassasiga kirim. Umumiy summa qarz qoldig‘idan oshmaydi; yaratilgan to‘lovlar ro‘yxati qaytariladi.
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 |
|---|---|---|---|
client_id | integer | Ha | Mijoz. Foydalanuvchiga ochiq mavjud yozuv ID si |
cashbox_id | integer | Ha | To‘lovni qabul qiluvchi savdo kassasi. Foydalanuvchiga ochiq mavjud yozuv ID si |
currency | string | Yo‘q | To‘lanadigan qarzlar valyutasi, standart uzs. Mumkin qiymatlar: uzs, usd, eur, rub |
payments | object[] | Ha | Maks. 10 ta element |
payments[].payment_type | string | Ha | To'lov turi. Takrorlanmasin. Mumkin qiymatlar: bank, card, cash |
payments[].amount | number | Ha | Summa. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
{
"client_id": 1,
"cashbox_id": 2,
"payments": [
{
"payment_type": "cash",
"amount": 1500
}
]
}curl -X POST "https://api.wasyt.uz/company/client/debt-payment" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"client_id":1,"cashbox_id":2,"payments":[{"payment_type":"cash","amount":1500}]}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].is_refunded | boolean | |
data[].debt_id | integer | |
data[].cashbox_id | integer | Kassa |
data[].client_id | integer | Mijoz |
data[].payment_type | string | To'lov turi |
data[].currency | string | Valyuta |
data[].amount | integer | Summa |
data[].created_at | string | Yaratilgan |
data[].creator_id | integer | Yaratuvchi |
data[].company_id | integer | Kompaniya |
data[].id | integer | ID |
data[].debt | object | Qarz |
data[].debt.id | integer | ID |
data[].debt.creator_id | integer | Yaratuvchi |
data[].debt.company_id | integer | Kompaniya |
data[].debt.client_id | integer | Mijoz |
data[].debt.sale_id | integer | Sotish |
data[].debt.currency | string | Valyuta |
data[].debt.amount | integer | Summa |
data[].debt.repaid_amount | integer | To'langan summa |
data[].debt.returned_amount | integer | Qaytarilgan summa |
data[].debt.due_date | string | Toʻlov muddati |
data[].debt.comment | string | Izoh |
data[].debt.status | string | Status |
data[].debt.created_at | string | Yaratilgan |
data[].debt.updated_at | string | Yangilangan |
data[].debt.remaining_amount | integer | |
data[].debt.overdue_days | integer | Qarzdorlik kuni |
data[].debt.by_currency | object | |
data[].debt.by_currency.uzs | object | |
data[].debt.by_currency.uzs.amount | integer | Summa |
data[].debt.by_currency.uzs.repaid_amount | integer | To'langan summa |
data[].debt.by_currency.uzs.returned_amount | integer | Qaytarilgan summa |
data[].debt.by_currency.uzs.remaining_amount | integer | |
data[].is_refundable | boolean |
{
"data": [
{
"is_refunded": false,
"debt_id": 68,
"cashbox_id": 2,
"client_id": 1,
"payment_type": "cash",
"currency": "uzs",
"amount": 1500,
"created_at": "2026-09-30 12:51:48",
"creator_id": 2,
"company_id": 1,
"id": 48,
"debt": {
"id": 68,
"creator_id": 2,
"company_id": 1,
"client_id": 1,
"sale_id": 1,
"currency": "uzs",
"amount": 4000,
"repaid_amount": 2500,
"returned_amount": 0,
"due_date": "2030-12-31 00:00:00",
"comment": "Initial debt note",
"status": "partially_repaid",
"created_at": "2026-09-30 12:51:48",
"updated_at": "2026-09-30 12:51:48",
"remaining_amount": 1500,
"overdue_days": 0,
"by_currency": {
"uzs": {
"amount": 4000,
"repaid_amount": 2500,
"returned_amount": 0,
"remaining_amount": 1500
}
}
},
"is_refundable": false
}
]
}Xato misoli · 422
{
"message": "Допустимые значения для fields.payments.*.payment_type: bank, card, cash.",
"errors": {
"payments.0.payment_type": [
"Допустимые значения для fields.payments.*.payment_type: bank, card, cash."
]
}
}
