Долги клиентов
Тетрадь долгов: долг возникает при продаже в долг (по одной записи на чек, в валюте чека) или при импорте начальных остатков. Статусы: active, partially_repaid, expired, repaid.
| Метод | Адрес | Назначение |
|---|---|---|
| GET | /company/client/debt/stats | Статистика долгов |
| GET | /company/client/debt/debtors | Список должников |
| GET | /company/client/debt/download-example | Шаблон импорта должников |
| POST | /company/client/debt/import | Импорт должников |
| GET | /company/client/debt | Список долгов |
| GET | /company/client/debt/{model} | Долг |
Статистика долгов
/company/client/debt/statsСводка тетради долгов с теми же фильтрами, что у списка должников: число должников, разбивка должников по статусам, суммы долга, погашенного и остатка — общие и по валютам (by_currency).
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Ответ · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
debtors_count | integer | |
debts_by_status | object | |
debts_by_status.active | integer | |
debts_by_status.partially_repaid | integer | |
debts_by_status.expired | integer | |
debts_by_status.repaid | integer | |
total_debt_amount | integer | |
total_repaid_amount | integer | |
total_remaining_amount | integer | |
by_currency | object | |
by_currency.uzs | object | |
by_currency.uzs.total_debt_amount | integer | |
by_currency.uzs.total_repaid_amount | integer | |
by_currency.uzs.total_remaining_amount | integer |
{
"debtors_count": 1,
"debts_by_status": {
"active": 0,
"partially_repaid": 1,
"expired": 0,
"repaid": 0
},
"total_debt_amount": 4000,
"total_repaid_amount": 1000,
"total_remaining_amount": 3000,
"by_currency": {
"uzs": {
"total_debt_amount": 4000,
"total_repaid_amount": 1000,
"total_remaining_amount": 3000
}
}
}Список должников
/company/client/debt/debtorsТетрадь долгов по одной строке на клиента: его долги суммируются, статус выводится общий, а по валютам — в by_currency. Фильтры filter[client_id], filter[is_imported], filter[main_phone], filter[search] (имя, часть телефона или номера карты), filter[created_at]; сортировка sort[] по due_date (по умолчанию -due_date), amount, remaining_amount; page-size до 100.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры запроса
| Параметр | Описание |
|---|---|
with[] | Подгрузить связи |
GET /company/client/debt/debtors?with[0]=clientОтвет · 200
Постраничный ответ: записи в data[], пагинация в links и meta.
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
data | object[] | Данные |
data[].client_id | integer | Клиент |
data[].id | integer | ID |
data[].amount | integer | Сумма |
data[].repaid_amount | integer | Сумма погашения |
data[].returned_amount | integer | Возвращённая сумма |
data[].due_date | string | Срок погашения |
data[].status | string | Статус |
data[].amount_uzs | string | |
data[].repaid_amount_uzs | string | |
data[].returned_amount_uzs | string | |
data[].amount_usd | null | |
data[].repaid_amount_usd | null | |
data[].returned_amount_usd | null | |
data[].amount_eur | null | |
data[].repaid_amount_eur | null | |
data[].returned_amount_eur | null | |
data[].amount_rub | null | |
data[].repaid_amount_rub | null | |
data[].returned_amount_rub | null | |
data[].client | object | |
data[].client.id | integer | ID |
data[].client.creator_id | integer | Создатель |
data[].client.company_id | integer | Компания |
data[].client.bonus_tariff_id | integer | Бонусный тариф |
data[].client.bonus_entries_amount | integer | Сумма бонусных записей |
data[].client.bonus_accumulations_amount | integer | Бонусный баланс |
data[].client.full_name | string | ФИО |
data[].client.gender | string | Пол |
data[].client.birth_date | string | Дата рождения |
data[].client.image | string | Изображение |
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 | Основной телефон |
data[].client.additional_phones | array | Дополнительные телефоны |
data[].client.languages | array | Языки |
data[].client.address | null | Адрес |
data[].client.latitude | null | Широта |
data[].client.longitude | null | Долгота |
data[].client.socials | object | Соц-сети |
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 | Создано |
data[].client.updated_at | string | Обновлено |
data[].client.is_deleted | boolean | |
data[].remaining_amount | integer | |
data[].overdue_days | integer | Просрочено дней |
data[].by_currency | object | |
data[].by_currency.uzs | object | |
data[].by_currency.uzs.amount | integer | Сумма |
data[].by_currency.uzs.repaid_amount | integer | Сумма погашения |
data[].by_currency.uzs.returned_amount | integer | Возвращённая сумма |
data[].by_currency.uzs.remaining_amount | integer |
{
"data": [
{
"client_id": 1,
"id": 6,
"amount": 6000,
"repaid_amount": 1000,
"returned_amount": 0,
"due_date": "2030-06-30 00:00:00",
"status": "partially_repaid",
"amount_uzs": "6000.00",
"repaid_amount_uzs": "1000.00",
"returned_amount_uzs": "0.00",
"amount_usd": null,
"repaid_amount_usd": null,
"returned_amount_usd": null,
"amount_eur": null,
"repaid_amount_eur": null,
"returned_amount_eur": null,
"amount_rub": null,
"repaid_amount_rub": null,
"returned_amount_rub": null,
"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:39",
"is_deleted": false
},
"remaining_amount": 5000,
"overdue_days": 0,
"by_currency": {
"uzs": {
"amount": 6000,
"repaid_amount": 1000,
"returned_amount": 0,
"remaining_amount": 5000
}
}
}
],
"links": {
"first": "https://api.wasyt.uz/company/client/debt/debtors?page=1",
"last": "https://api.wasyt.uz/company/client/debt/debtors?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/client/debt/debtors",
"per_page": 20,
"to": 1,
"total": 1
}
}Шаблон импорта должников
/company/client/debt/download-exampleСкачивает Excel-шаблон (.xlsx) для импорта должников.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Ответ · 200
Ответ — файл или текст, не JSON.
Импорт должников
/company/client/debt/importПереносит долги, которые велись вне системы, из .xlsx (до 1 МБ, до 500 строк, колонки A–G: ФИО, сумма долга, погашено, телефон, срок, дата рождения, пол). Каждая строка создаёт нового клиента с пометкой импорта и один начальный долг в UZS без продажи; погашенная часть не больше суммы долга. Телефоны должны быть уникальны в файле и среди существующих клиентов; одинаковые имена из одного слова отклоняются.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
file | file | Да | Excel-файл по шаблону импорта. Форматы: xlsx. Макс. 1024 КБ |
{}curl -X POST "https://api.wasyt.uz/company/client/debt/import" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '[]'Ответ · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
message | string | Сообщение |
{
"message": "Success"
}Пример ошибки · 422
{
"message": "Должники \"Алишер\" повторяются, добавьте фамилию или отчество",
"errors": {
"file": [
"Должники \"Алишер\" повторяются, добавьте фамилию или отчество"
]
}
}Список долгов
/company/client/debtОтдельные долги (по одной записи на чек в долг или импортированный остаток) доступных компаний; можно отобрать по клиенту, продаже, статусу, валюте и сроку.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры запроса
| Параметр | Описание |
|---|---|
filter[id] | ID — точное значение |
filter[creator_id] | Создатель — точное значение |
filter[company_id] | Компания — одно значение или список filter[company_id][] |
filter[client_id] | Клиент — точное значение |
filter[sale_id] | Продажа — точное значение |
filter[status] | Статус — одно значение или список filter[status][] |
filter[currency] | Валюта — одно значение или список filter[currency][] |
filter[due_date] | Срок погашения — период: [0] — с, [1] — по (Y-m-d) |
filter[created_at] | Создано — период: [0] — с, [1] — по (Y-m-d) |
sort[] | Сортировка, - — по убыванию: id, -id, due_date, -due_date, created_at, -created_at |
with[] | Подгрузить связи: creator.profile, company, client, sale, sale.products, sale.products.product, sale.transactions, payments, payments.creator.profile, payments.cashbox |
page | Номер страницы, с 1 |
page-size | Записей на странице, не больше 20 |
GET /company/client/debt?with[0]=client&with[1]=sale.products.product&with[2]=payments.creator.profile&with[3]=payments.cashboxОтвет · 200
Постраничный ответ: записи в data[], пагинация в links и meta.
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
data | object[] | Данные |
data[].id | integer | ID |
data[].creator_id | integer | Создатель |
data[].company_id | integer | Компания |
data[].client_id | integer | Клиент |
data[].sale_id | integer | Продажа |
data[].currency | string | Валюта |
data[].amount | integer | Сумма |
data[].repaid_amount | integer | Сумма погашения |
data[].returned_amount | integer | Возвращённая сумма |
data[].due_date | string | Срок погашения |
data[].comment | string | Комментарий |
data[].status | string | Статус |
data[].created_at | string | Создано |
data[].updated_at | string | Обновлено |
data[].client | object | |
data[].client.id | integer | ID |
data[].client.creator_id | integer | Создатель |
data[].client.company_id | integer | Компания |
data[].client.bonus_tariff_id | integer | Бонусный тариф |
data[].client.bonus_entries_amount | integer | Сумма бонусных записей |
data[].client.bonus_accumulations_amount | integer | Бонусный баланс |
data[].client.full_name | string | ФИО |
data[].client.gender | string | Пол |
data[].client.birth_date | string | Дата рождения |
data[].client.image | string | Изображение |
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 | Основной телефон |
data[].client.additional_phones | array | Дополнительные телефоны |
data[].client.languages | array | Языки |
data[].client.address | null | Адрес |
data[].client.latitude | null | Широта |
data[].client.longitude | null | Долгота |
data[].client.socials | object | Соц-сети |
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 | Создано |
data[].client.updated_at | string | Обновлено |
data[].client.is_deleted | boolean | |
data[].sale | object | |
data[].sale.id | integer | ID |
data[].sale.creator_id | integer | Создатель |
data[].sale.company_id | integer | Компания |
data[].sale.cashbox_id | integer | Касса |
data[].sale.stock_id | integer | Склад |
data[].sale.client_id | integer | Клиент |
data[].sale.exchange_of_sale_id | null | |
data[].sale.currency | string | Валюта |
data[].sale.purchased_amount | integer | |
data[].sale.sold_amount | integer | Сумма в продаже |
data[].sale.returned_amount | integer | Возвращённая сумма |
data[].sale.status | string | Статус |
data[].sale.source_type | string | Источник |
data[].sale.source_data | array | |
data[].sale.code | string | Код |
data[].sale.created_at | string | Создано |
data[].sale.updated_at | string | Обновлено |
data[].sale.products | object[] | Продукты |
data[].sale.products[].id | integer | ID |
data[].sale.products[].company_id | integer | Компания |
data[].sale.products[].sale_id | integer | Продажа |
data[].sale.products[].product_id | integer | Продукт |
data[].sale.products[].service_id | null | |
data[].sale.products[].bundle_id | null | Комплект |
data[].sale.products[].bundle_key | null | |
data[].sale.products[].purchase_price | integer | Цена при покупке |
data[].sale.products[].price | integer | Цена |
data[].sale.products[].discount | integer | Скидка |
data[].sale.products[].sold_quantity | integer | Кол-во в продаже |
data[].sale.products[].returned_quantity | integer | Возвращённое кол-во |
data[].sale.products[].returned_data | array | |
data[].sale.products[].last_returned_at | null | |
data[].sale.products[].stock_product_source_data | object | |
data[].sale.products[].stock_product_source_data.source_type | string | Источник |
data[].sale.products[].stock_product_source_data.source_id | integer | Источник |
data[].sale.products[].stock_product_source_data.source_product_id | integer | |
data[].sale.products[].stock_product_source_data.quantity | integer | Количество |
data[].sale.products[].stock_product_source_data.purchase_price | integer | Цена при покупке |
data[].sale.products[].stock_product_source_data.purchase_currency | string | Валюта при покупке |
data[].sale.products[].stock_product_source_data.created_at | string | Создано |
data[].sale.products[].created_at | string | Создано |
data[].sale.products[].updated_at | string | Обновлено |
data[].sale.products[].product | object | |
data[].sale.products[].product.id | integer | ID |
data[].sale.products[].product.parent_id | null | Родитель |
data[].sale.products[].product.creator_id | integer | Создатель |
data[].sale.products[].product.company_id | integer | Компания |
data[].sale.products[].product.category_id | integer | Категория |
data[].sale.products[].product.brand_id | integer | Бренд |
data[].sale.products[].product.unit_id | integer | Единица измерения |
data[].sale.products[].product.name | string | Название |
data[].sale.products[].product.full_text | string | Полный текст |
data[].sale.products[].product.plu | string | Артикул (PLU) |
data[].sale.products[].product.description | string | Описание |
data[].sale.products[].product.is_free_price | boolean | Продажа по свободной цене |
data[].sale.products[].product.is_favorite | boolean | |
data[].sale.products[].product.min_quantity | null | |
data[].sale.products[].product.barcode | string | Штрих-код |
data[].sale.products[].product.images_list | array | Изображения |
data[].sale.products[].product.images_list_thumbs | object[] | |
data[].sale.products[].product.created_at | string | Создано |
data[].sale.products[].product.updated_at | string | Обновлено |
data[].sale.products[].product.is_deleted | boolean | |
data[].payments | object[] | |
data[].payments[].id | integer | ID |
data[].payments[].creator_id | integer | Создатель |
data[].payments[].company_id | integer | Компания |
data[].payments[].client_id | integer | Клиент |
{
"data": [
{
"id": 52,
"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:45",
"updated_at": "2026-09-30 12:51:45",
"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:45",
"is_deleted": false
},
"sale": {
"id": 1,
"creator_id": 2,
"company_id": 1,
"cashbox_id": 1,
"stock_id": 1,
"client_id": 1,
"exchange_of_sale_id": null,
"currency": "uzs",
"purchased_amount": 500,
"sold_amount": 4900,
"returned_amount": 0,
"status": "completed",
"source_type": "wasyt",
"source_data": [],
"code": "w-1-1",
"created_at": "2020-01-01 10:00:00",
"updated_at": "2020-01-01 10:00:00",
"products": [
{
"id": 1,
"company_id": 1,
"sale_id": 1,
"product_id": 1,
"service_id": null,
"bundle_id": null,
"bundle_key": null,
"purchase_price": 100,
"price": 1000,
"discount": 100,
"sold_quantity": 1,
"returned_quantity": 0,
"returned_data": [],
"last_returned_at": null,
"stock_product_source_data": {
"source_type": "purchase",
"source_id": 1,
"source_product_id": 1,
"quantity": 1,
"purchase_price": 1000,
"purchase_currency": "uzs",
"created_at": "2026-09-30 12:47:59"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"product": {
"id": 1,
"parent_id": null,
"creator_id": 1,
"company_id": 1,
"category_id": 4,
"brand_id": 1,
"unit_id": 1,
"name": "Product 1",
"full_text": "Product 1",
"plu": "0001",
"description": "Description 1",
"is_free_price": false,
"is_favorite": false,
"min_quantity": null,
"barcode": "0000000000001",
"images_list": [
"https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
],
"images_list_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"
}
},
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
}
}
],
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:51:45",
"is_deleted": false
}
},
{
"id": 2,
"company_id": 1,
"sale_id": 1,
"product_id": 2,
"service_id": null,
"bundle_id": null,
"bundle_key": null,
"purchase_price": 200,
"price": 2000,
"discount": 0,
"sold_quantity": 2,
"returned_quantity": 0,
"returned_data": [],
"last_returned_at": null,
"stock_product_source_data": {
"source_type": "purchase",
"source_id": 1,
"source_product_id": 2,
"quantity": 2,
"purchase_price": 2000,
"purchase_currency": "usd",
"created_at": "2026-09-30 12:47:59"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"product": {
"id": 2,
"parent_id": 1,
"creator_id": 1,
"company_id": 1,
"category_id": 4,
"brand_id": 1,
"unit_id": 1,
"name": "Product 1-1",
"full_text": "Product 1-1 full text",
"plu": "0011",
"description": "Description 1-1",
"is_free_price": false,
"is_favorite": false,
"min_quantity": null,
"barcode": "0000000000011",
"images_list": [
"https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
],
"images_list_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"
}
},
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
}
}
],
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:51:45",
"is_deleted": false
}
}
]
},
"payments": [
{
"id": 35,
"creator_id": 2,
"company_id": 1,
"client_id": 1,
"debt_id": 52,
"cashbox_id": 1,
"is_refunded": false,
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"is_imported": false,
"created_at": "2026-09-30 12:51:45",
"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": " "
}
},
"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
},
"is_refundable": false
}
],
"remaining_amount": 3000,
"overdue_days": 0,
"by_currency": {
"uzs": {
"amount": 4000,
"repaid_amount": 1000,
"returned_amount": 0,
"remaining_amount": 3000
}
}
}
],
"links": {
"first": "https://api.wasyt.uz/company/client/debt?page=1",
"last": "https://api.wasyt.uz/company/client/debt?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/client/debt",
"per_page": 20,
"to": 1,
"total": 1
}
}Долг
/company/client/debt/{model}Один долг; через with[] подгружаются продажа с товарами и оплатами и погашения долга.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры пути
| Параметр | Описание |
|---|---|
model | ID записи |
Параметры запроса
| Параметр | Описание |
|---|---|
with[] | Подгрузить связи |
GET /company/client/debt/58?with[0]=client&with[1]=sale.products.product&with[2]=payments.creator.profileОтвет · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
id | integer | ID |
creator_id | integer | Создатель |
company_id | integer | Компания |
client_id | integer | Клиент |
sale_id | integer | Продажа |
currency | string | Валюта |
amount | integer | Сумма |
repaid_amount | integer | Сумма погашения |
returned_amount | integer | Возвращённая сумма |
due_date | string | Срок погашения |
comment | string | Комментарий |
status | string | Статус |
created_at | string | Создано |
updated_at | string | Обновлено |
client | object | |
client.id | integer | ID |
client.creator_id | integer | Создатель |
client.company_id | integer | Компания |
client.bonus_tariff_id | integer | Бонусный тариф |
client.bonus_entries_amount | integer | Сумма бонусных записей |
client.bonus_accumulations_amount | integer | Бонусный баланс |
client.full_name | string | ФИО |
client.gender | string | Пол |
client.birth_date | string | Дата рождения |
client.image | string | Изображение |
client.image_thumbs | object | |
client.image_thumbs.widen_100 | object | |
client.image_thumbs.widen_100.raw | string | |
client.image_thumbs.widen_100.webp | string | |
client.image_thumbs.widen_500 | object | |
client.image_thumbs.widen_500.raw | string | |
client.image_thumbs.widen_500.webp | string | |
client.image_thumbs.original | object | |
client.image_thumbs.original.raw | string | |
client.image_thumbs.original.webp | string | |
client.main_phone | string | Основной телефон |
client.additional_phones | array | Дополнительные телефоны |
client.languages | array | Языки |
client.address | null | Адрес |
client.latitude | null | Широта |
client.longitude | null | Долгота |
client.socials | object | Соц-сети |
client.socials.other | string | |
client.socials.facebook | string | |
client.socials.telegram | string | |
client.socials.instagram | string | |
client.is_imported | boolean | |
client.created_at | string | Создано |
client.updated_at | string | Обновлено |
client.is_deleted | boolean | |
sale | object | |
sale.id | integer | ID |
sale.creator_id | integer | Создатель |
sale.company_id | integer | Компания |
sale.cashbox_id | integer | Касса |
sale.stock_id | integer | Склад |
sale.client_id | integer | Клиент |
sale.exchange_of_sale_id | null | |
sale.currency | string | Валюта |
sale.purchased_amount | integer | |
sale.sold_amount | integer | Сумма в продаже |
sale.returned_amount | integer | Возвращённая сумма |
sale.status | string | Статус |
sale.source_type | string | Источник |
sale.source_data | array | |
sale.code | string | Код |
sale.created_at | string | Создано |
sale.updated_at | string | Обновлено |
sale.products | object[] | Продукты |
sale.products[].id | integer | ID |
sale.products[].company_id | integer | Компания |
sale.products[].sale_id | integer | Продажа |
sale.products[].product_id | integer | Продукт |
sale.products[].service_id | null | |
sale.products[].bundle_id | null | Комплект |
sale.products[].bundle_key | null | |
sale.products[].purchase_price | integer | Цена при покупке |
sale.products[].price | integer | Цена |
sale.products[].discount | integer | Скидка |
sale.products[].sold_quantity | integer | Кол-во в продаже |
sale.products[].returned_quantity | integer | Возвращённое кол-во |
sale.products[].returned_data | array | |
sale.products[].last_returned_at | null | |
sale.products[].stock_product_source_data | object | |
sale.products[].stock_product_source_data.source_type | string | Источник |
sale.products[].stock_product_source_data.source_id | integer | Источник |
sale.products[].stock_product_source_data.source_product_id | integer | |
sale.products[].stock_product_source_data.quantity | integer | Количество |
sale.products[].stock_product_source_data.purchase_price | integer | Цена при покупке |
sale.products[].stock_product_source_data.purchase_currency | string | Валюта при покупке |
sale.products[].stock_product_source_data.created_at | string | Создано |
sale.products[].created_at | string | Создано |
sale.products[].updated_at | string | Обновлено |
sale.products[].product | object | |
sale.products[].product.id | integer | ID |
sale.products[].product.parent_id | null | Родитель |
sale.products[].product.creator_id | integer | Создатель |
sale.products[].product.company_id | integer | Компания |
sale.products[].product.category_id | integer | Категория |
sale.products[].product.brand_id | integer | Бренд |
sale.products[].product.unit_id | integer | Единица измерения |
sale.products[].product.name | string | Название |
sale.products[].product.full_text | string | Полный текст |
sale.products[].product.plu | string | Артикул (PLU) |
sale.products[].product.description | string | Описание |
sale.products[].product.is_free_price | boolean | Продажа по свободной цене |
sale.products[].product.is_favorite | boolean | |
sale.products[].product.min_quantity | null | |
sale.products[].product.barcode | string | Штрих-код |
sale.products[].product.images_list | array | Изображения |
sale.products[].product.images_list_thumbs | object[] | |
sale.products[].product.images_list_thumbs[].widen_100 | object | |
sale.products[].product.images_list_thumbs[].widen_500 | object | |
sale.products[].product.images_list_thumbs[].original | object | |
sale.products[].product.created_at | string | Создано |
sale.products[].product.updated_at | string | Обновлено |
sale.products[].product.is_deleted | boolean | |
payments | object[] | |
payments[].id | integer | ID |
payments[].creator_id | integer | Создатель |
{
"id": 58,
"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:46",
"updated_at": "2026-09-30 12:51:46",
"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:46",
"is_deleted": false
},
"sale": {
"id": 1,
"creator_id": 2,
"company_id": 1,
"cashbox_id": 1,
"stock_id": 1,
"client_id": 1,
"exchange_of_sale_id": null,
"currency": "uzs",
"purchased_amount": 500,
"sold_amount": 4900,
"returned_amount": 0,
"status": "completed",
"source_type": "wasyt",
"source_data": [],
"code": "w-1-1",
"created_at": "2020-01-01 10:00:00",
"updated_at": "2020-01-01 10:00:00",
"products": [
{
"id": 1,
"company_id": 1,
"sale_id": 1,
"product_id": 1,
"service_id": null,
"bundle_id": null,
"bundle_key": null,
"purchase_price": 100,
"price": 1000,
"discount": 100,
"sold_quantity": 1,
"returned_quantity": 0,
"returned_data": [],
"last_returned_at": null,
"stock_product_source_data": {
"source_type": "purchase",
"source_id": 1,
"source_product_id": 1,
"quantity": 1,
"purchase_price": 1000,
"purchase_currency": "uzs",
"created_at": "2026-09-30 12:47:59"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"product": {
"id": 1,
"parent_id": null,
"creator_id": 1,
"company_id": 1,
"category_id": 4,
"brand_id": 1,
"unit_id": 1,
"name": "Product 1",
"full_text": "Product 1",
"plu": "0001",
"description": "Description 1",
"is_free_price": false,
"is_favorite": false,
"min_quantity": null,
"barcode": "0000000000001",
"images_list": [
"https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
],
"images_list_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"
}
},
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
}
}
],
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:51:46",
"is_deleted": false
}
},
{
"id": 2,
"company_id": 1,
"sale_id": 1,
"product_id": 2,
"service_id": null,
"bundle_id": null,
"bundle_key": null,
"purchase_price": 200,
"price": 2000,
"discount": 0,
"sold_quantity": 2,
"returned_quantity": 0,
"returned_data": [],
"last_returned_at": null,
"stock_product_source_data": {
"source_type": "purchase",
"source_id": 1,
"source_product_id": 2,
"quantity": 2,
"purchase_price": 2000,
"purchase_currency": "usd",
"created_at": "2026-09-30 12:47:59"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"product": {
"id": 2,
"parent_id": 1,
"creator_id": 1,
"company_id": 1,
"category_id": 4,
"brand_id": 1,
"unit_id": 1,
"name": "Product 1-1",
"full_text": "Product 1-1 full text",
"plu": "0011",
"description": "Description 1-1",
"is_free_price": false,
"is_favorite": false,
"min_quantity": null,
"barcode": "0000000000011",
"images_list": [
"https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
],
"images_list_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"
}
},
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
}
}
],
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:51:46",
"is_deleted": false
}
}
]
},
"payments": [
{
"id": 40,
"creator_id": 2,
"company_id": 1,
"client_id": 1,
"debt_id": 58,
"cashbox_id": 1,
"is_refunded": false,
"payment_type": "cash",
"currency": "uzs",
"amount": 1000,
"is_imported": false,
"created_at": "2026-09-30 12:51:46",
"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": " "
}
},
"is_refundable": false
}
],
"remaining_amount": 3000,
"overdue_days": 0,
"by_currency": {
"uzs": {
"amount": 4000,
"repaid_amount": 1000,
"returned_amount": 0,
"remaining_amount": 3000
}
}
}
