Case study
Special Orders
Customer special orders at The Juilliard Store, from request to pickup
When a customer asks for something the store doesn't stock, that request now runs through Special Orders. The app handles every step (capture, ordering, arrival, reservation, notification, invoicing, pickup) across the store's admin, its point-of-sale registers, and its email.
At a glance
- Role
- Designed solo and built with Claude Code, growing out of a tool I made for my own counter and receiving work
- Scale
- About 475 special orders a year, around 225 open at any moment
- Reach
- The store's admin, its point-of-sale registers, and customer email
- Stack
- Next.js and TypeScript on the Shopify Admin API, with a Shopify POS extension. No database of its own
- Size
- Roughly 28,000 lines of TypeScript in the app the store runs, plus a 66,000-line rebuild I chose not to ship
The problem
Special orders lived in a ledger nobody watched, so they fell through quietly.
Special orders lived in Shopify draft orders, used as a raw ledger that recorded each order and did nothing else with it. Nobody could see:
- Which orders were ready to invoice, which reservations were about to lapse, or which prepaid orders were overdue.
- Which customers needed to hear their item had arrived. That was a step someone had to remember.
- Anything at the registers. The sales floor had no view into any of it.
You can see it in the store's own records:
- 6tracked special orders in 2023
- 47in 2024
- ~475a year, once tracking was consistent
That jump comes from consistent tracking far more than from any real growth in orders.
How it grew
It started as an order sheet I printed for myself, and grew one staff request at a time.
At the counter
I took special orders and later received the merchandise that filled them, so I knew first-hand where the old workflow hurt.
The first version
The old system had no easy way to print an order sheet for incoming items, so I built one to save myself the clicks.
One request at a time
Staff saw it and told me what they needed next, and the app grew into the system that now manages the whole workflow.
Today
Inside, it's still titled Draft Order Printer. I keep it that way as a reminder of where it started.
What I built
A workflow layer on top of Shopify, with no database of its own, so there was nothing to drift out of sync.
Stack
- Next.js
- TypeScript
- Shopify Admin API
- Shopify POS extension
The app keeps its workflow state on Shopify's own draft orders, using tags and metafields (reserved until, notified, reshelved, fulfills order). So even a staff member who never opens my app sees the real status in Shopify itself.
On top of that ledger:
- Action queues. Open orders sort themselves into queues: ready to invoice, lapsing soon, lapsed, prepay overdue, and out-of-stock items that are back in. The ways the old workflow used to fail became the tabs of the new one.
- Reservations with lapse logic. Arrived items are held for a set window, customers get a templated email, and lapsed holds show up for reshelving instead of sitting on the shelf.
- Archiving on a schedule. Completed orders and lapsed holds that sit untouched for months archive themselves, so the open list stays the real list.
- At the register. A Shopify POS extension puts special orders on the sales floor. Staff can take a prepayment or collect at pickup without leaving the register, and an order only counts as paid once Shopify confirms the payment.
- A slip the register can read. The printed order slip carries a barcode the register scans to open the order, and counter instructions that name the buttons to press.
- Consistent entry. A guided new-order wizard, printed invoices, pickup notifications, and a metrics dashboard, so every order looks the same no matter who took it.
Building the replacement, then keeping the original
I built a Postgres version and rehearsed the move. Then I kept the original, so customer data stays in Shopify.
What broke down
Status was worked out on every page load from some twenty Shopify facts, in five places that could disagree. Shopify has no transactions and no audit trail, and it deletes draft orders after a year of inactivity, so our own records could disappear on their own.
The rebuild
A Postgres version with one source of truth for each order's state, an audit trail that can't be edited, and its own scheduled jobs, built in phases under one rule I set: never store a fact both systems could claim. A dry run read 743 orders without writing anything.
The decision
Moving meant copying customer names and email addresses out of Shopify into a second database the store would have to protect. I chose to keep that data in one place. The original app stays, and the rebuild is kept as a record in case the question comes back.
How I made sure it was right
Three times during the rehearsal, every test passed and something was still broken in production. That changed how I check a release.
Claude Code writes and runs the automated tests. I define what correct looks like, and I check it myself before it reaches staff.
- 130+test files run on every change
- 743orders read by the migration dry run
- 224live orders rehearsed, and left where they were
- Tests against a real database. The rebuild's tests run against an actual Postgres database in memory, so the queries are tested as well as the logic. The app and its register extension are both type checked on every pull request.
- A development store for the Shopify side. A seed script creates 11 real special orders in a separate Shopify store, and refuses to run if the store doesn't look like a test one.
- Dry runs before any move. The importer reports what it would do without writing anything, including what needs a person first: staff names it can't match, prepaid orders the new database would refuse, and holds that have already lapsed.
- A way back from every step. The plan kept every order in Shopify, so each stage of the switch could be undone. Only what reaches customers couldn't be: the emails, invoices, and completed orders sent after a switch.
What went wrong, and what I do now:
Green tests, broken production
Each time, the tests supplied something production didn't: a database setup step the tests never ran, a browser cookie they handed over directly, and a Shopify key the test helpers set for themselves.
The rule it left me
Before anything moves, the first step is creating one real special order in production through the new app and watching it land at every stage.
Data security
The safest copy of a customer's details is the one that doesn't exist.
- Customer data stays in Shopify. The app has no database. Each order's workflow lives on the Shopify draft order itself, as tags and fields, so names, emails and phone numbers are never copied anywhere else.
- Two ways in, both through Shopify. In the admin, staff sign in with their Shopify account, checked for this store, its signature and a one-time code, and get a signed cookie that lasts a day. At the register, every request carries a short-lived token from Shopify that the server checks for signature, expiry, app and store. The shared register password it replaced is gone.
- Emails only to the right people. Invoices are sent by Shopify, only to an address already on the order, with copies only to an approved list.
- Payments confirmed by Shopify. A card payment counts only once Shopify reports it paid, and the server refuses to hand over an unpaid order.
- Requests that prove where they came from. Shopify's updates are checked against their signature, the scheduled archive job carries its own secret, and changes from another website are refused. The key that can change orders never leaves the server, and test builds get no keys at all.
What changed
Orders that used to wait on someone's memory now sort themselves into queues.
- ~475special orders a year
- ~9a week, paced by the academic calendar
- ~225open at any moment
Every order is tracked from arrival through notification to pickup, and the sales floor answers "is my order in?" without a trip to the back office.
Built with Claude Code: roughly 28,000 lines of TypeScript in the app the store runs, and another 66,000 in a rebuild I chose not to ship. Claude Code wrote the code and the tests. The architecture, every design decision, and the rules the tests check are mine.
Screens show Special Orders running on demo data.