# Shopify sync

Inventory pushes, completion metadata, work-order field publication, retry behaviour and tagging linked orders.

import Term from '~/components/Term.astro';
import { Aside } from '@astrojs/starlight/components';
import DocUpdated from '~/components/DocUpdated.astro';

Assemblified's work orders update Shopify when a build run picks materials, when it produces output, and when work-order completion writes linked-order metadata. With **Enhanced**, you can also publish work-order due dates and progress to product or variant metafields. Each connection has its own progress and retry controls.

## On this page

- Pick-time inventory push
- <Term def="residual-rounding">Residual rounding</Term> for fractional picks
- Compensation on cancel and reverse
- Completion-time output sync
- The retry banner
- Publish due dates and progress
- The completion overlay (per-order metafield)
- Tagging linked orders
- Order production confirmations

## Pick-time inventory push

When a build run picks Shopify-mapped materials, Assemblified pushes a Shopify inventory adjustment to decrement each material at its location. Pre-assembled stock and virtual materials are not part of this push — they live entirely on Assemblified's side.

The push happens **at pick time**, not at completion. The reasoning: once you've physically pulled the material off the shelf, Shopify's count is wrong until you reconcile, even if you haven't built the units yet.

The push is bundled by `(run, location)` so a multi-material pick from one location goes out as one call, not many.

## Residual rounding for fractional picks

Shopify only accepts whole-number deltas. Work order plans frequently have fractional picks — half a metre of fabric, 1.5 cans of paint per unit, a subassembly that draws 0.75 of a parent component.

To prevent long-term drift, Assemblified does this:

1. The fractional delta gets rounded to the nearest integer.
2. The integer goes to Shopify.
3. The leftover decimal is parked in a local **residual inventory** balance.
4. On the next pick that touches the same material at the same location, the residual is added back into the next delta. Eventually the residual reaches another whole unit and gets pushed.

The total quantity sent to Shopify across all picks of one material always equals the total fractional need, rounded. Local-vs-Shopify never drifts further than one whole unit.

## Compensation on cancel and reverse

Cancelling or reversing a build run reverses the Shopify push:

- **Cancel** (on a `picking` run) — increments back the materials the pick decremented.
- **Reverse** (on a `built` run) — same, plus the completion-time push gets reversed too.

These compensating mutations run automatically as part of the cancel and reverse actions. Status columns on the build run record whether each compensation succeeded so a retry can pick up where things left off.

A reversal takes the finished goods back off in Shopify **before** it returns any components. If Shopify refuses that, or does not confirm it, the reversal is refused: the run stays `built`, its components stay consumed, and you can reverse again once the cause is fixed. A run whose finished-good update Shopify has not yet confirmed cannot be cancelled or reversed until it is confirmed (see the banners below).

If the original pick was skipped — a **Material List Only** work order, a plan with only virtual materials, or Shopify simply not reachable — there is nothing to compensate, and the compensation does nothing.

## Completion-time output sync

When a build run completes — or, for a run sent to QC, when a review approves its output — Assemblified forwards the produced output to Shopify through the same <Term def="dynamic-adjustment">dynamic adjustment</Term> path that order-driven BOM execution uses. This:

- Pushes the produced quantity onto the bill's finished-good variant, when that bill has dynamic adjustment turned on.
- Updates any bill set to <Term def="only-sell-preassembled">only sell pre-assembled</Term> so it matches the new pre-assembled stock.
- Cascades to any parent bill that depends on the completed assembly BOM.

The completion sync runs independently of the pick-time push. It uses its own status column and can be retried independently if it fails.

## The retry banner

If any sync (pick, compensation, or completion) fails, the work order detail page shows one banner headed **Shopify did not accept an inventory movement**, with a **Retry sync** button. Press it and Assemblified replays whichever pushes failed, in the right order:

- A previously-succeeded push is skipped.
- A previously-failed push is replayed.
- A push that's never been attempted (because the prior one failed first) runs for the first time.

The retry is idempotent — replaying a successful push does nothing.

If the retry also fails, the banner stays with Shopify's own words underneath — that text is the only specific thing there is to go on, so it is shown rather than paraphrased. Reload the app and try once more; if it keeps failing, contact support.

A second, related banner reads **Shopify may hold a movement this work order never recorded**. That one means Assemblified could not tell whether Shopify applied a push at all. For a finished-good update, Assemblified keeps trying to learn Shopify's answer and settles it on its own when it does. Otherwise nothing can settle it from this side, so the banner asks you to check the inventory movements in Shopify — and once you have, its button is **Mark as confirmed**. **Retry sync** never sends such a push again, because it may already have landed.

The same **Retry Shopify sync** action is on each build run's own **⋯** menu on the Build runs table, for when you want to replay one run rather than the whole work order.

