# Glossary

The API reference has 85 resources, and several of them look alike. These are the pairs integrators
confuse most.

## Most often confused

| Term | Meaning |
|---|---|
| `sale-order` vs `trade` | `sale-order` is a customer's **order**, not yet a sale. `trade` is **the sale itself**. An order becomes a sale through `trade/create` with `order_id`, and turns `done` once fully sold |
| POS receipt | Not a resource of its own: a receipt rung up at the till is written as a `trade` and shows up in `trade/get-paging` |
| Refund | A separate `trade` with `is_refund: true` and `refund_id` pointing at the original. The original's `total_refunded_amount` grows |
| `purchase-order` → `purchase` → `income` | An **order** to a supplier → the **purchase** (goods "on the way") → the **income** into a warehouse (goods enter stock). `purchase-return` sends goods back |
| `product-warehouse` vs `product-stock` | `product-warehouse` holds counters per product × warehouse (`amount`, `booked`, `in_transit`, `on_the_way`) — the one to sell from. `product-stock` holds batch-level rows: cost, marking codes, expiry |
| `price` vs product prices | `price` is a **price list** (currency, sale or income type). A product's actual price is a value inside a list, from `price/items/get-paging` |
| `customer` vs `person` | `customer` is the CRM customer (state, category, organizations). `person` is a shared record of a human, who can be a customer, a supplier and an employee at once |
| `payment-method` vs `payment-type` | `payment-method` is **how** money was paid (cash, card, transfer). `payment-type` is **why** it moved (sale, debt, balance top-up, salary) |
| `states` vs `states-settings` | The same thing — pipeline columns. `states/get-all` only reads; `states-settings` manages them fully |
| `section` | **Not** a sales section: an HR department (the staff tree) |
| `organization` vs `warehouse` | An organization is a legal entity with its own currency. A warehouse belongs to one organization |

## Document states

| Document | States |
|---|---|
| `trade` | `new` → `in_progress` → `done`; `canceled` from any stage |
| `sale-order` | `new`, `draft`, `in_progress`, `accepted`, `done`, `canceled`. `state_id` is the pipeline column. An order created by an integration lands in the first regular column as `in_progress` |
| `purchase` | `new`, `in_progress`, `done`, `canceled`; receiving progress in `income_state`: `zero`, `partial`, `full` |
| `purchase-order` | `new`, `draft`, `accepted`, `in_progress`, `done`, `canceled` |
| `income`, `purchase-return` | `done`, `canceled` |
| `transaction` | `pending` → `done` or `rejected`; `done` → `canceled`. Type: `income`, `expense`, `transfer`, `exchange`, `exchange_method` |
| `cashbox-session` | `open`, `closed`, `resolved`, `flagged` |
| `customer` | `new`, `active`, `warning`, `black_list` |

Every resource's fields are in the [API reference](https://docs.bito.uz/en/api/index.md).
