# Stores

### Overview

Store data flows **one-way from Omnium to Flow**. When stores are exported from Omnium, the integration automatically creates the associated organizations, warehouses, and optionally store-specific price lists in Flow.

### Export eligibility

Only stores marked as **primary stores** in Omnium are exported as Flow stores. Non-primary stores function as warehouses beneath their parent primary store.

### Sync process

1. Omnium identifies stores to export (filtered by market or market group)
2. For each store:
   * The **organization** is created or looked up
   * The **store** is created or updated in Flow
   * Associated **warehouses** are created or updated
   * If `StorePriceListsInFlow` is enabled, a **store-specific price list** is created

### Store field mapping

| Flow field    | Omnium source                 | Notes              |
| ------------- | ----------------------------- | ------------------ |
| `storeUid`    | `Id`                          | UID-sanitized      |
| `name`        | `Name`                        | —                  |
| `address`     | `StreetName` + `StreetNumber` | Combined           |
| `city`        | `Address.City`                | —                  |
| `postalCode`  | `Address.Zipcode`             | —                  |
| `countryCode` | `Address.CountryCode`         | —                  |
| `email`       | `Email`                       | —                  |
| `phone`       | `PhoneNumber`                 | —                  |
| `latitude`    | `Latitude`                    | Parsed from string |
| `longitude`   | `Longitude`                   | Parsed from string |
| `isActive`    | `!IsInactive`                 | Inverted logic     |

#### Create vs. update behavior

Some fields are only set during **creation** and excluded from updates:

| Field                       | Set on create | Set on update          |
| --------------------------- | ------------- | ---------------------- |
| `purchaseNumberSeriesUid`   | Yes           | No                     |
| `salesPriceUid`             | Yes           | No                     |
| `voucherNumberSeriesUid`    | Yes           | No                     |
| `defaultWarehouseUid`       | Yes           | Set to first available |
| `defaultReturnWarehouseUid` | Yes           | Set to first available |

### Organizations

Each store in Flow requires an organization. The organization UID is derived from the store's `OrganizationalNumber` in Omnium. If the store has no organizational number, the fallback `OrganizationUid` from the connector configuration is used.

### Warehouses

Warehouses are created from two sources during every store export:

1. **The store itself** — if `IsWarehouse = true`, the store is also registered as a warehouse
2. **Linked warehouses** — warehouses from the store's `AvailableWarehouses` list in Omnium

Warehouses are created or updated on every export cycle.

### Store-specific price lists

When `StorePriceListsInFlow` is enabled:

* A dedicated price list is created for each store
* The price list UID is derived from the store UID
* Store-specific selling prices are pushed to this price list instead of the global one

### Configuration reference

| Setting                     | Description                          | Default     |
| --------------------------- | ------------------------------------ | ----------- |
| `OrganizationUid`           | Fallback organization UID            | Required    |
| `MainPricesListUid`         | Default price list UID               | Required    |
| `PurchaseNumberSeriesUid`   | PO number series for new stores      | Conditional |
| `VoucherNumberSeriesUid`    | Voucher number series for new stores | Conditional |
| `StorePriceListsInFlow`     | Generate per-store price lists       | `false`     |
| `UseMarketGroupFlowTenants` | Group stores by market group         | `false`     |

### Error handling

Errors during store export are tracked with market-specific keys (e.g., `FlowRetail{marketId} storeExport`). Errors are automatically cleared on the next successful export.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowretail.com/docs/integrations/order-management/omnium-oms-integration/stores.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
