# API changelog

Changes to the Integration API and its documentation that affect integrators, newest first. The current
contract of every method is in the [API reference](https://docs.bito.uz/en/api/index.md) and the
[OpenAPI file](https://docs.bito.uz/openapi.json).

## Next release

### Added
- New guides: [first sale](https://docs.bito.uz/en/guide/first-sale.md), recipes for an external sale, stock and prices and write-off, [data model](https://docs.bito.uz/en/guide/concepts/data-model.md), sale lifecycle, warehouse documents, [error codes](https://docs.bito.uz/en/guide/errors.md), [diagnosing 403 and 404](https://docs.bito.uz/en/guide/403-404.md).
- Each endpoint in the [API reference](https://docs.bito.uz/en/api/index.md) names the permission it needs.

### Fixed — the spec now matches the backend
- **Request bodies fully reconciled with the backend.** Over 1,000 fields the backend silently drops
  were removed, fields it actually accepts were added, and required lists were corrected. The changes
  you are most likely to notice:
  - reports: each report has its own filters; many take the period as `from_date`/`to_date` (not `date_from`/`date_to`), and `reports/balance/get-at` takes `date`;
  - transactions (`income`, `expense`, `transfer`, `exchange`, `exchange-method`): `cashbox_id` is required; attachments are not accepted;
  - `trade/refund` expects a full sale body plus `reason_id`;
  - `trade/custom-fields/set`: `trade_id` and `custom_fields`; `trade/export-by-xls-template`: one sale's `_id`;
  - `purchase`: `supplier_id` (previously misspelled `supliaer_id`), `refund_states`; `sale-order/get-paging`: `date_from`;
  - attachment items: `{name, path, size, note}`.
- The OAuth base URL is `https://api.bito.uz/auth-api` (dev: `https://api.systematicdev.uz/auth-api`).
  The docs used to give it without `/auth-api`, and those calls failed.
- `sale-order/create`: only `organization_id` and `customer_id` are required; per line, `product_id`,
  `amount`, `price`. The server fills the rest ([online order recipe](https://docs.bito.uz/en/guide/recipes/online-order.md)).
- `sale-order/create`: removed the `uuid` request field and the "a repeat returns the existing order" text —
  the backend ignores the field and assigns `uuid` itself.
- `sale-order-bulk/update-status-many`: removed `reject_if_has_trades` — the backend has no such field.
- `customer/create`: `type` (`natural` or `legal`) is now marked required.
- `product/get-paging`: added the `price_id` filter (with `organization_id`, it fills `prices`).
- `product-warehouse/get-paging`: added the `product_ids` filter (up to 500).
- `trade/get-paging`: added the `date_from` and `date_to` filters (on `sold_at`).
- The `get-paging` responses of `tax`, `extra-cost` and `production-route-sheet` are described with the
  correct paged shape.

### Added — documentation
- curl, JavaScript, Python and PHP samples on every endpoint.
- [Recipes](https://docs.bito.uz/en/guide/recipes/online-order.md), [common scenarios](https://docs.bito.uz/en/guide/scenarios.md), [glossary](https://docs.bito.uz/en/guide/glossary.md),
  [verify in Bito](https://docs.bito.uz/en/guide/verify.md), and a symptom map in the FAQ.
- [For AI agents](https://docs.bito.uz/en/guide/ai.md): `llms.txt`, Markdown versions of every page, and an agent setup prompt.
- Documented the `user_id` and `source_id` headers, and how `required_permissions` and `ip_whitelist`
  are enforced.

## 2026-10-20

### Changed
- `sms-template`: `content` can use customer custom fields as variables — syntax in
  [the reference](https://docs.bito.uz/en/api/sms-template.md).

## 2026-09-23

### Changed
- `payment-method`: `type` and `subtype` split into separate fields.

## 2026-09-21

### Added
- Install and uninstall callbacks are signed with `X-Bito-Signature` — [hooks](https://docs.bito.uz/en/guide/lifecycle-hooks.md).

## 2026-09-11

### Changed
- New developer site: a guide plus a reference page per resource. Swagger UI is retired; the OpenAPI
  file stays available for download.

## 2026-09-06

### Added
- `finance-settings`: per-transaction-type limits for automatic expense approval
  (`expense_approval_type_limits`).

## 2026-09-04

### Added
- `product`: `warehouse_number`, the product's location in the warehouse, in `get-paging` and
  `get-by-id` responses.

## 2026-09-03

### Added
- New production methods: `production-task`, `production-tech-map`, `production-plan`,
  `production-route-sheet`.

## 2026-08-25

### Added
- `section`: create, update, delete.
- `position`: write methods; `person/get-paging`.

### Removed
- The `events-timeline` telephony webhook.
