Interactive demo · synthetic dataEvery record on this page is fabricated.
Order Export for Production Planning
Shopify has three plausible answers to “which warehouse”; this is how the export picks the one that ships.
The production code behind this demo is my own work — design, directing Claude Code from specs, the warehouse-attribution rule and the conservative stock verdict, requirements with the planning team, deployment and the handover to planners; it is developed further by Prada Dipa — LinkedIn profile, opens in a new tab and Luthfi Aditya — LinkedIn profile, opens in a new tab.
1 Which warehouse?
One fabricated order. One line of six units. Change what Shopify returns and watch the ladder pick a different rung — and the row split.
- Fulfillment.locationUSED
where units were actually shipped from
- FulfillmentOrder.assignedLocationUSED
where unfulfilled units are meant to ship from — live name preferred over the snapshot
- Unknown
the line still appears in the export, flagged, rather than being dropped
MERIDIAN Lowfield Warehouse
4 units
MERIDIAN Northgate Studio
2 units
Two rows, not one averaged row. Four units in MERIDIAN Lowfield Warehouse and two in MERIDIAN Northgate Studio is not the same fact as six units somewhere.
The fulfillment order still carries MERIDIAN Northgate Atelier as its snapshot name. The live record says MERIDIAN Northgate Studio, and the live name wins — otherwise the export would keep naming a warehouse that no longer exists.
2 Can we fill it from stock?
Three fabricated stock sheets, each kept in a different naming system, none of them Shopify’s. Normalisation is what makes them agree — and when it cannot, the answer is Review, never a guess.
THE ORDER KEY
- Meridian Wrap Dress→ meridian wrap dress
- Harbour Sand→ harbour sand
- S/M→ s/m
STOCK ROWS FOR THIS STYLE AND COLOUR
- Stock Sheet — Lowfield12
- Stock Sheet — Lowfield3
- Stock Sheet — Northgate4
- Stock Sheet — Northgate2
YES
Exact style, color, and size match.
Stock Sheet — Lowfield (12), Stock Sheet — Northgate (4)
3 Whose day is it?
The planners are in Bali. The store’s admin timezone is US Eastern. A bare date means two different sets of orders, so the range is converted to explicit UTC instants before the query is built.
Asia/Makassarwhat the planner meant
2026-07-01T16:00:00Z → 2026-07-02T15:59:59Z
America/New_Yorkwhere the store's admin day would have drawn it
2026-07-02T04:00:00Z → 2026-07-03T03:59:59Z
The pale strip on both bars is the stretch of time both days contain. Everything outside it belongs to one day and not the other.
The two windows are 12 hours apart. Any order created in that gap lands in one export and not the other — and nobody could reconcile the totals afterwards. That is the whole reason a bare date is never sent.
created_at:>='2026-07-01T16:00:00Z' created_at:<='2026-07-02T15:59:59Z'
4 The rows a planner downloads
Six fabricated orders, fourteen line items, 16 rows — one per line item per warehouse. Two lines split, so they take two rows each.
| ORDER | CUSTOMER | PRODUCT | QTY | WAREHOUSE | SOURCE | STOCK |
|---|---|---|---|---|---|---|
| #MD-1041 | R. Anwar | Meridian Wrap Dress | 4 | MERIDIAN Lowfield Warehouse | Fulfillment.location | YESExact style, color, and size match. |
| #MD-1041 | R. Anwar | Meridian Wrap Dress | 2 | MERIDIAN Northgate Studio | assignedLocation | YESExact style, color, and size match. |
| #MD-1041 | R. Anwar | Gift Wrapping | 1 | MERIDIAN Lowfield Warehouse | Fulfillment.location | Not a stock-tracked garment. |
| #MD-1042 | S. Widjaja | Coastline Linen Shirt | 3 | MERIDIAN Riverside Store | assignedLocation | PARTIALPartial: 2 of 3 available. |
| #MD-1042 | S. Widjaja | Driftwood Wide Leg Trouser | 2 | MERIDIAN Lowfield Warehouse | Fulfillment.location | YESExact style, color, and size match. |
| #MD-1043 | T. Halim | Ember Kaftan | 1 | Unknown | Unknown | No matching stock (style, color, size). |
| #MD-1043 | T. Halim | Meridian Wrap Dress | 2 | MERIDIAN Northgate Atelier | assignedLocation | YESExact style, color, and size match. |
| #MD-1044 | V. Nurhadi | Coastline Linen Shirt | 1 | MERIDIAN Lowfield Warehouse | Fulfillment.location | REVIEWIncomplete order attributes (size); check manually. |
| #MD-1044 | V. Nurhadi | Driftwood Wide Leg Trouser | 3 | MERIDIAN Lowfield Warehouse | Fulfillment.location | YESExact style, color, and size match. |
| #MD-1044 | V. Nurhadi | Driftwood Wide Leg Trouser | 1 | MERIDIAN Riverside Store | Fulfillment.location | YESExact style, color, and size match. |
| #MD-1045 | W. Prabowo | Meridian Wrap Dress | 10 | MERIDIAN Northgate Studio | assignedLocation | PARTIALPartial: 5 of 10 available. |
| #MD-1045 | W. Prabowo | Ember Kaftan | 1 | MERIDIAN Northgate Studio | Fulfillment.location | YESExact style, color, and size match. |
| #MD-1045 | W. Prabowo | Coastline Linen Shirt | 2 | MERIDIAN Lowfield Warehouse | Fulfillment.location | No matching stock (style, color, size). |
| #MD-1046 | Y. Sutanto | Driftwood Wide Leg Trouser | 5 | MERIDIAN Riverside Store | assignedLocation | No matching stock (style, color, size). |
| #MD-1046 | Y. Sutanto | Meridian Wrap Dress | 1 | Unknown | Unknown | YESExact style, color, and size match. |
| #MD-1046 | Y. Sutanto | Ember Kaftan | 3 | MERIDIAN Lowfield Warehouse | Fulfillment.location | PARTIALPartial: 2 of 3 available. |
The real export carries thirty-odd columns, half of them shipping and billing address fields. Those are not modelled here — there is no version of this page where inventing eighteen columns of address data is the right call.
What is real, and what is simulated
Runs in your browser
- The warehouse preference ladder — Fulfillment.location, then FulfillmentOrder.assignedLocation preferring the live name over the snapshot, then Unknown. Inventory levels are never consulted
- The fan-out that turns one split line into one row per location, and the merge and sort that order them
- The garment SKU parser, the normaliser, and the fallback that decides where colour and size come from
- The stock index over positive balances only, and the four verdicts — Yes with contributing locations sorted by balance, Partial with N of M, No, Review
- The Asia/Makassar to explicit-UTC day-bound conversion, and the created_at fragment it produces
Ported from warehouse.py (154 lines), matcher.py (69), parsing.py (61), timezone.py (79) and the pure transform inside orders.py. The Python needs a Shopify request context and three Google Sheets to run, so there is no golden digest to diff against — instead every rule those modules state in prose is a test. 64 of them.
Simulated
- Shopify's Admin GraphQL API, the two-pass cost-aware pagination around its 1000-point per-query cap, the retry and throttle handling, and the client-credentials token that refreshes every 24 hours
- Google Sheets and the service account that reads the three stock sheets. The “sheets unreachable” switch below is an injected fault, not a real failure — but the degradation it triggers is the real code path
- The auth chain in front of the app: IAP on Cloud Run, oauth2-proxy behind Caddy on the VM, both against a Workspace domain allow-list
- Excel, CSV and Google Sheets output. The preview below is the row shape, not a file
- The export's shipping and billing address columns, which are deliberately not modelled here
- Every order, customer, product, SKU, barcode, location and stock row — all fabricated for this page