Skip to content

Shopify-linked materials

A Shopify-linked raw material is a real Shopify variant — a SKU that exists in your Shopify catalog and has its own inventory. Inventory adjustments at execution time go through the Shopify Admin API; multi-location works out of the box because Shopify already manages it.

This is the default kind of raw material — what you’ll create most often.

  • Linking a Shopify variant
  • How inventory deltas propagate
  • Multi-location behavior
  • The adjustment history audit trail
  • Common scenarios
  1. Go to Raw Materials → All (or Shopify tab).
  2. Click “Add raw material” → opens a Shopify resource picker.
  3. Pick a variant. Assemblified copies the Shopify product ID, variant ID, inventoryItem ID, name, SKU, and (snapshot) cost.
  4. The raw-material row is created with isVirtual=0 (Shopify-linked) and isRawMaterial=1.
  5. Optionally edit cost, vendor, specifications, and the material tag for organization.

The raw material is now ready to use as a component in any BOM or sub-assembly.

When a BOM containing a Shopify-linked raw material executes, Assemblified writes a delta through the Shopify Admin API:

  • Order create: negative delta. available -= consumed_quantity.
  • Order cancel/refund: positive delta (when the cascade restores raws). available += restored_quantity.

Multiple raw materials in the same order are batched into a single API call when possible.

If the API call fails (rate limit, network, invalid location), the failure is logged in the execution log’s inventorySyncErrors field. Assemblified does not roll back its own internal state — pre-assembled drawdown and other internal updates are committed before the Shopify call. Recovery is via Synchronize with Raw Materials on affected BOMs.

Shopify-linked materials use Shopify’s location model directly:

  • Each raw material has stock at every Shopify location (zero by default if the material wasn’t activated at that location).
  • The reference row on a BOM/SA can specify a location. If set, that material is always pulled from that location.
  • Otherwise, Assemblified resolves the location from the order’s fulfillment location (with the shop-level Location-sensitive dynamic adjustments setting on) or falls back to the shop default.

See Inventory tracking → Multi-location for the priority rules.

When you manually adjust a raw material’s stock in the Shopify admin (or another integration does), Shopify fires the INVENTORY_ITEMS_UPDATE webhook. Assemblified:

  1. Updates its cached inventoryQuantity field.
  2. Triggers a dynamic adjustment cascade for every BOM that uses this material. The BOMs’ displayed Shopify quantities are recomputed.

This keeps Assemblified in sync with external changes. Tested in spec 17-external-inventory-change-recompute.

Every inventory delta — from BOM execution, work-order pick/complete, manual adjust, or external change — writes a row to the per-material adjustment-history audit trail. Operators access it from the raw-material detail page.

It’s most useful when debugging “where did my inventory go?” — the history shows which orders or actions caused each delta.

A material that’s also sold standalone. No special handling needed. The material has its own Shopify product page (operators can sell it directly), and the BOM-as-component path decrements the same inventory. Customers buying standalone and customers buying a BOM compete for the same stock — that’s by design.

A material at multiple Shopify locations. Set the location on the BOM’s component reference if you always want this material from one location. Otherwise, leave it blank and let location-sensitive dynamic adjustment route it based on the order’s fulfillment location.

Negative inventory. Shopify allows negatives if the location is configured to. Assemblified passes the delta through; if it goes negative, that’s Shopify’s behavior. Lock it down at the Shopify location level if you don’t want negatives.