Every test order on a client's merch platform stopped at the same place. The order came in from a Shopify store, our system created a draft at Printful, the print-on-demand service that makes and ships the merch, and then nothing.
The problem
The next step is to confirm the draft. A confirm makes Printful charge for the order and start printing. There is no free version of that call, so local and staging never made it.
That left a hole in the middle of the flow. Everything after the confirm was untested: production, shipping, tracking, the order turning to Fulfilled in the store. It was the half of the flow where a mistake costs real money and lands at a real fan's door.
If one step of a flow can never run in a test environment, every step behind it is untested too, however good the tests before it are.
Why not a full mock
A mock of the whole API was my first idea, and I dropped it fast. A mock drifts away from the real thing. Costs, product variants and the rules for a draft are exactly the parts where I want the real answers, and the sandbox gives them for free.
Only one call was the problem. So only one call should be fake.
The idea: a proxy that fakes only the paid part
The twin is a proxy that pretends to be the Printful API. Our services call it in place of the real address. Every call goes straight through to the real sandbox, with one exception: the confirm. For that one the twin answers itself and keeps its own shadow copy of the order.
flowchart LR
A[Our services] --> T["Printful twin<br/>(a proxy)"]
T -->|"everything else"| P["Real Printful<br/>sandbox"]
T -->|"confirm"| S["Twin answers itself"]
S --> D["in production,<br/>shipped, delivered"]
From there the twin plays the rest of the order's life. A small page has a button for each step: start production, ship, delivered. The real order stays a free draft the whole time.
One rule is not negotiable: a confirm must never reach the real API. Anything that looks like a confirm and is not played by the twin is refused, not passed on.
What it gave us
With the hole closed I could write one test that takes an order all the way, from the storefront to Fulfilled with a tracking number. The first full run found three bugs:
The confirm job stopped after its first order. Nobody had ever confirmed two in a row.
The store said Fulfilled. Our own order tables still said pending.
My fix for the second bug worked in my manual check and failed in the real order of events.
None of them could show up before, because no test order had ever passed the confirm. They sat in the part of the flow we would have met for the first time in production.
Give a stand-in like this a name and a look that say what it is. The twin's page has "NOT THE REAL PRINTFUL" in its header for a reason.
The twin itself took a day and about 500 lines. Most of that day went into the bugs it uncovered, not into the twin. Next time I would build it before the feature, not after: I wrote the shipping part first and could only check it by hand, and all three bugs sat right behind that shortcut.

Related notes
A swim tech coaching course I finished on a plane
I took the SwimTech Coach (STC) Certification on Udemy during a flight. It promises data-driven swim coaching with wearables. It stays very basic and repeats itself, and I learned nothing new.
A vision model scored my swim videos, and it liked almost everything
I ran the vision step of my reels-finder skill on 21 hours of action camera video. The scene descriptions were good. The 1 to 5 reel score was not, so I filter by tags and setting instead.



