Scripts that seed a Shopify development store with a complete, realistic-looking business: product catalog, customers, and three years of backdated order history — plus storefront content (pages, menus, policies, collections) so the shop passes as a real brand.
Built for formhuset.dataviking.tech: 48 abstract products (6 colors × 8 shapes × 3 sizes), ~1,200 customers, ~2,650 orders spanning 36 months with growth ramp, holiday seasonality, repeat buyers, discounts, refunds, and cancellations.
- Node 22+ (uses built-in
fetch, no dependencies) - A Shopify store with a custom app installed, using the OAuth client credentials grant
- Env vars:
SHOP(myshopify domain),CLIENT_ID,CLIENT_SECRET
| Script | Purpose |
|---|---|
generate.mjs |
Core generator: probe (introspect API input types), products, customers, orders [--months N] [--limit N], repair (re-issue failed refunds), all |
setup-store.mjs |
tags (tag products by color/shape), collections (create smart collections) |
enrich-content.mjs |
pages, policies, menus, descriptions, all — storefront content realism pass |
upload-images.mjs |
Match images/{color}-{shape}.png files to products and upload via staged uploads |
Typical order: products → customers → tags → collections → publish to the Online Store channel → orders → repair → all content.
SHOP=xxx.myshopify.com CLIENT_ID=... CLIENT_SECRET=... node generate.mjs all- Backdating: orders use
processedAt(Shopify analytics respect it);createdAtis not settable. - Determinism: order composition, customer choice, discounts, and refund/cancel fates derive from a seeded RNG keyed on
(month, index), so runs are resumable — progress checkpoints tostate.jsonand re-running skips completed work. - Refunds need a
parentIdpointing at the SALE transaction; therepairsubcommand backfills refunds that failed before that was in place. - Publishing: API-created products/collections are not visible on the Online Store until published to its publication (
publishablePublish). - Payments: manual/test gateways marked SUCCESS — you cannot simulate real Shopify Payments payouts.
- Customer emails are all
@example.comand every order/refund/cancel is created with notifications suppressed, so nothing ever emails a real inbox.
Theme customization (hero, sections, footer) was done separately via the themeFilesUpsert GraphQL mutation against the Horizon theme; those snapshots are intentionally not committed.