<Aside type="note">
**Local state is never rolled back on a Shopify failure.** If the pick succeeded locally but the Shopify push failed, Assemblified keeps the local commit and surfaces the banner. Rolling back local state would create a worse problem (the operator already pulled the material off the shelf, and the UI would suddenly say it's still available). The banner-and-retry pattern is the deliberate choice.
</Aside>

## Publish due dates and progress

Under **Settings → Catalogues → Metafields → Publish to Shopify**, connect a work-order field to a product or variant metafield. Choose Earliest or Latest for due dates, or Sum or Highest for quantities, then preview and save. Other selection choices are available in the editor.

Saving covers future changes. Use **Backfill existing data** to include existing work orders and all linked finished goods, including those with no matching work. Empty results delete a date, write zero for a quantity or false for a matching flag. Fractional quantities are preserved. These values describe work-order progress, rather than promised inventory.

This needs **Enhanced** and is separate from the linked-order completion metadata below. Disabling or disconnecting leaves existing Shopify values in place. For the full steps, field meanings and recovery controls, see [Publish work-order fields to Shopify](/features/work-orders/metafield-publication/).

## The completion overlay (per-order metafield)

When a work order is created from one or more Shopify orders, completing it triggers a side-effect called the **completion overlay**. For each linked order, Assemblified writes a `material_requirements_json` metafield onto the order with:

- The materials the BOM(s) for the order's variants required.
- Any per-work-order operator notes (lot numbers, specifications, and the build metafields recorded on the **Documents & Build Metafields** tab).

This is metadata for downstream fulfillment workflows — pickers and shippers can read the metafield to see what materials went into the order. It is controlled by **Write material requirements into order metafields**, under **Settings → Connections → Integrations**. If you don't link a work order to any Shopify orders, the overlay does nothing.

The overlay is fire-and-forget — its errors are logged but don't affect the work order's status. If you need to retry it, the only path is to uncomplete and re-complete the work order.

## The work-order materials metafield

The completion overlay above writes what the order's **bills of materials** require. When you decide the contents on the work order itself (a gift hamper filled to a budget, or materials you add by hand), switch on **Write work order materials into order metafields** under **Settings → Connections → Integrations**. Completing a work order linked to one Shopify order then writes a second order metafield, `assemblified` / `work_order_materials_json`, with what the work order **actually used**:

- every completed work order of that order (two hampers in one order give two entries), with what it built and its materials;
- for each material: product, variant, SKU, title and the quantity its build runs consumed (the planned quantity for a work order that consumed nothing, such as a material list);
- `totalMaterials`, the same materials added up across those work orders, in the same format as `material_requirements_json`.

It is rewritten whenever one of the order's work orders is completed, reopened, has a build run reversed or is linked to a different order, so it always lists the work orders completed at that moment. If Shopify refuses a write, Assemblified retries it automatically. A work order linked to several orders is not listed, because its materials can't be split between them. The switch is off by default and does not change `material_requirements_json`. Switching it off stops new writes but does not remove the metafields already written: each order keeps the list from its last write. See [Shopify extensions](/integrations/shopify-extensions/#work-order-materials-metafield) for the JSON shape.

## Tagging linked orders

The **Tag orders** entry in the work order's **More actions** menu applies (or removes) Shopify tags on every order linked to the work order. Operators commonly use it to mark orders as "ready to ship" or "in production" once the work order's status changes.

The dialog shows the current tags on each linked order side-by-side, so you can see the existing state before applying changes. The mutation is the standard Shopify `tagsAdd` / `tagsRemove` — no per-order metadata is written here, just tags.

Tagging is allowed on cancelled and completed work orders too — the tags are meta-information that doesn't affect the work-order state.

## Order production confirmations

Recording built units for a reserved order ([Order production](/features/work-orders/order-production/)) talks to Shopify through its own confirmation, not through the build-run pushes above:

- The order's held components are taken out of stock in Shopify.
- The built units are added to the finished good at the production location and stay with the order. For a finished good whose quantity follows its components, the next recalculation settles it instead.

Each step is shown in the confirmation dialog with its state (*Applied in Shopify*, *Refused by Shopify*, *Unknown in Shopify* and so on). A confirmation whose steps have not all completed has its own **Retry** in that dialog, which re-sends only the unfinished steps with the same quantities. The work order it created is read-only: its page can still warn about a step, but offers no **Retry sync** or **Mark as confirmed** there. A step whose outcome in Shopify is unknown is never sent again; check the stock in Shopify and use [inventory reconciliation](/guides/reconcile-inventory/) for a difference.

## What gets skipped, when

A work order inherits its **assemble type** from the [assembly flow](/features/work-orders/assemble-flows/) it was created from, when it came from one. What each type pushes:

| Assemble type | Pick push | Compensation | Completion push | Completion overlay |
|---|---|---|---|---|
| **Pre-Assemble (Physical)** — the default | Yes | Yes | Yes | Yes |
| **Bundle/Kit Assemble (Virtual)** | Yes (materials only) | Yes | No — there is no output to push | Yes |
| **Material List Only** | No | No | No | No |

For a **Material List Only** work order, Assemblified records everything on its own side but doesn't touch Shopify inventory at all. Use it for "shopping list" work orders where you're tracking what was pulled but not actually changing inventory levels.

## Related

- [Build runs](/features/work-orders/build-runs/) — when each push fires and what triggers a retry.
- [Material planning & costs](/features/work-orders/material-planning/#per-item-material-cost-shopify-cost-push) — the per-item cost push (a separate action from inventory sync).
- [Work-order flows guide](/guides/work-order-flows/) — the three modes walked through with sync touchpoints highlighted.
- [Glossary](/reference/glossary/).

<DocUpdated date="2026-11-19" />