dtc-cash-onboarding
Every brand sends different files. This tool maps a brand's Shopify, Amazon, Faire, bank, card and chart-of-accounts exports into one cash ledger, and accepts the result only when independent records of the same money agree. What it cannot prove, it sends to a person instead of guessing.
Built by Avinash Rayudu. 13 synthetic brands: 7 to train, 3 to develop against, 3 written after the code was frozen.
How it works
The model never decides alone. A deposit that equals a Shopify payout to the cent within three days is labeled by proof. The model (2606 training lines, logistic regression on character and word n-grams) only labels what is left, and only above a threshold chosen for 99% precision on brands it did not train on.
Results, first pass before any review
| brands | upload | lines | auto-labeled | precision | wrong | to review | files auto | review items per brand | accepted after review |
|---|---|---|---|---|---|---|---|---|---|
| Development brands (never trained on) | upload_1 | 630 | 97.1% | 100.0% | 0 | 18 | 22/22 | 7.0 | 3/3 |
| Development brands (never trained on) | upload_2 | 557 | 99.3% | 100.0% | 0 | 4 | 22/22 | 1.3 | 3/3 |
| Holdout brands (after fixes) | upload_1 | 618 | 95.2% | 99.7% | 2 | 30 | 22/22 | 15.7 | 3/3 |
| Holdout brands (after fixes) | upload_2 | 578 | 97.9% | 99.8% | 1 | 12 | 22/22 | 4.3 | 3/3 |
| Training brands (in-sample) | upload_1 | 1367 | 100.0% | 100.0% | 0 | 0 | 53/53 | 0.0 | 7/7 |
| Training brands (in-sample) | upload_2 | 1239 | 100.0% | 100.0% | 0 | 0 | 53/53 | 0.0 | 7/7 |
Training brands are in-sample, shown only for completeness. Precision is measured on lines the pipeline labeled itself; lines it sent to review are counted as not labeled.
What the holdout found
The holdout brands were written after the code and model were frozen (hashes in
evals/FREEZE.json). Their blind results are kept unchanged in evals/results/holdout_v1_frozen/.
They exposed four real problems:
- A hole in the gate. Two brands ended accepted although their bank data never tied out: every bank check was "not applicable", and the gate read that as a pass. Now an upload with no readable bank rows, or a file whose mapping drops rows, is blocked.
- Dates written 01-07-2026 (day-month-year with dashes) did not parse, so a correct mapping still read no rows.
- Unsigned amounts with a separate DR/CR column. The file had no negative numbers, so it was taken for a card statement and accepted under the wrong type.
- Shopify payouts exported one row per transaction. The gate correctly refused this brand; the pipeline now rolls transactions up to payouts. Its PayPal deposits, which have no export, are flagged and need a person to confirm them.
The fixes were made after seeing the holdout, so the second set of numbers is not a blind test.
| run | upload | auto-labeled | precision | files accepted under wrong type | accepted after review | accepted but wrong | receipts error (max) |
|---|---|---|---|---|---|---|---|
| blind, frozen code | upload_1 | 46.9% | 84.5% | 1 | 2/3 | 2 | 100.0% |
| blind, frozen code | upload_2 | 56.6% | 97.5% | 1 | 2/3 | 2 | 100.0% |
| after fixes, not blind | upload_1 | 95.2% | 99.7% | 0 | 3/3 | 0 | 0.0% |
| after fixes, not blind | upload_2 | 97.9% | 99.8% | 0 | 3/3 | 0 | 0.0% |
Fault injection
Deliberate mistakes, applied to the first upload after its review (when the clean files pass). The question is whether the gate notices.
| fault | split | runs | blocked | held for review | repaired automatically | silently accepted |
|---|---|---|---|---|---|---|
| order subtotal mapped as the order total | dev | 2 | 2 | 0 | 0 | 0 |
| order subtotal mapped as the order total | holdout | 2 | 2 | 0 | 0 | 0 |
| order subtotal mapped as the order total | train | 5 | 5 | 0 | 0 | 0 |
| bank dates read day-first instead of month-first | dev | 1 | 1 | 0 | 0 | 0 |
| bank dates read day-first instead of month-first | holdout | 1 | 1 | 0 | 0 | 0 |
| bank dates read day-first instead of month-first | train | 6 | 6 | 0 | 0 | 0 |
| Shopify payouts export missing | dev | 3 | 3 | 0 | 0 | 0 |
| Shopify payouts export missing | holdout | 3 | 3 | 0 | 0 | 0 |
| Shopify payouts export missing | train | 7 | 7 | 0 | 0 | 0 |
| Amazon settlement export missing | dev | 2 | 2 | 0 | 0 | 0 |
| Amazon settlement export missing | holdout | 2 | 1 | 1 | 0 | 0 |
| Amazon settlement export missing | train | 5 | 5 | 0 | 0 | 0 |
| bank amounts exported with outflows positive | dev | 3 | 0 | 0 | 3 | 0 |
| bank amounts exported with outflows positive | holdout | 3 | 0 | 0 | 3 | 0 |
| bank amounts exported with outflows positive | train | 7 | 0 | 0 | 7 | 0 |
| Faire export missing | dev | 2 | 2 | 0 | 0 | 0 |
| Faire export missing | holdout | 2 | 1 | 1 | 0 | 0 |
| Faire export missing | train | 4 | 4 | 0 | 0 | 0 |
| order totals summed across line-item rows | dev | 1 | 1 | 0 | 0 | 0 |
| order totals summed across line-item rows | holdout | 1 | 1 | 0 | 0 | 0 |
| order totals summed across line-item rows | train | 2 | 2 | 0 | 0 | 0 |
Brands
| brand | split | upload | first pass | review items | auto-labeled | precision | after review | receipts error | naive sum overstates by |
|---|---|---|---|---|---|---|---|---|---|
| Hollis Home | dev | upload_1 | ties out, items open | 8 | 96.8% | 100.0% | accepted | 0.0% | 30.7% |
| Hollis Home | dev | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 63.9% |
| Quillon Coffee Roasters | dev | upload_1 | blocked | 10 | 95.6% | 100.0% | accepted | 0.0% | 7.5% |
| Quillon Coffee Roasters | dev | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 45.0% |
| Saltmarsh Apparel | dev | upload_1 | ties out, items open | 3 | 99.1% | 100.0% | accepted | 0.0% | 5.6% |
| Saltmarsh Apparel | dev | upload_2 | ties out, items open | 4 | 97.8% | 100.0% | accepted | 0.0% | 59.8% |
| Copper Kettle Kitchen | holdout | upload_1 | blocked | 15 | 93.5% | 100.0% | accepted | 0.0% | 0.1% |
| Copper Kettle Kitchen | holdout | upload_2 | ties out, items open | 7 | 96.5% | 100.0% | accepted | 0.0% | 55.6% |
| Lumen & Oak | holdout | upload_1 | ties out, items open | 19 | 93.2% | 99.0% | accepted | 0.0% | 0.3% |
| Lumen & Oak | holdout | upload_2 | ties out, items open | 2 | 99.0% | 99.5% | accepted | 0.0% | 45.5% |
| Northwind Ceramics | holdout | upload_1 | ties out, items open | 13 | 98.2% | 100.0% | accepted | 0.0% | 30.0% |
| Northwind Ceramics | holdout | upload_2 | ties out, items open | 4 | 98.1% | 100.0% | accepted | 0.0% | 66.1% |
| Bramble Pet Supply | train | upload_1 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 28.1% |
| Bramble Pet Supply | train | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 89.6% |
| Copperleaf Tea | train | upload_1 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 27.0% |
| Copperleaf Tea | train | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 64.0% |
| Fernwood Goods | train | upload_1 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 0.1% |
| Fernwood Goods | train | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 41.3% |
| Lark & Pine Candle Co | train | upload_1 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 0.3% |
| Lark & Pine Candle Co | train | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 57.3% |
| Marigold Skin | train | upload_1 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 0.1% |
| Marigold Skin | train | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 47.2% |
| North Arc Outdoor | train | upload_1 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 0.1% |
| North Arc Outdoor | train | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 56.2% |
| Tidewater Swim | train | upload_1 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 29.1% |
| Tidewater Swim | train | upload_2 | accepted | 0 | 100.0% | 100.0% | accepted | 0.0% | 62.3% |
"Naive sum" adds up every deposit in the files. It overstates customer receipts because it counts transfers from savings, loan draws, vendor refunds and rows repeated in overlapping exports.
Limits
- All data is synthetic, and I wrote both the generator and the pipeline. Accuracy on quirks I designed overstates accuracy on real exports; the holdout exists to show how much.
- The simulated reviewer answers from ground truth. Review counts measure how much a person is asked, not how long it takes.
- Supported sources: Shopify orders, Shopify sales reports, Shopify payouts, Amazon settlement and date-range reports, Faire payouts, bank exports, card exports, chart of accounts. PayPal, Stripe and 3PL invoices are not imported yet.