For the complete documentation index, see llms.txt. This page is also available as Markdown.

Order management

How an order management system and Flow Retail share orders, stock and fulfilment: who owns what, which endpoints carry it, and how to stay in sync.

An order management system (OMS) and Flow Retail stay in sync when every kind of data has one owner and the two systems meet through the API and webhooks.

The usual setup: the OMS owns online orders and pushes them into Flow Retail, where stores pick, hand over and sell. Flow Retail reports back what happened.

The OMS pushes orders, products, prices and stock into Flow Retail. Flow Retail announces changes by webhook, and the OMS fetches the detail and polls as a safety net.

What you need

An Integration user and token with permission for orders, returns and warehouses, and a stage tenant to build against. Read Webhooks first. It explains the delivery rules this guide relies on.

Who owns what?

Write the owner down for each row before you build anything. Most sync bugs are two systems both believing they own the same field.

Data
Owner
Direction
How

Online orders

OMS

OMS → Flow

Push on change

POS sales and receipts

Flow Retail

Flow → OMS

Webhook, then fetch

Picking, handling and deliveries

Flow Retail

Flow → OMS

Webhook, then fetch

Products and prices

OMS, or your ERP

→ Flow

Push on change, batch for prices

Stock

One owner per warehouse

Either

Batch push, or webhook and delta read

Customers

Shared

Both

One stable key (see below)

Purchase orders

OMS creates, Flow receives

Both

Push, then poll receipts

If Flow Retail should own the orders instead and the OMS only decides where to fulfil from, use the same pattern in reverse and read the sourcing endpoints under Order.

How do orders get into Flow Retail?

Send each order as one call. POST /tenants/{tenantUid}/stores/{storeUid}/orders/import takes the lines, payments, deliveries, handling and customer together, and applies them all or none.

The order ends up in one of three states:

What you sent
Resulting state

Fully paid

COMPLETE

A payment that is authorized, not captured

CONFIRMED

Nothing paid

PARKED

Unpaid orders can expire silently

Make the call safe to repeat. Derive orderUid from your OMS order id (letters, digits, - and _). Flow Retail rejects a second create with the same uid, so a retry cannot make a duplicate. After a timeout, read it back with GET /tenants/{tenantUid}/orders/{orderUid} before you send again.

Other keys you can carry: externalOrderNumber, externalIds[] and a per-line externalId. All are searchable.

To cancel, use DELETE on the order. PUT …/status only accepts OPEN, PARKED and CONFIRMED, and a delete is refused while payments are unrefunded.

How do changes come back to the OMS?

Webhook, then fetch. A payload names the order; it never says what changed. Acknowledge within 10 seconds, deduplicate on jobId, wait a few seconds so bursts collapse into one, then fetch the order once.

Event
Use it to

ORDER_STATE_CHANGE

Mark parked, confirmed or cancelled (not complete)

ORDER_SETTLED

Mark fully paid

ORDER_HANDLING_STATE_CHANGED

Follow picking

ORDER_LINE_DELIVERED, ORDER_DELIVERED

Mark handed over

ORDER_LINE_RESERVATION_CHANGE

Follow reservations

STOCK_CHANGE

Refresh stock. It carries no quantity

Flow Retail keeps the order state, payment state, delivery state and handling state separately. Combine them into your own statuses in the OMS.

What catches the events that never arrive?

Poll as a safety net. Webhooks have gaps: no event when an order is created, none when lines are edited on an open or parked order, none when a parked order expires, and none for deletes.

Check
How often
Call

Orders changed since the last run

Every 5 to 15 minutes, with overlap

POST /tenants/{tenantUid}/orders/search with lastModifiedAtFrom

Orders that are not final yet

Daily

The same search, filtered by state

Stock changed in stores

Every few minutes

POST /tenants/{tenantUid}/stores/{storeUid}/stock with modifiedAfter

Deleted products and customers

Nightly

List and compare

Keep only a watermark per check and your own order id. You need no mapping table when orderUid comes from your id.

How do you keep stock right?

Give each warehouse one stock owner. If the OMS owns it, write with PUT /tenants/{tenantUid}/stores/{storeUid}/warehouses/{warehouseUid}/stock/batch: up to 1000 products per call, quantity to set or changeQuantity to adjust, and one bad entry rolls back the whole call. If Flow Retail owns it, react to STOCK_CHANGE and read with POST /tenants/{tenantUid}/products/stock.

What goes wrong, and how do you avoid it?

  • Echo loops. A change your integration wrote comes back as an event and is written again. Skip events whose tenantUser is your integration user.

  • Overwriting the other side. Merge into the stored record and set only the fields you own.

  • Treating any failed lookup as missing. Only a 404 means absent. Retry everything else, or you will create duplicates.

  • Going backwards. Delivered quantity and return status only move forward. Never lower them from a stale copy.

  • Poisoned batches. One bad SKU fails the whole stock batch. Split and retry the halves.

  • Backfills that starve live events. Spread a bulk re-sync over time and let live events jump the queue.

  • Retries that lose context. A retry carries every reference of the original.

  • Two workers on one queue. Run one, or claim rows atomically.

How many calls is that?

Job
Calls

One order, imported

1

That order, followed to hand-over

About 3 to 6 fetches with debouncing

Registering deliveries from the OMS

1 + one per line

Stock for N products

One per 1000, per warehouse

Products

One per product. There is no batch

Idle polling

100 to 300 a day

Which APIs does this use?

For
API group

Import, read, search and cancel orders

Payments on an order

Deliveries

Picking and follow-up

Receipts

Stock reads

Stock writes

Events

Products and prices

Customers

Stuck? Email integration@flowretail.no with the logId from the error.

Last updated 30.10.2026

Was this helpful?