# Shopify admin extensions

Two material-requirements metafields, seven native admin surfaces (order-detail blocks, packing-slip print actions, product-list actions), and the switches that turn them on.

import { Aside, Steps, Card, CardGrid, LinkCard } from "@astrojs/starlight/components";
import Term from "~/components/Term.astro";
import DocUpdated from "~/components/DocUpdated.astro";

Assemblified plugs into the Shopify admin in two ways: it **writes data** into Shopify metafields, and it **renders UI** directly inside the admin via extensions. Your team rarely has to leave Shopify to act on BOM data, and other tools that read from Shopify (storefronts, third-party apps) can pick up Assemblified's component breakdown straight from the variant.

## On this page

- Metafields written to Shopify
- Order-detail blocks
- Packing-slip print actions
- Product-list admin actions
- Install and enable

## Metafields written to Shopify

Assemblified writes a `material_requirements_json` metafield in two places — on **Orders** and on **Product Variants** — under the same `assemblified` namespace. Each has its own switch on **Settings → Integrations**, in the sections **Shopify order metafields** and **Shopify product-variant metafields**, and both are **off by default**, so nothing is written to Shopify until you opt in. A third, order-only metafield, `work_order_materials_json`, lists what an order's completed work orders actually used; it has its own switch in the order section and is off by default too.

<Aside type="note">
    The order-detail blocks below read the **order** metafield. Anything that reads the **product variant** metafield (storefront badges,
    third-party catalog tools, your own reports) is outside Assemblified — the metafield is just a public surface other systems can hook
    into.
</Aside>

### Order metafield

Written on every Shopify order Assemblified touches. Kept up to date through the order's lifecycle — creates, cancels, refunds, and edits all rewrite it.

