Common scenarios
Most integrations are one of four kinds. For each one below: which way the data flows, which methods you need, which webhooks to subscribe to, and how to reconcile. All of them start from Quick start and Calling the API.
Two words, two different things
sale-order is a customer's order, not yet a sale. trade is the sale itself. An order from an online shop is written as a sale-order.
1. Storefront or marketplace: catalog out of Bito
Products, prices and stock flow from Bito to a website or a marketplace. Step by step: the catalog sync recipe.
| Step | Method |
|---|---|
| Initial full load | POST /product/get-paging, with page and limit |
| Changes only | The same method, updated_at = your last sync time |
| Deleted | GET /product/get-deleted |
| Prices | POST /price/items/get-paging |
| Stock per warehouse | POST /product-warehouse/get-paging, with updated_at |
In stock rows, amount is the quantity available to sell: reservations and goods in transit are not in it. Webhooks: products.*, productPrices.*. They cut the number of calls, but they do not replace a scheduled full re-read: bulk operations emit no webhooks.
2. Online order into Bito
A website, bot or courier app takes an order, and it has to show up in Bito. Step by step: the online order recipe.
| Step | Method |
|---|---|
| Find the customer | GET /customer/get-by-phone-number |
| Not found — create | POST /customer/create |
| Create the order | POST /sale-order/create |
Store the _id from the response next to your own order: if no response came back, read to check whether the order exists before retrying. To follow the order's status, subscribe to the saleOrders.status_change webhook.
3. Warehouse: movements from an accounting system
An accounting or ERP system writes stock movements into Bito.
| Document | Reference |
|---|---|
| Purchase | Purchase |
| Income | Income |
| Internal transfer | Internal transfer |
| Write-off | Write-off |
Before every create, check on your side whether the document was already written: these methods are not idempotent, and a retried call creates a second document.
4. BI and analytics: read only
Sales, cash flow and reports go out to a BI tool or 1C. Step by step: the export recipe.
| Data | Method |
|---|---|
| Sales | POST /trade/get-paging, with updated_at |
| Cash flow | POST /transaction/get-paging |
| Ready-made reports | Sales reports, finance reports |
Webhooks: trades.*, transactions.*.
What the API does not have
None of these exist, and there is no hidden method that works around them.
| Missing | Instead |
|---|---|
An idempotency-key header | Before retrying a write, read to check whether it already exists |
| Webhook retries, ordering, and events from bulk operations | Treat a webhook as a signal to re-read, and reconcile with scheduled full reads — webhooks |
Something not working? Start with the symptom map.