# Automatic Fulfillment

Automatic fulfillment ships orders end to end without manual work: new orders are submitted to your [logistics integration](https://docs.odus.com/docs/guides/order-management/integrations.md) automatically, and when the provider ships, the fulfillment is recorded with carrier and tracking details. **Fulfillment routes** are the rules that decide which orders are submitted to which integration.

## How it works

<!-- -->

## How routes are matched

Routes are evaluated for every new order after its bundling window closes:

1. Published, active routes are checked in **priority order**.
2. A route matches when the order's shipping country is in the route's countries (empty list = any country) and the item's SKU is in the route's SKUs (empty list = any SKU).
3. A matching route is used only when its integration has the [whole order in stock](#stock-coverage). Otherwise the route is skipped and the next route by priority is checked.
4. Every shippable item of the order must resolve to the **same integration**. Orders whose items would go to different providers are left for manual fulfillment.

A matched order is submitted to the provider automatically, within minutes of the bundling window closing. Temporary provider failures are retried automatically with increasing delays. An order your provider refuses because your prepaid balance can't cover it is put [On hold](https://docs.odus.com/docs/guides/order-management/order-statuses.md#held-for-your-prepaid-balance) and sent again once the balance covers it. An order ShipBob accepts and then holds — because it couldn't charge your payment method, can't validate the address, or for another reason — is put [On hold](https://docs.odus.com/docs/guides/order-management/order-statuses.md#held-by-shipbob) until ShipBob releases it.

Orders that no route matches — or that cannot be submitted, for example because the integration was archived — simply stay in the orders list for manual fulfillment.

## Stock coverage

A route is used only when its integration has **every shippable item of the order in stock, in the quantities ordered**. Otherwise the route is skipped and the next route by priority is checked, so an order is never split between providers and never submitted to a provider that is short of an item. There is nothing to configure: every route works this way.

Stock is read from the same figures the [Inventory](https://docs.odus.com/docs/guides/order-management/inventory.md) page shows, so a SKU the integration reports no figure for — not stocked there, or [not mapped](https://docs.odus.com/docs/guides/order-management/inventory.md#mapping-a-sku-to-a-provider) to it — counts as not in stock.

For example, with a route for US orders of product A going to a preferred provider ahead of a catch-all route, a US order containing products A and B matches the preferred route first. If that provider has no stock of B, the route is skipped and the whole order goes to the catch-all provider — which must itself have both A and B in stock, since every route is held to the same rule.

When a route is skipped, the order's activity names the route and the SKUs its integration was short of, so you can see why an order went to a lower-priority provider or stayed unfulfilled.

If the integration's stock could not be read — the provider did not answer when the inventory figures were last refreshed — the order is neither routed past that route nor submitted blind. It is retried later, like a temporary provider failure.

## What each provider needs from an order

An order is only submitted once it carries everything the provider requires. Orders missing required details are left for manual fulfillment instead of being retried, and the reason is shown on the order.

**NextSmartShip** is the stricter of the two. Every order it receives must have a shipping address with a **first and last name**, a **phone number**, a **country**, a **city**, a **postal code** and a **street address**. Orders missing any of these are not submitted.

The exceptions are a postal code or a city that the country alone decides. Order Management System fills these in, so you don't need to edit the address first:

* **No postal code, to a country without postal codes**, such as the United Arab Emirates or Qatar: the order is sent with the postal code `00000`.
* **No city, to a country that is a single city**, such as Singapore: the order is sent with the country's name as its city.

Only what is sent to NextSmartShip is filled in. The order keeps the address as your customer entered it. An [export](https://docs.odus.com/docs/guides/order-management/export-and-bulk-fulfill.md) in NextSmartShip's format writes the same values.

NextSmartShip also requires a shipping service to be chosen for each order rather than picking one itself. Order Management System requests the available services for the destination and selects the **cheapest** one. If NextSmartShip returns no services at all for an address, the order cannot ship to that destination and is left for manual handling.

An order NextSmartShip accepts but then cannot find a carrier for is put [on hold](https://docs.odus.com/docs/guides/order-management/order-statuses.md#on-hold-orders), with the reason shown on the order; correct the customer, and for most reasons the order is [resubmitted for you](https://docs.odus.com/docs/guides/order-management/managing-orders.md#resubmitting-an-order-your-provider-put-on-hold).

### Details NextSmartShip is likely to hold an order for

If you have an active NextSmartShip integration, Order Management System checks each order's customer details before NextSmartShip sees them, and marks an order that falls short [On hold](https://docs.odus.com/docs/guides/order-management/order-statuses.md#likely-to-be-held-by-your-provider) — a missing required detail from the list above, or a detail that breaks one of these rules:

* The name, the company and each address line fit in 35 bytes, and both address lines together fit in 40. Middle names are dropped and common street words are abbreviated to make a name or an address fit, so only one that is still too long is marked. A company is never shortened.
* The name is at least 5 bytes long.
* Limits count bytes rather than characters. That matters only for text kept in a script with no Latin form, where each character takes two to four bytes.
* The postal code is a valid postal code for the country.
* In Australia, Canada and the United States, the city is a place the postal code covers, and the state is one the state or postal code identifies.
* The name, company, address lines and city can be printed in Latin letters.
* The first address line, the city and the postal code are not placeholders such as `N/A` or `test`.

An order that only breaks these rules is still submitted on time, but NextSmartShip is likely to put it on hold. Correct the customer before the bundling window closes to avoid the hold. To check an order yourself without submitting it, call `GET /orders/{orderId}/recipient-validation?integrationType=nextsmartship` in the [Order Management API](https://docs.odus.com/docs/api/oms/odus-oms-api).

## Publishing and pausing routes

Open a route to manage its lifecycle from the **Actions** menu:

* **Publish** — makes a draft route live. Only published routes are evaluated.
* **Deactivate** / **Activate** — temporarily pauses a route (for example during a provider outage) without losing its configuration.

## Priorities

When routes overlap — say, a Europe-wide route and a Germany-specific one — the route with the higher priority (lower number) wins. On the **Rules** tab, sort by priority to drag-and-drop routes into the right order.

## The Coverage tab

The **Coverage** tab shows a matrix of countries × SKUs, with each cell showing the integration that would handle that combination — or a dash where no published route applies. Use it to spot gaps in your routing table before customers hit them.

tip

Review the Coverage tab after every route change. A missing cell means orders for that country/SKU combination will wait for manual fulfillment.