|                     |                                                                                                           |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| **Namespace / Key** | `assemblified` / `material_requirements_json`                                                             |
| **Owner**           | Order                                                                                                     |
| **Setting**         | _Write material requirements into order metafields_                                                       |
| **Cost option**     | _Hide cost and price in order metafields_ — zeros out costs while keeping quantities and structure intact |
| **Read by**         | The two [order-detail blocks](#order-detail-blocks) below                                                 |
| **Shape**           | JSON array of BOMs with quantities and their resolved material requirements                               |

<Aside type="tip" title="Prefer pulling over reading metafields?">
    The [REST API's order BOM breakdown endpoints](/features/rest-api/reference/#order-bom-breakdown-read-only) return the **same shape** on
    demand for 1–50 orders per call — without enabling this metafield writeback, and always computed from the order's current line items.
    Ideal for warehouse and 3PL integrations.
</Aside>

### Work-order materials metafield

Written on a Shopify order when a work order linked to that order (and to no other) is completed, reopened, has a build run reversed or is linked to a different order; a write Shopify refuses is retried automatically. It lists what the order's **completed work orders actually used**, so it suits orders whose contents are chosen on the work order rather than fixed by a bill (gift hampers, made-to-order kits). Nothing else rewrites it: order edits, cancels and refunds leave it alone.

|                     |                                                                                                                         |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **Namespace / Key** | `assemblified` / `work_order_materials_json`                                                                            |
| **Owner**           | Order                                                                                                                   |
| **Setting**         | _Write work order materials into order metafields_ (independent of the material requirements switch, off by default)   |
| **Cost option**     | _Hide cost and price in order metafields_ applies here too; the switch shows while either order metafield switch is on |
| **Read by**         | Your own systems. The order-detail blocks read `material_requirements_json`, not this metafield                        |
| **Shape**           | One object per order: `workOrders` (each with its `items` and `materials`) and `totalMaterials` across them             |

```jsonc
{
    "orderId": "13030",
    "orderName": "#13030",
    "generatedAt": "2026-10-29T10:00:00.000Z",
    "workOrders": [
        {
            "workOrderId": "…",
            "workOrderName": "Hamper #13030",
            "shortId": "WO-0042",
            "reductionType": "PRE_ASSEMBLY",
            "completedAt": "2026-10-29 09:58:12.000",
            // What the work order built
            "items": [
                { "itemType": "bom", "itemId": "…", "name": "Foodie Hamper", "productId": "…", "variantId": "…", "sku": "HAMPER-6999", "quantity": 1 }
            ],
            // What it used: the same entry as material_requirements_json's boms[].materials, plus three keys
            "materials": [
                {
                    "materialType": "raw_material", // or "sub_assembly" (productId and variantId are then null)
                    "materialId": "…",
                    "productId": "…",
                    "variantId": "…",
                    "sku": "JAM-340",
                    "title": "Strawberry jam - 340 g",
                    "productName": "Strawberry jam",
                    "variantName": "340 g",
                    "specifications": null,
                    "notes": null,
                    "quantity": 2, // consumed by the build runs; the planned quantity if nothing was consumed
                    "plannedQuantity": 2,
                    "consumedQuantity": 2
                }
            ]
        }
    ],
    // The same entry as material_requirements_json's totalMaterials, plus materialType and materialId
    "totalMaterials": [
        {
            "materialType": "raw_material",
            "materialId": "…",
            "variantId": "…",
            "productId": "…",
            "sku": "JAM-340",
            "title": "Strawberry jam - 340 g",
            "productName": "Strawberry jam",
            "variantName": "340 g",
            "specifications": null,
            "notes": null,
            "totalQuantity": 2,
            "imageUrl": "https://cdn.shopify.com/…",
            "isVirtual": false,
            "unitCost": 3.1 // the work orders' unit cost, weighted by quantity; 0 when costs are hidden
        }
    ]
}
```

A work order linked to several orders is never listed, because its materials can't be split between them. When the order's last completed work order is reopened, `workOrders` and `totalMaterials` become empty lists.

### Product variant metafield

Written on the Shopify product variant linked to a BOM (the BOM's finished good). Updated whenever a BOM is created or edited — but **only while the BOM's status is `active`**. If a BOM is set to inactive or deleted, Assemblified **clears** the variant's metafield so stale data doesn't linger on the product.

|                     |                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Namespace / Key** | `assemblified` / `material_requirements_json`                                                                                                     |
| **Owner**           | Product Variant                                                                                                                                   |
| **Setting**         | _Write material requirements into product variant metafields_                                                                                     |
| **Cost option**     | _Hide cost in product variant metafields_ — same behaviour as the order cost option                                                               |
| **Active-only**     | Yes — inactive or deleted BOMs have the variant metafield cleared automatically                                                                   |
| **Bulk action**     | A one-shot sync in the same settings section — writes across every BOM, including inactive ones (the only path that ignores the active-only gate) |
| **Read by**         | External systems (storefront blocks, third-party catalog tools, custom reports) that want a product's component breakdown straight from Shopify   |

Completing a work order refreshes the **order** metafield for every order that work order was created from, laying the work order's own recorded values over the ones derived from the bill — see [Material metafield tracking](/guides/material-metafield-tracking/#track-per-production-batch-values-in-work-orders).

<Aside type="tip" title="Developer note — JSON shape">

The two metafields share the namespace and key but **use different payload shapes** — a consumer must branch on owner type. Annotated examples below match the schema written today.

**Product variant metafield** — one top-level object describing the one BOM that owns the variant.

```jsonc
{
    "bomId": "BOM-1768434482737-20pcga4xq", // Assemblified internal BOM ID
    "bomName": "Example BOM",
    "generatedAt": "2026-01-15T19:22:22.511Z", // ISO 8601, UTC
    "materialRequirements": [
        {
            "productId": "15236237230403",
            "variantId": "54072478040387",
            "sku": "#sku-123", // empty string if no SKU
            "productName": "Shopify Product Title",
            "variantName": "Shopify Variant Title", // string | null
            "specifications": "6061 grade aluminum", // string | null
            "notes": "Cut to length", // string | null — BOM raw-material edge notes
            "unit": "pcs",
            "quantity": 3, // per 1 unit of the BOM's finished good
            "cost": 5.99, // unit cost — 0 when "Hide cost in product variant metafields" is on
            "imageUrl": "https://cdn.shopify.com/.../Main.jpg", // string | null
            "isEssential": true, // false = non-essential material
        },
    ],
}
```

When the BOM is set inactive or deleted, this metafield is **cleared to `{}`** — consumers should treat an empty object as "no active BOM on this variant".

**Order metafield** — wraps every BOM on the order plus a cross-BOM aggregation. The shape is order-centric, not BOM-centric.

```jsonc
{
    "orderId": "6234567890123",
    "orderName": "#1042",
    "generatedAt": "2026-01-15T19:22:22.511Z",
    "boms": [
        {
            "bomId": "BOM-1768434482737-20pcga4xq",
            "bomName": "Example BOM",
            "bomImageUrl": "https://...", // string | null
            "bomProductId": "15236237230403", // string | null
            "bomVariantId": "54072478040387", // string | null
            "bomSku": "FG-123", // string | null
            "orderQuantity": 2, // how many of this BOM the order is for
            "materials": [
                {
                    "productId": "15200000000001",
                    "variantId": "54000000000001",
                    "sku": "#sku-123", // empty string if no SKU
                    "title": "Aluminum bar — 6061", // pre-built display title
                    "productName": "Aluminum bar",
                    "variantName": "6061 grade", // string | null
                    "specifications": "6061 grade aluminum", // string | null
                    "notes": "Cut to length", // string | null
                    "quantity": 6, // already multiplied by orderQuantity
                },
            ],
        },
    ],
    "totalMaterials": [
        // de-duplicated aggregation across every BOM on the order
        {
            "variantId": "54000000000001",
            "productId": "15200000000001",
            "sku": "#sku-123",
            "title": "Aluminum bar — 6061",
            "productName": "Aluminum bar",
            "variantName": "6061 grade", // string | null
            "specifications": "6061 grade aluminum", // string | null
            "notes": "Cut to length", // string | null
            "totalQuantity": 6,
            "imageUrl": "https://...", // string | null
            "isVirtual": false,
            "unitCost": 5.99, // 0 when "Hide cost and price in order metafields" is on
        },
    ],
}
```

If no BOM on the order matches a variant, the order metafield is written as `{}`.

Key consumer-side differences to watch:

- **Top level**: variant payload has `bomId` / `materialRequirements`; order payload has `boms[]` / `totalMaterials[]`.
- **Per-material fields differ**: the order's `boms[].materials[]` items have `title` and `quantity` but **no** `unit`, `cost`, `imageUrl`, or `isEssential` — those live on `totalMaterials[]` instead (as `unitCost` / `imageUrl` / `isVirtual`, no `isEssential`).
- **Naming differs**: the variant uses `cost`; the order's totalMaterials uses `unitCost`. The variant uses `quantity` per unit of finished good; the order's `boms[].materials[].quantity` is already multiplied by `orderQuantity`.
- Cost-hiding behaviour is enforced field-by-field: the field is always present, but set to `0` when the matching "Hide cost…" toggle is on, so consumers don't need to branch on shape.

</Aside>

## Order-detail blocks

Three blocks can sit on the Shopify admin **Order detail** page. The first two read the order metafield through Assemblified and render on any order that has it set. If the information cannot be loaded (Assemblified cannot be reached, your session has expired, or the order cannot be read), the block says so and offers **Try again**. The BOM links block shows _No data found or feature disabled_ when the order has no material requirements saved.

The Material requirements block also works on orders without the metafield, or whose metafield was saved empty because no bill of materials matched when the order came in: orders placed before _Write material requirements into order metafields_ was switched on, and open orders when Assemblified runs BOMs only at fulfilment. Assemblified then calculates the materials from the order's current items and today's bills of materials, and the block says _Calculated from the current bills of materials; not saved on this order_. It shows _No materials for this order's current items_ when nothing on the order needs materials.

<CardGrid>
    <Card title="BOM links">
        A list of every BOM the order requires, with thumbnails, names, quantities, and a deep-link into the corresponding BOM inside
        Assemblified.
    </Card>
    <Card title="Material requirements">
        A breakdown of the same metafield at the *material* level — the materials and virtual materials needed to fulfil the order, summed
        across all BOMs on the order.
    </Card>
</CardGrid>

**Choose what the Material requirements block shows** under **Settings → Integrations → Shopify order metafields**, while
_Write material requirements into order metafields_ is on. Tick any of image, product name, variant name, SKU, quantity, unit cost,
line cost and total, notes, specifications and the "Generated at" time; the columns keep their order. At least one of image, product
name, variant name or SKU stays on, so every row says which material it is. The choice applies to every order and every staff
member of the shop. It only changes what the block displays: the metafield keeps every field. To keep costs out of the metafield
itself, use _Hide cost and price in order metafields_. Quantities display with up to four decimal places and no trailing zeroes, so `25.299999999999997` appears as `25.3`. This only changes the display; saved quantities and cost calculations keep their precision.

{/* TODO(screenshot): src/assets/screenshots/integrations/shopify-01-order-bom-links-block.png — Shopify order detail with the Order BOM Links block in the right sidebar showing 2–3 BOMs with thumbnails. */}

{/* TODO(screenshot): src/assets/screenshots/integrations/shopify-02-order-material-requirements-block.png — same order, the Material Requirements block expanded showing the per-material breakdown. */}

**Why they're useful**: a fulfillment staffer reviewing an order can see exactly what to build and what components it needs without logging into Assemblified. The deep-link on each BOM gets them into Assemblified one click away if they need the full BOM context.

<Aside type="note">
    Order-detail blocks need a one-time setup step — see [Install and enable](#install-and-enable) below. The other four extensions surface
    automatically.
</Aside>

### Assemblified order workbench

A separate block for building what one order is waiting for. Its **Order production** section shows how many finished units are held for the order, how many its reserved components can still become, what was already recorded as built, which lines can go into a normal work-order draft, and what blocks the rest. Its **Record production** and **Create work order** buttons open the app on that order; the block itself changes nothing. It needs the **Enhanced** plan: below it, a pinned block shows only an upgrade note and loads no order information. See [Order production](/features/work-orders/order-production/).

## Packing-slip print actions

Two entries, both under Shopify's **Print** menu:

- **BOM packing slip** — on the order detail page. One order, one slip.
- **BOM packing slips (bulk)** — on the **Orders** list, once you have selected orders. Many orders, one PDF.

Either one opens a preview first (_"Preparing packing slip"_, then _"Preview ready"_) and then hands the PDF to Shopify's own Print button. The slip includes the BOM and material breakdown alongside the normal line items.

{/* TODO(screenshot): src/assets/screenshots/integrations/shopify-03-print-action.png — Shopify order detail Print menu opened, showing the Assemblified packing-slip entry. */}

**Why they're useful**: regular Shopify packing slips list the finished goods only. The Assemblified slip adds the components, so the slip a picker pulls off the printer has everything they need — no separate Assemblified printout required.

What the slip shows, and how the bulk version behaves, is configured on **Settings → Shopify printing**: _Packing Slip Display Options_, the _Bulk print mode_, and a PDF footer of your own.

## Product-list admin actions

Two entries surface inside Shopify's **Products** list page action menus.

<span id="restock-inventory"></span>

### Adjust stock

A link that opens Assemblified's **stock adjustment tool** with every material in scope — the same grid you reach from **Materials → More actions → Adjust stock**. One click from "I'm looking at my product catalog" to "I'm entering what just arrived".

**Why it's useful**: warehouse managers spend most of their time in Shopify Products. This action removes the muscle-memory step of navigating to Assemblified separately.

### Dynamic BOM adjustment

An action in the Products list's menu that runs <Term def="dynamic-adjustment">dynamic adjustment</Term> for all eligible BOMs using the configured component inventory source. Selecting products does not limit the adjustment to those products. If your shop uses Assemblified's local inventory index, record incoming stock in Assemblified before recalculating. Otherwise, the recalculation reads Shopify-managed component stock directly from Shopify. This action does not import component stock into Assemblified's local index.

After confirmation, the result stays open until you choose **Done**. A request accepted for background processing has a different message from a completed adjustment. If no changes were needed or eligible, the action says so.

If an adjustment fails or its result cannot be confirmed, the message stays visible. Some changes may already have applied, so check inventory history before starting another adjustment. The action offers a retry only when it can confirm that processing did not begin.

{/* TODO(screenshot): src/assets/screenshots/integrations/shopify-04-products-restocked-action.png — Products list page with the Restocked admin action menu opened. */}

**Why it's useful**: after recording a shipment, you can recalculate the buildable quantities of dependent finished goods from the Shopify Products page.

## Install and enable

Most extensions surface automatically — the moment Assemblified is installed on the store, the two print actions and the two product-list actions appear in their respective menus. No configuration needed.

The **order-detail blocks** are the exception. Shopify treats them as app blocks that merchants opt into per layout, so there's a one-time setup step.

<Steps>

1. **Open the Shopify admin → Orders.** Pick any existing order.

2. **Click the "Customize layout" / "Add section" affordance.** The exact label depends on your Shopify admin version; in current admin it's an "Add section" button on the order detail page.

3. **Pick the Assemblified blocks.** "BOM links" and "Material requirements" appear in the picker. Add one or both.

   For order production, add **Assemblified order workbench**: on the order page, open the **⋯** (More actions) menu, choose **Add block**, pick it and pin it.

4. **Save the layout.** The blocks now show on every order detail page where the `material_requirements_json` metafield is set. Orders without the metafield (e.g. orders placed before you installed Assemblified, or orders that don't reference any BOM) render the block empty.

</Steps>

<Aside type="note">
    The layout setup is per store, not per order. Once you've added the blocks to the order layout, they show on every order without
    re-doing the setup.
</Aside>

## Where to next

<CardGrid>
    <LinkCard
        title="Work orders → Shopify sync"
        href="/features/work-orders/shopify-sync/"
        description="What a completing work order writes back to Shopify, and when."
    />
    <LinkCard
        title="Dynamic adjustment"
        href="/features/bill-of-materials/dynamic-adjustment/"
        description="What the Dynamic BOM Adjustment action actually triggers — how Assemblified recomputes the buildable quantity on a BOM's finished-good variant."
    />
    <LinkCard
        title="Reporting (PDFs)"
        href="/features/work-orders/reporting/"
        description="The PDF pipeline behind the packing-slip print action — including how to customise the template."
    />
</CardGrid>

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