Margin-Safe Pricing Engine
Prices 200+ parts and kits from landed cost (supplier price, exchange rate, freight modelled from real sea and air quotes, finish uplifts) and refuses to publish anything that fails its margin and stress tests.
01Problem statement
More than 200 parts, five finishes each, plus kits, all priced by hand over time. Real cost depends on the supplier's price, the exchange rate, how the part ships (a canard by air costs nothing like a bumper by sea) and the finish. A review showed prices had drifted away from cost, and many single-part orders were unprofitable once freight and FX were counted.
02Goals
In scope
- Price every part and kit from cost
- All assumptions in one config
- Impossible to apply a bad change
Out of scope
- Dynamic or competitor-based pricing
03Acceptance criteria
- Every part, kit and real past order keeps ≥ 25% margin
- Still profitable at worse FX and freight × 1.25
- Report-only by default
- Apply asks for confirmation and backs up first
- Finish uplifts preserved
04Design
- config.toml holds FX, uplifts, fees and real freight quotes
- Freight is fitted as fixed + per-unit cost from sea and air quotes
- Parts and kits are priced, then tested
- Output is a CSV report, or a guarded apply
- Scope
- 200+ parts and every kit, five finishes each
- Inputs
- Supplier cost, FX, freight quotes, finish uplifts, checkout fees
- Freight model
- Fixed + per-unit fit from real sea and air quotes
- Kits
- Priced from their parts, with a bundle discount
- Tests
- Every part, kit and real past order ≥ 25% margin
- Stress
- Still profitable at worse FX and freight × 1.25
- Safety
- Report-only by default; apply blocked unless tests pass, backup first
05Key decisions
| Decision | Alternative considered | Why |
|---|---|---|
| Tests as a hard gate on apply | A warning in the report | A bad price is expensive; the tool should refuse |
| Two shipping groups | Many size classes | Simpler to reason about, with nearly the same accuracy |
| Worked examples agreed before any write | Apply, then review | Pricing is a business decision, not just a calculation |
06Failure modes
| Risk | Mitigation |
|---|---|
| Store automation re-derives finish prices | Its multipliers must match the model, or it overwrites them |
| An interim change goes out before agreement | Restored from backup the same day; nothing writes without agreed examples now |
07Testing & rollout
Testing
- Built-in margin and stress tests
- Every real past order replayed through the model
Rollout
- Report shared, examples agreed, then applied with backups
08Outcome
- Parts and kits repriced from cost on 13 November 2026
09Follow-ups
- Align the store automation's finish multipliers with the model