# Shopify exports for the live build

Use **two files**: Shopify Orders for demand history, plus Inventory → **All states** for current stock. They join on SKU. Shopify documents them as separate exports. The supplied files contain synthetic data in those documented English export formats, with optional columns included. They are not exports from a real store; optional columns and their order can vary by store and Shopify version.

## Export from your own store

1. In **Orders**, click **Export**, choose **Orders by date**, and select 90–365 complete days ending at your inventory snapshot date. Export orders as CSV, not transaction histories. Larger exports can arrive by email.
2. In **Products → Inventory → Export**, choose **All states**, your intended locations and **All variants**, then export the inventory CSV.
3. Import both downloaded files into the tool. Select the stock locations to include and enter the sales export period and inventory snapshot date. Keep a consistent store timezone.

Source: [Shopify order export documentation](https://help.shopify.com/en/manual/fulfillment/managing-orders/exporting-orders) and [Shopify inventory export documentation](https://help.shopify.com/en/manual/products/inventory/setup/inventory-csv), checked 15 September 2026.

## The supplied practice files

- `shopify_orders_export.csv`: 15 September 2025–14 September 2026, ten SKUs, individual order lines, some multi-item orders, and realistic quantities. Customer information is fictional. Continuation rows intentionally leave order-level fields blank. A quoted multiline note exercises real CSV parsing. Two extra orders are cancelled/voided and pending respectively; exclude them from velocity.
- `shopify_inventory_export.csv`: snapshot at the end of 14 September 2026, ten SKUs across Future Melbourne and Future Sydney. Select both locations for the stage example. The sample has no committed or unavailable stock, so available and on-hand quantities coincide.

The hero SKU `TEE-BLK-M` has 1,800 available units across both locations and exactly 30 eligible units a day in the last 90 days. Expected velocities are 30, 30 and 30; cover is 60 days at 1× and 20 days at 3×. Exclude the additional cancelled 7-unit and pending 9-unit hero orders. Across all SKUs, current available stock totals 10,070 units.

## Import contract for the coding assistant

Read columns by header name, allowing a UTF-8 BOM, surrounding spaces and extra columns. Never require a fixed column order. Support UTF-8, CRLF/LF, quoted commas, doubled quotes and quoted multiline values. Preserve SKUs and order IDs as text.

### Order history

| Field | Use |
| --- | --- |
| `Name`, `Id` | Associate rows with the same order |
| `Created at` | Order date in the store timezone |
| `Lineitem SKU` | Join to inventory SKU |
| `Lineitem name` | Display name when needed |
| `Lineitem quantity` | Gross ordered units |
| `Financial Status`, `Canceled at` | Determine eligibility |

Group metadata by order identifier before interpreting line items. Carry missing date/status/cancellation values only within that identified order. A line with neither an identifiable order nor valid context must be reported, not assigned to another order. Reject conflicting dates or statuses for the same order. Repeated SKU lines can be valid; do not collapse distinct lines just because their SKU and quantity match.

Normalize status case and spaces/underscores. Include `paid`, `partially_refunded` and `refunded` orders when not cancelled. Exclude cancelled, voided, pending, authorized and partially paid orders from this paid-demand demo; report exclusion counts. Show the label **gross ordered units before returns**. An order-level refund amount cannot identify which SKU or how many units were returned. Do not subtract money from unit counts or claim the result is net sales. COD/payment-specific workflows may need a different explicit inclusion rule.

Parse each timestamp and group it in the selected store timezone; do not accidentally group by UTC when a sale is near midnight. Ask for the export period and the inventory snapshot date. Do not treat the most recent order as proof of the snapshot date. Sum complete calendar windows through the snapshot date and divide by 7, 30 or 90. Missing dates inside a confirmed complete export period are zero-sales dates. A window outside that supplied period is incomplete: flag it instead of implying a full history.

Ignore customer names, email, addresses, phone, payment references and notes after parsing. Persist only data required for inventory planning. A local importer does not need to send customer data to any service.

### Current stock

| Field | Use |
| --- | --- |
| `SKU` | Match the sales SKU |
| `Title`, option values | Identify the product variant |
| `Location` | Select which locations contribute stock |
| `Available (not editable)` | Stock that can support new demand |
| `On hand (current)` | Physical stock, shown separately |
| `Committed (not editable)` | Already allocated stock |
| `Unavailable (not editable)` | Stock that cannot be sold |
| `Incoming (not editable)` | Unreceived stock without an ETA in this file |
| `On hand (new)` | Ignore; this is a Shopify inventory-update field |

These inventory-state meanings follow [Shopify’s inventory CSV documentation](https://help.shopify.com/en/manual/products/inventory/setup/inventory-csv). Optional option headings may use `Option1` or `Option 1`; do not make those fields import blockers.

Sum available quantities only across explicitly selected locations. Distinguish zero, negative stock, blank and `not stocked`. Zero is valid. Negative sellable stock should show a shortage and zero usable cover, while retaining the original value. Blank, untracked or not-stocked quantities are not known zero stock. Report duplicate SKU/location rows and SKUs reused for different variants instead of double-counting them.

Keep inventory SKUs with no orders visible at zero velocity when the export period is complete. Flag sales SKUs missing from inventory; their stock is unknown, not automatically zero. Dates and supplier information are not part of the inventory export, so request them separately.

Shopify incoming stock has no arrival date in this file. Display that number separately for reconciliation, but use dated PO line items for future receipts. Never add Shopify incoming and the same manually tracked PO together.

## Demo supplier and PO fixtures

These are editable **synthetic assumptions**, not fields obtained from Shopify. Use them only when loading the supplied demo. Real-store imports must ask the user to confirm supplier assignments and lead times rather than silently applying demo values.

| Supplier | SKUs | Production | Freight | Receiving | Safety | MOQ | Pack | Unit cost |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| Form Apparel Co. | TEE-BLK-M, TEE-BLK-L, TEE-WHT-M, SHORT-STN | 35 days | 7 days | 3 days | 14 days | 300 | 50 | AUD 12 |
| Northline Knitwear | HOOD-GRY, KNIT-ZIP | 45 days | 12 days | 3 days | 14 days | 200 | 20 | AUD 29 |
| Everyday Goods | CAP-WASH, TOTE-NAT, SOCK-3PK, BTL-750 | 20 days | 7 days | 3 days | 10 days | 100 | 25 | AUD 6 |

Default forward cover: 60 days. Fictional contacts: Alex Chen at `alex@form-apparel.example`, Jamie Park at `jamie@northline.example`, Sam Nguyen at `sam@everyday-goods.example`. Apparel and knitwear terms are 30% deposit / 70% before shipment; goods terms are 50% deposit / 50% on dispatch.

- **PO-2026-041:** Form Apparel, 1,200 TEE-BLK-M and 600 TEE-WHT-M at AUD 12 each. In production; deposit paid; ordered 2026-08-20; production ETA 2026-09-24; sea freight; departure 2026-09-25; warehouse ETA 2026-10-04. Actual arrival blank.
- **PO-2026-042:** Everyday Goods, 1,000 SOCK-3PK at AUD 6. In transit; deposit paid; ordered 2026-08-23; production ETA 2026-09-08; sea freight; departure 2026-09-11; warehouse ETA 2026-09-23. Actual arrival blank.
- **PO-2026-043:** Northline Knitwear, 400 HOOD-GRY at AUD 29. Draft; deposit unpaid; order date 2026-09-14; production ETA 2026-10-29; sea freight; departure 2026-10-30; warehouse ETA 2026-11-13. Actual arrival blank. Exclude this draft from receipts.

The first two POs explain all 2,800 incoming units in the sample inventory CSV; do not count them twice. For the hero, replenishment lead time is 45 days plus 14 days of safety. At 1×, its target is 30 × (45 + 14 + 60) = 3,570 units; subtract 1,800 available and 1,200 confirmed incoming, then round 570 up to a pack of 50: **600 recommended units**.

## Live setup

Put both CSVs, this guide and `prompts/` in a new empty build folder. Paste the four prompt slides in order. Use snapshot **2026-09-14**, history **2025-09-15 to 2026-09-14**, timezone **Australia/Melbourne**, and both locations. Once built, upload both files without editing their columns.

The earlier prototype in `inventory-os/` still uses the five-column `sample_inventory_data.csv`; these native-format files are inputs for the new tool built live from the prompts.
