Inventarizatsiya qatorlari
Sanash pozitsiyalari: hisobdagi miqdor, haqiqiy miqdor, kirim narxi va «tekshirilgan» belgisi.
| Metod | Manzil | Vazifasi |
|---|---|---|
| GET | /company/trade/inventory-product | Sanash qatorlari ro‘yxati |
| GET | /company/trade/inventory-product/{model} | Sanash qatori |
| PUT | /company/trade/inventory-product/{model} | Haqiqiy miqdorni kiritish |
Sanash qatorlari ro‘yxati
GET
/company/trade/inventory-productInventarizatsiya qatorlari sahifalab va filtrlar bilan (masalan, inventory_id bo‘yicha); 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[inventory_id] | — | Yo‘q | Inventarizatsiya — aniq qiymat |
filter[product_id] | — | Yo‘q | Mahsulot — aniq qiymat |
filter[is_checked] | — | Yo‘q | aniq qiymat |
filter[created_at] | — | Yo‘q | Yaratilgan — davr: [0] — dan, [1] — gacha (Y-m-d) |
sort[] | — | Yo‘q | Saralash, - — kamayish bo‘yicha: id, -id |
with[] | — | Yo‘q | Bog‘liq ma’lumotlarni qo‘shish: product, product.parent, product.category.ancestors, product.brand, product.unit |
page | — | Yo‘q | Sahifa raqami, 1 dan |
page-size | — | Yo‘q | Sahifadagi yozuvlar soni, ko‘pi bilan 20 |
show[] | — | Yo‘q | Qo‘shimcha hisoblangan ma’lumotlar (metod tavsifiga qarang) |
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[].inventory_id | integer | Inventarizatsiya |
data[].product_id | integer | Mahsulot |
data[].stock_quantity | integer | Ombordagi miqdor |
data[].actual_quantity | integer | Haqiqiy miqdor |
data[].price | integer | Narxi |
data[].currency | string | Valyuta |
data[].is_checked | boolean | |
data[].comment | null | Izoh |
data[].created_at | string | Yaratilgan |
data[].updated_at | string | Yangilangan |
data[].total_price | integer | |
data[].quantity_diff | integer | Farq |
json
{
"data": [
{
"id": 3,
"company_id": 1,
"inventory_id": 2,
"product_id": 2,
"stock_quantity": 2,
"actual_quantity": 4,
"price": 2000,
"currency": "usd",
"is_checked": false,
"comment": null,
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"total_price": 4000,
"quantity_diff": 2
},
{
"id": 2,
"company_id": 1,
"inventory_id": 2,
"product_id": 1,
"stock_quantity": 1,
"actual_quantity": 5,
"price": 1000,
"currency": "uzs",
"is_checked": false,
"comment": null,
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"total_price": 4000,
"quantity_diff": 4
}
],
"links": {
"first": "https://api.wasyt.uz/company/trade/inventory-product?page=1",
"last": "https://api.wasyt.uz/company/trade/inventory-product?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/trade/inventory-product",
"per_page": 20,
"to": 3,
"total": 3
}
}Sanash qatori
GET
/company/trade/inventory-product/{model}Inventarizatsiyaning bitta qatori: tovar, hisobdagi va haqiqiy miqdor, narx va is_checked belgisi.
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 |
inventory_id | integer | Inventarizatsiya |
product_id | integer | Mahsulot |
stock_quantity | integer | Ombordagi miqdor |
actual_quantity | integer | Haqiqiy miqdor |
price | integer | Narxi |
currency | string | Valyuta |
is_checked | boolean | |
comment | null | Izoh |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
total_price | integer | |
quantity_diff | integer | Farq |
json
{
"id": 1,
"company_id": 1,
"inventory_id": 1,
"product_id": 1,
"stock_quantity": 1,
"actual_quantity": 2,
"price": 1000,
"currency": "uzs",
"is_checked": false,
"comment": null,
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"total_price": 1000,
"quantity_diff": 1
}Haqiqiy miqdorni kiritish
PUT
/company/trade/inventory-product/{model}Haqiqiy miqdorni (kerak bo‘lsa narx va izohni ham) saqlaydi va qatorni tekshirilgan deb belgilaydi (is_checked = true), qiymat o‘zgarmagan bo‘lsa ham. Narx berilmasa, qisman sanashda u tovarning oxirgi kirimidan olinadi. Faqat inventarizatsiya in_progress bo‘lganda.
Formadan (
multipart/form-data)PUTmetodiPOST+?_method=PUTparametri 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 |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
actual_quantity | number | Ha | Haqiqiy miqdor. Verguldan keyin 4 tagacha raqam. Kamida 0 |
price | number | Yo‘q | Narxi. Verguldan keyin 4 tagacha raqam. Kamida 0 |
comment | string | Yo‘q | Izoh. Maks. 1000 belgi |
json
{
"actual_quantity": 0.3,
"price": 1500,
"comment": "Повреждён при перевозке"
}bash
curl -X PUT "https://api.wasyt.uz/company/trade/inventory-product/1" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"actual_quantity":0.3,"price":1500,"comment":"Повреждён при перевозке"}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
company_id | integer | Kompaniya |
inventory_id | integer | Inventarizatsiya |
product_id | integer | Mahsulot |
stock_quantity | integer | Ombordagi miqdor |
actual_quantity | number | Haqiqiy miqdor |
price | integer | Narxi |
currency | string | Valyuta |
is_checked | boolean | |
comment | string | Izoh |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
total_price | integer | |
quantity_diff | number | Farq |
json
{
"id": 1,
"company_id": 1,
"inventory_id": 1,
"product_id": 1,
"stock_quantity": 1,
"actual_quantity": 0.3,
"price": 1500,
"currency": "uzs",
"is_checked": true,
"comment": "Повреждён при перевозке",
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:54:21",
"total_price": 1050,
"quantity_diff": -0.7
}
