# Integratsiya kaliti nimalar qila oladi

> Integratsiya kaliti uchun ochiq bo'lgan marshrutlarning to'liq ro'yxati va unda kerakli usul bo'lmasa, nima qilish kerakligi.

Integratsiya kalitining ruxsati kalitga biriktirilgan marshrutlar ro’yxati bo’yicha tekshiriladi — bu ruxsatning **birinchi darajasi**. Ikkinchi daraja — [kalit roli ruxsatlari](/uz/reference/role-permissions/) — javobda nima qaytishini hal qiladi.

Quyidagi ro’yxat — kalit yaratilganda unga beriladigan **asosiy shablon**. Muayyan kalitning ruxsati kengroq bo’lishi mumkin — nozik metodlar BILLZ’da kalit ruxsatlarini sozlash orqali alohida ochiladi.

## Autentifikatsiya

Kalit va kirish tokenlari bilan ishlash.

| Metod  | Marshrut           |
| ------ | ------------------ |
| `POST` | `/v1/auth/login`   |
| `POST` | `/v2/auth/refresh` |

## Kompaniya ma’lumotnomalari

Ish boshida o’qiladi va kamdan-kam yangilanadi.

| Metod | Marshrut                          |
| ----- | --------------------------------- |
| `GET` | `/v1/company`                     |
| `GET` | `/v1/shop`                        |
| `GET` | `/v1/user`                        |
| `GET` | `/v1/supplier`                    |
| `GET` | `/v2/category`                    |
| `GET` | `/v2/brand`                       |
| `GET` | `/v2/product-characteristic`      |
| `GET` | `/v2/measurement-unit`            |
| `GET` | `/v2/product-type`                |
| `GET` | `/v1/cash-box`                    |
| `GET` | `/v1/company-payment-type`        |
| `GET` | `/v2/company-currencies`          |
| `GET` | `/v2/company-currency-rates`      |
| `GET` | `/v1/transaction-report-payments` |
| `GET` | `/v2/write-off-reason`            |

## Katalog

Mahsulotlarni yuklab olish va kartochkalarni tahrirlash.

| Metod   | Marshrut                          |
| ------- | --------------------------------- |
| `POST`  | `/v2/product`                     |
| `POST`  | `/v2/product-search-with-filters` |
| `PATCH` | `/v2/product/:id/patch-props`     |
| `GET`   | `/v2/products`                    |

## Sotuv

Chekning to’liq sikli — yaratishdan to’lovgacha.

| Metod    | Marshrut                               |
| -------- | -------------------------------------- |
| `POST`   | `/v1/recalculate-order-bill/:order_id` |
| `PUT`    | `/v2/order-customer-new/:order_id`     |
| `POST`   | `/v2/order-manual-discount/:order_id`  |
| `GET`    | `/v2/order-notes`                      |
| `POST`   | `/v2/order-payment/:order_id`          |
| `POST`   | `/v2/order-product/:order_id`          |
| `POST`   | `/v2/order`                            |
| `POST`   | `/v2/order/create_postpone`            |
| `GET`    | `/v2/order/:id`                        |
| `DELETE` | `/v2/order/:id`                        |
| `PATCH`  | `/v2/order/:id`                        |
| `POST`   | `/v2/order/return-postpone`            |

## Sovg’a kartalari

| Metod  | Marshrut                         |
| ------ | -------------------------------- |
| `POST` | `/v1/gift-card/activate-list`    |
| `GET`  | `/v1/gift-card/search`           |
| `POST` | `/v1/order-gift-card-remove/:id` |
| `PUT`  | `/v1/order-gift-card/:id`        |

## Mijozlar

| Metod   | Marshrut                       |
| ------- | ------------------------------ |
| `GET`   | `/v1/client`                   |
| `POST`  | `/v1/client`                   |
| `GET`   | `/v1/client-by-chat-id`        |
| `POST`  | `/v1/client-card`              |
| `PUT`   | `/v1/client/:id`               |
| `GET`   | `/v1/customer/:id`             |
| `PATCH` | `/v1/customer/set-balance/:id` |
| `PATCH` | `/v1/customer/bulk`            |
| `GET`   | `/v1/debt`                     |
| `GET`   | `/v1/debt-stats`               |

## Do’konlar orasidagi ko’chirishlar

| Metod    | Marshrut                  |
| -------- | ------------------------- |
| `GET`    | `/v2/transfer`            |
| `POST`   | `/v2/transfer`            |
| `GET`    | `/v2/transfer-items/:id`  |
| `DELETE` | `/v2/transfer/:id`        |
| `POST`   | `/v2/transfer/:id/add`    |
| `POST`   | `/v2/transfer/:id/send`   |
| `PUT`    | `/v2/transfer/finish/:id` |
| `PUT`    | `/v2/transfer/update/:id` |

