Sotuv tovarlari
Chek qatorlari: sotilgan tovarlar, xizmatlar va komplekt tarkibiy qismlari narx, chegirma, sotilgan va qaytarilgan miqdor bilan.
| Metod | Manzil | Vazifasi |
|---|---|---|
| GET | /company/trade/sale-product | Sotuv tovarlari ro‘yxati |
| GET | /company/trade/sale-product/{model} | Sotuv qatori |
Sotuv tovarlari ro‘yxati
GET
/company/trade/sale-productChek qatorlari sahifalab va filtrlar bilan; format=excel bilan — Excel’ga eksport.
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
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
format | string | Yo‘q | Javob formati: excel — ro‘yxatni JSON o‘rniga Excel fayl sifatida yuklab olish (xuddi shu filtrlar qo‘llanadi) |
filter[id] | — | Yo‘q | ID — aniq qiymat |
filter[company_id] | — | Yo‘q | Kompaniya — bitta qiymat yoki ro‘yxat filter[company_id][] |
filter[sale_id] | — | Yo‘q | Sotish — aniq qiymat |
filter[product_id] | — | Yo‘q | Mahsulot — aniq qiymat |
filter[service_id] | — | Yo‘q | aniq qiymat |
filter[bundle_id] | — | Yo‘q | Komplekt — aniq qiymat |
filter[last_returned_at] | — | Yo‘q | davr: [0] — dan, [1] — gacha (Y-m-d) |
filter[returned_quantity] | — | Yo‘q | Qaytarilgan miqdor — oraliq: [0] — dan, [1] — gacha |
filter[created_at] | — | Yo‘q | Yaratilgan — davr: [0] — dan, [1] — gacha (Y-m-d) |
filter[product.category_id] | — | Yo‘q | Kategoriya — aniq qiymat (ichki elementlar bilan) |
filter[product.brand_id] | — | Yo‘q | Brend — aniq qiymat |
filter[product.unit_id] | — | Yo‘q | O'lchov birligi — aniq qiymat |
filter[sale.currency] | — | Yo‘q | Valyuta — aniq qiymat |
sort[] | — | Yo‘q | Saralash, - — kamayish bo‘yicha: id, -id |
with[] | — | Yo‘q | Bog‘liq ma’lumotlarni qo‘shish: company, sale, sale.creator.profile, product, product.parent, product.category.ancestors, product.brand, product.unit, service, service.category.ancestors, service.service_unit, bundle |
page | — | Yo‘q | Sahifa raqami, 1 dan |
page-size | — | Yo‘q | Sahifadagi yozuvlar soni, ko‘pi bilan 20 |
Javob · 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[].sale_id | integer | Sotish |
data[].product_id | integer | Mahsulot |
data[].service_id | null | |
data[].bundle_id | null | Komplekt |
data[].bundle_key | null | |
data[].purchase_price | integer | Sotib olish narxi |
data[].price | integer | Narxi |
data[].discount | integer | Chegirma |
data[].sold_quantity | integer | Sotuvdagi miqdor |
data[].returned_quantity | integer | Qaytarilgan miqdor |
data[].returned_data | array | |
data[].last_returned_at | null | |
data[].stock_product_source_data | object | |
data[].stock_product_source_data.source_type | string | Manba |
data[].stock_product_source_data.source_id | integer | Manba |
data[].stock_product_source_data.source_product_id | integer | |
data[].stock_product_source_data.quantity | integer | Miqdori |
data[].stock_product_source_data.purchase_price | integer | Sotib olish narxi |
data[].stock_product_source_data.purchase_currency | string | Sotib olayotganda valyuta |
data[].stock_product_source_data.created_at | string | Yaratilgan |
data[].created_at | string | Yaratilgan |
data[].updated_at | string | Yangilangan |
data[].cashier_name | string |
json
{
"data": [
{
"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",
"cashier_name": "director_1@local.host"
},
{
"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",
"cashier_name": "director_1@local.host"
}
],
"links": {
"first": "https://api.wasyt.uz/company/trade/sale-product?page=1",
"last": "https://api.wasyt.uz/company/trade/sale-product?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/trade/sale-product",
"per_page": 20,
"to": 2,
"total": 2
}
}Sotuv qatori
GET
/company/trade/sale-product/{model}Chekning bitta qatori: tovar, xizmat yoki komplekt qismi narx, chegirma, sotilgan va qaytarilgan miqdor bilan.
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 |
sale_id | integer | Sotish |
product_id | integer | Mahsulot |
service_id | null | |
bundle_id | null | Komplekt |
bundle_key | null | |
purchase_price | integer | Sotib olish narxi |
price | integer | Narxi |
discount | integer | Chegirma |
sold_quantity | integer | Sotuvdagi miqdor |
returned_quantity | integer | Qaytarilgan miqdor |
returned_data | array | |
last_returned_at | null | |
stock_product_source_data | object | |
stock_product_source_data.source_type | string | Manba |
stock_product_source_data.source_id | integer | Manba |
stock_product_source_data.source_product_id | integer | |
stock_product_source_data.quantity | integer | Miqdori |
stock_product_source_data.purchase_price | integer | Sotib olish narxi |
stock_product_source_data.purchase_currency | string | Sotib olayotganda valyuta |
stock_product_source_data.created_at | string | Yaratilgan |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
cashier_name | string |
json
{
"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",
"cashier_name": "director_1@local.host"
}
