Orderhaven Wholesale
A Bubble B2B order portal migration with a recoverable ERP handoff
- Scale
- Wholesale ordering
- Bubble
20days
Delivery
12,000/12,000
Order reconciliation
0
Retry safety
32/32
Approval validity
Illustrative before/after figures.
The product
Buyers selected from a 5,000-item customer catalogue and submitted orders. Approvers handled two existing approval levels, while administrators investigated export failures. The ERP assigned its own order identifier. An order could change before approval, so the authorised version and the exported version needed to remain connected. Catalogue visibility and pricing authority followed the existing commercial arrangement.
The challenge
The trigger was an export response lost after the ERP had already accepted an order. Sending again risked duplication; doing nothing left the buyer uncertain. Discovery inspected the actual lookup and duplicate-prevention contract before choosing the retry strategy. Orderhaven needed engineering ownership of this boundary, not an ERP replacement. Approval semantics were reviewed at the same time because a safely delivered order could still be the wrong version.
The wholesale team could not tell whether a timed-out export had created an ERP order. Pressing retry risked a duplicate; waiting delayed fulfilment. The brief made an acknowledged external reference the success boundary and tied approval to the exact order version exported. We preserved the current ERP contract and pricing rules. The extra integration work justified Scale complexity even though the buyer-facing screens were straightforward.
How we tackled it
- 01
Bind approval to content. Every approval referenced the exact order version; an edit followed the existing reapproval policy.
- 02
Persist the export intent. A stable external reference was stored before delivery.
- 03
Reconcile uncertainty. Timeouts triggered a lookup or the ERP's agreed duplicate-prevention path before another create request.
- 04
Separate exceptions. Invalid lines, unavailable ERP service and unknown acceptance each received a defined recovery action.
What we built
Next.js, TypeScript and Tailwind implemented the portal. Postgres with Drizzle stored orders, versions and approval events. A durable worker delivered exports through the documented ERP adapter. Managed authentication and account-specific policies controlled buyers and approvers. Correlation identifiers connected the portal order, attempts and ERP result. The design deliberately preserved the existing source of catalogue and price authority.
The rehearsal compared line items, totals, approval history and ERP references. Fault fixtures included a lost acknowledgement, revoked approver access and an edit after approval. A contract-faithful stub exercised failure paths, followed by a separate sandbox contract check in the story. New exports paused during the final reconciliation. Recovery preserved external acknowledgements and orders created after the snapshot before the prior route resumed.
Before & after — illustrative results
The illustrative duplicate-prevention result concerns 200 defined timeout/retry sequences, not unlimited external-system behaviour. Export timing assumes a healthy ERP and the agreed sandbox rate. The exception threshold remains visible during outages. Reconciliation checks line identity and amounts as well as order totals. Any reduced administration cost would require actual handling-time records; it is not inferred from the invented queue timings.
Illustrative before/after values. No tests or client measurements were performed for this story. The comparison conditions describe how an equivalent real migration would be evaluated; they are not a test report.
| Metric | Before | After | Comparison conditions |
|---|---|---|---|
| Order reconciliation | 12,000 source orders | 12,000/12,000 reconciled | Compare line items, exact totals, approval version and ERP references. |
| Retry safety | 18 duplicate orders in 200 fault fixtures | 0 duplicates in 200 fixtures | Contract-faithful stub plus defined sandbox contract checks; not production evidence. |
| Approval validity | 25/32 defined checks pass | 32/32 pass | Version, role, threshold and revoked membership cases. |
| Export completion, p95 | 420 seconds | 75 seconds — 82.1% lower | 500 orders at the agreed healthy-ERP rate; surface unresolved work over five minutes. |
| Investigate an unknown ERP outcome, median | 28 min | 8 min | Twenty timeout fixtures; same operator; use the external reference or confirmed absence before any retry. |
| Correct an order before reapproval, median | 14 min | 5 min | Ten scripted line-item changes; same approver; invalidate obsolete approval and verify a single valid export version. |
The outcome
Orderhaven ended the story with one reference connecting an approved order to its ERP outcome. Operators could act on an explicit exception state rather than decide whether to resend based on a spinner. Handover included the adapter contract, reconciliation commands and approval rules. The case demonstrates Scale's value when a business-critical integration must remain recoverable through failures.
Why these improvements mattered
The new queue distinguished accepted, failed and unknown outcomes, so operators did not need to infer success from a button click. Versioned approval prevented a valid approval from authorising a different order. This improved traceability and handling time without claiming that every ERP vendor supports the same retry mechanism.
Scope & timeline
Scope
Scale covered catalogue access, order entry, approval, status tracking and one ERP adapter. Bubble to Code delivered an approval-version model, durable export intent and exception recovery guide. Inventory forecasting, new pricing rules and a second enterprise integration stayed outside scope. Unknown outcomes remained visibly pending until reconciled. This replaced optimistic success messaging with a state the operator could investigate.
Delivery timeline
Delivery schedule: 20 working days. Team: Two engineers, shared QA and an ERP integration owner. The clock starts after scope approval, usable source data, test access and agreed UI are available. Waiting for external approvals is excluded. This is a bounded example, not a turnaround guarantee.
Days 1–4: agree approval versions and the ERP idempotency contract.
Days 5–12: build order workflows and durable export intents.
Days 13–18: run timeout/retry contract tests and reconcile orders.
Days 19–20: switch exports and rehearse operator recovery.
FAQ
- Does a Bubble ERP migration require replacing the ERP?
- No. The portal can move while retaining the ERP, provided its contract and authoritative records are mapped.
- How can an integration avoid duplicate orders after a timeout?
- Use a stable external reference and the provider's supported reconciliation or duplicate-prevention mechanism before issuing another create operation.
Discuss a similar migration
Bring your ERP contract, an ambiguous export and the rule for editing approved orders. Bubble to Code can establish the safe external-reference strategy and assess Scale fit. Resolve who owns an unknown outcome before promising a retry policy.
[Title] Custom — demonstration cases
[Subtitle] 7 complete English website stories • 20 October 2026