## Hisobdan chiqarishlar

| Metod  | Marshrut                   |
| ------ | -------------------------- |
| `POST` | `/v2/write-off`            |
| `POST` | `/v2/write-off/:id/add`    |
| `PUT`  | `/v2/write-off/cancel/:id` |
| `PUT`  | `/v2/write-off/finish/:id` |

## Importlar

| Metod  | Marshrut                                  |
| ------ | ----------------------------------------- |
| `GET`  | `/v2/import`                              |
| `POST` | `/v2/product-import/create-with-products` |

## Yetkazib beruvchiga buyurtmalar

| Metod   | Marshrut                           |
| ------- | ---------------------------------- |
| `GET`   | `/v2/supplier-order`               |
| `POST`  | `/v2/supplier-order`               |
| `GET`   | `/v2/supplier-order-products/:id`  |
| `PUT`   | `/v2/supplier-order/add-item`      |
| `PATCH` | `/v2/supplier-order/change-status` |
| `PUT`   | `/v2/supplier-order/update/:id`    |

## Inventarizatsiya

Faqat ro’yxatni o’qish.

| Metod | Marshrut          |
| ----- | ----------------- |
| `GET` | `/v2/stocktaking` |

## Hisobotlar

Do’kon faoliyati bo’yicha ma’lumotlarni hisobot shaklida olish metodlari.

| Metod | Marshrut                                 |
| ----- | ---------------------------------------- |
| `GET` | `/v1/customer-general-table`             |
| `GET` | `/v1/customer-purchases-table`           |
| `GET` | `/v1/general-report-table`               |
| `GET` | `/v1/import-report-table`                |
| `GET` | `/v1/product-general-table`              |
| `GET` | `/v1/product-sells-by-suppliers-table`   |
| `GET` | `/v1/profit-and-lose`                    |
| `GET` | `/v1/report-product-performance-table`   |
| `GET` | `/v1/seller-general-table`               |
| `GET` | `/v1/stock-report-table`                 |
| `GET` | `/v1/stocktaking-summary-table`          |
| `GET` | `/v1/supplier-order-return-report-table` |
| `GET` | `/v1/transaction-report-table`           |
| `GET` | `/v1/transaction-report-totals`          |
| `GET` | `/v1/write-off-report-table`             |

## Hisobotlarni eksport qilish

Hisobotni sahifama-sahifa o’qish o’rniga tayyor Excel fayli.

| Metod  | Marshrut                                     |
| ------ | -------------------------------------------- |
| `POST` | `/v1/cashflow-excel`                         |
| `POST` | `/v1/customer-general-report-excel`          |
| `POST` | `/v1/customer-purchases-report-excel`        |
| `POST` | `/v1/general-report-excel`                   |
| `POST` | `/v1/import-report-excel`                    |
| `POST` | `/v1/product-general-report-excel`           |
| `POST` | `/v1/report-product-performance-excel`       |
| `POST` | `/v1/report-profit-and-lose-excel`           |
| `POST` | `/v1/seller-general-report-excel`            |
| `POST` | `/v1/sells-supplier-report-excel`            |
| `POST` | `/v1/stock-report-excel`                     |
| `POST` | `/v1/stocktaking-summary-table-excel-export` |
| `POST` | `/v1/supplier-order-returned-export`         |
| `POST` | `/v1/transaction-report-excel`               |
| `POST` | `/v1/transfer-report-excel-export`           |
| `POST` | `/v1/write-off-report-table-export`          |

> **Kerakli metod yo’q bo’lsa, nima qilish kerak**
>
> Ro’yxatdan tashqari metodga kirish ruxsati alohida so’raladi — bunda marshrut, HTTP-metod va maqsad ko’rsatiladi. Ba’zida vazifani ro’yxatdagi boshqa metod hal qiladi: masalan, sotuvlarni qidirish o’rniga — ma’lum davr uchun tranzaksiyalar hisoboti.

> **Metod ro’yxatda bor, lekin ma’lumotlar to’liq emas**
>
> Yetkazib berish narxining nolga tengligi, e’tiborsiz qoldirilgan `shop_ids`, bekor qilingan `only_deleted` va transfer yaratishda asinxron rad etish — bu [kalit rolining ruxsatlari](/uz/reference/role-permissions/).

`403` tahlili — [muammolarni hal qilish](/uz/troubleshooting/403-and-404/) bo’limida.