Skip to content
View as Markdown

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.

StepMethod
Initial full loadPOST /product/get-paging, with page and limit
Changes onlyThe same method, updated_at = your last sync time
DeletedGET /product/get-deleted
PricesPOST /price/items/get-paging
Stock per warehousePOST /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.

StepMethod
Find the customerGET /customer/get-by-phone-number
Not found — createPOST /customer/create
Create the orderPOST /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.

DocumentReference
PurchasePurchase
IncomeIncome
Internal transferInternal transfer
Write-offWrite-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.

DataMethod
SalesPOST /trade/get-paging, with updated_at
Cash flowPOST /transaction/get-paging
Ready-made reportsSales 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.

MissingInstead
An idempotency-key headerBefore retrying a write, read to check whether it already exists
Webhook retries, ordering, and events from bulk operationsTreat a webhook as a signal to re-read, and reconcile with scheduled full reads — webhooks

Something not working? Start with the symptom map.

Bito 2.0 Integration API