Delivered remotely for a business based in Wellington, New Zealand. Names withheld by agreement.
Project Overview
Industry: Manufacturing and distribution of configurable, made-to-order building products sold to construction, facilities and trade buyers.
Type of solution: A configure-price-quote and quote-to-cash platform: a public self-service configurator with automated pricing and checkout, over an operations back office covering order processing, supplier purchasing, accounts-payable reconciliation, logistics, sales CRM and reporting. Alongside it, a custom marketing site with a small commerce store for parts and accessories.
Business context: The product is manufactured to the buyer's measurements and specification. That makes every price a small calculation rather than a lookup — and because the finished goods are heavy and ship on pallets, freight is a substantial and volatile part of the total. Historically the only way to answer "what will this cost?" was to have a person work it out, call a carrier, apply a margin and email a document back. Buyers, meanwhile, expect to configure and price online the way they do everywhere else.
General users: Public buyers configuring and paying without an account; sales representatives; order processors; drafting staff; customer support; office management; finance and bookkeeping; and platform administrators.
General purpose: To make an accurate, freight-inclusive price available to the buyer immediately, and to automate the operational chain that follows the order so that growth in order volume does not require a proportional growth in back-office headcount.
The Business Challenge
A made-to-order product cannot have a price list. Price depends on configuration, materials, finish, measured dimensions and destination. Publishing a fixed price is impossible; quoting by hand is slow and inconsistent between the people doing it.
Freight is not a rounding error. For heavy, palletised goods, shipping is a large share of the total and it changes by carrier, destination, weight, class and day. A quote that estimates freight is a quote that either loses money or loses the deal. But a real rate requires knowing the freight class, the pallet count and the stacked height of goods that have not been manufactured yet.
Speed decides the sale. In this trade the buyer is usually pricing several suppliers at once. A number delivered in two minutes and a number delivered in two days are not the same product, regardless of which is cheaper.
The work does not stop when the customer pays. Every order has to become purchase orders to suppliers, be matched against supplier invoices when they arrive, be tracked through freight, and be reconciled into accounting. Done manually, this is where a growing order book turns into a growing back office.
Supplier invoices do not match purchase orders. They arrive by email as PDFs, in each supplier's own format, and they routinely differ from the purchase order for legitimate reasons. Someone has to notice, quantify and resolve the difference on every single order.
Logistics information arrives as prose. Tracking numbers turn up inside PDF attachments on carrier emails. Until someone reads that email and updates the order, the customer does not know their goods have shipped.
Many hands, one record. Sales, drafting, order processing, support and finance all act on the same order at different stages. Without an explicit workflow, orders stall in the gaps between roles and nobody can say whose turn it is.
Not every enquiry is a customer. Self-service pricing means competitors and non-buyers can help themselves to commercially sensitive numbers, so inbound enquiries need qualifying before they consume a salesperson's time.
Our Approach
Model the shipment before the product exists. We built the freight side as a first-class domain calculation: derive weight, freight class, pallet count and stacked height from the chosen configuration and materials, then use those to request real rates. Without this step no carrier will quote, and without a carrier quote the price is guesswork.
Rate multiple carriers live, behind one interface. Each national carrier was implemented as its own class conforming to a shared shipping-option interface — REST, token-authenticated REST and SOAP integrations sitting behind an identical contract. The pricing engine asks for options and compares them; it does not know or care how each rate was obtained. Adding or retiring a carrier is a contained change.
Make pricing automatic but governed. Landed cost is assembled from component pricing, finish, fees and the selected freight option, and margin is applied through a single governed rule with a protected floor rather than being left to individual judgement. The result is a price that is fast, consistent and defensible.
Let quotes arrive three ways and converge on one. A buyer can configure a space step by step, upload their own drawings for a manual takeoff, or be walked through a short path by a representative. All three produce the same quote and revision structure, so everything downstream — processing, purchasing, shipping, accounting — is written once.
Treat inbound email as a system input. Supplier invoices, carrier notifications and customer replies all arrive by email. We built an inbound email pipeline that turns messages into records, threads them to the right order, stores attachments, extracts data from PDF content, and moves the order's state or raises a task accordingly.
Automate the money chain end to end. Purchase orders are generated into the accounting system, supplier invoices are matched back against them, the variance is calculated and stored, and anything that does not reconcile cleanly becomes an explicit exception with a defined resolution path — rather than an email thread.
Make the workflow visible. An explicit order state machine with logged transitions, plus task dashboards per operational stage with claim/release, so at any moment it is clear what needs doing and who owns it.
Run scheduled work safely on more than one server. Follow-ups, decline processing, daily reporting and expiry all run on schedule, guarded by a database-level lock so the platform can scale horizontally without duplicating scheduled work.
The Solution
Self-service configurator. A step-by-step wizard capturing the spaces to be fitted out, their layouts, materials, finishes, unit counts and measured dimensions, along with project details, delivery timing, site access conditions and destination — with validation applied progressively so a part-finished configuration can be saved and resumed.
Automated freight-inclusive pricing. Weight, freight class, pallet count and stacked height are derived from the configuration; multiple national carriers are rated live; carrier discounts and a preference rule select an option; and the landed cost flows into a governed margin calculation along with finish upcharges, order-size fees and, for cross-border shipments, duty and brokerage handling.
Alternative intake paths. Buyers with their own drawings can upload them for manual takeoff, and representatives can create quotes directly during a call. Both feed the same quote and revision model.
Quote revisions and lifecycle. Numbered revisions with approval, rejection and rejection reasons, material comparison across revisions, discounting, quote expiry and extensions, duplication, and lost-quote capture with reasons — all with full status-change history.
Checkout and payment. A multi-step checkout supporting card payments, bank transfer/eCheck, terms and wire, with purchase-order document upload, tax-exemption certificate handling, automated sales tax calculation, in-browser signature capture, refunds, cancellations, and post-order additional charges with their own payment flow.
Order processing workflow. An explicit state machine spanning drafting, review, ordering, financial processing and fulfilment, surfaced as per-stage task queues with claim and release, and with the responsible user recorded at each stage.
Supplier purchasing and accounts-payable automation. Purchase orders are generated into the accounting system; supplier invoices arriving by email are text-extracted from PDF, matched to the originating order, and compared against the purchase order with the variance stored as data. Anything outside tolerance becomes a typed exception — prepaid, order changed, refund applicable, additional charge — with its own resolution path.
Automated shipment tracking. Tracking numbers and carrier identity are extracted from PDF attachments on inbound carrier email, attached to the order, and used to trigger shipping and installation communications to the customer automatically.
Sales CRM and follow-up. Automatic lead assignment with round-robin distribution, availability handling, pre-booked assignments and continuity for repeat buyers; an automatically generated multi-touch follow-up schedule with editable call scripts; response tracking that expires on its own; and sales versus support classification that keeps ownership unambiguous.
Reporting and goals. Daily sales logs, monthly and per-representative goals paced across business days with cumulative and remaining targets, a live leaderboard delivered over websockets, operational and financial reports with export, and scheduled daily report generation.
Document generation. Quote confirmations and invoices generated as PDFs from templates and merged with layout drawings and bills of materials into a single document for the customer or the supplier.
Administration. Full catalogue management for materials, finishes, layouts and their dimensions, accessories, parts, freight classes, charges, tax settings, holidays, a document library, site-wide settings and users, with role-based policies applied resource by resource.
Marketing and small-parts commerce. A separately hosted content and commerce site presenting the product range, specifications, comparisons and service areas, with a store for low-value parts and accessories, and handoff into the quoting platform for anything configured.
Key Features
Live multi-carrier freight rating inside the quote Several national freight carriers rated in real time during a customer-facing quote, each integrated behind a shared interface so the pricing engine compares options without knowing how each rate was obtained.
Shipment modelling from configuration Weight, freight class, pallet count and stacked height derived from the chosen layout and materials before anything is manufactured — the prerequisite for getting a real carrier rate rather than an estimate.
Governed automated pricing Landed cost assembled from components, finish, fees and freight, with margin applied through a single governed rule and a protected floor, so pricing is consistent regardless of who or what generated the quote.
Three intake paths, one quote model Self-service configuration, customer-supplied drawings and representative-created quotes all converge on the same quote and revision structure, so downstream processing is built once.
Inbound email as a system input Supplier, carrier and customer email is ingested, threaded to the correct order, stored with attachments, parsed for content, and used to move workflow state and raise tasks.
Automated accounts-payable matching Supplier invoices extracted from PDF, matched to the originating purchase order, variance calculated and stored, and out-of-tolerance cases routed into a typed exception workflow instead of an inbox.
Automated tracking extraction and customer notification Tracking identifiers and carrier recovered from PDF attachments on carrier email, attached to the order, and used to trigger customer shipping communications without manual intervention.
Explicit order state machine with task dashboards A logged workflow across drafting, review, ordering, finance and fulfilment, presented as per-stage queues with claim and release so ownership is never ambiguous.
Automated lead routing and follow-up cadence Round-robin assignment with availability, pre-booking and repeat-buyer continuity, plus a multi-touch follow-up schedule with scripted guidance generated automatically at quote creation.
Accounting integration Customers, items, invoices, vendors, purchase orders and bills synchronised with the accounting system, so the operational platform and the books stay aligned without re-keying.
Technical Architecture
Public application tier. Tokenised, account-free access for buyers across the configurator, checkout, payment, signature and invoice flows, with wizard state modelled on the records themselves through a declared step list and step-conditional validation — allowing partial configurations to persist and resume without polluting the data model.
Administrative tier. A large role-partitioned back office covering catalogue, orders, purchasing, accounts payable, logistics, CRM, reporting and settings, with policy classes applied resource by resource.
Integration API. A small versioned namespace used only for machine-to-machine traffic: an inbound email webhook and a conversion export for advertising attribution.
Service layer. Complex logic extracted into dedicated services — pricing and shipping, payments, accounting, PDF generation and merging, email, and location/telephony helpers — plus a class hierarchy of shipping options, one per carrier, behind a common interface.
Asynchronous and scheduled layer. A database-backed job queue for longer work, and cron-scheduled tasks for follow-up generation and dispatch, payment decline processing, response expiry, daily report and CSV generation, and shipped-order communications. Scheduled work is guarded by a database-level lock with an explicit lock duration, so multiple application instances can run without duplicating jobs.
Real-time layer. A websocket channel broadcasting sales events to a live leaderboard in the back office.
Data layer. A relational database with an extensive catalogue, order, revision, payment, purchasing, logistics and audit schema, evolved through a long migration history, with soft delete applied globally so operational records are retained rather than removed.
Storage and documents. Cloud object storage for all uploads — drawings, purchase orders, certificates, supplier invoices, catalogue imagery — with server-side image optimisation, and PDF generation and merging for customer- and supplier-facing documents.
Observability. Error reporting, application performance monitoring, structured log formatting shipped to a hosted log platform, and scheduled-job logging with host attribution.
Content and commerce site. A separately hosted content management platform with a fully custom theme: bespoke page templates, an editor-driven flexible content builder, custom editor blocks, commerce template overrides for the parts store, structured-data injection for search, and progressive content loading.
Flow: Buyer configures → shipment characteristics derived → multiple carriers rated live → governed pricing applied → checkout and payment → order workflow and supplier purchase orders → inbound supplier invoices matched and reconciled → tracking extracted from carrier email → customer notified → accounting synchronised → reporting
Technology Stack
| Category | Technology |
|---|---|
| Backend language | Ruby |
| Backend framework | Ruby on Rails |
| Database | MySQL, extensive migration history, soft delete throughout |
| Caching / queue backing | Redis |
| Application server | Puma |
| Authorization | Pundit policy classes per resource |
| Authentication | Password hashing with bcrypt, password history and expiry policy, tokenised public links |
| Multi-step flows | Wizard library with step-conditional model validation |
| Frontend (application) | Server-rendered views, asset pipeline, SCSS, CoffeeScript, jQuery, Bootstrap, an admin UI framework |
| Background jobs | Database-backed job queue, daemonised, with a monitoring UI |
| Scheduling | Cron-generated schedule with a database lock for distributed safety |
| Real-time | Websocket channel for live sales reporting |
| File storage | AWS S3 via an uploader library, with server-side image optimisation |
| Document generation | HTML-to-PDF rendering, PDF merging, PDF text extraction |
| Mailgun for outbound and inbound processing, CSS inlining, responsive templates, outbound interception and logging | |
| Payments | A card payment platform and a separate bank-transfer/eCheck gateway |
| Tax | Third-party sales tax API plus an internal rate table and exemption handling |
| Accounting | QuickBooks Online integration (customers, items, invoices, vendors, purchase orders, bills) |
| Freight | Multiple national carriers integrated over REST, token-authenticated REST and SOAP |
| Data validation | Third-party email deliverability validation |
| Monitoring | Rollbar error reporting, New Relic APM, structured logging shipped to a hosted log platform |
| Testing | Minitest, Capybara and Selenium, HTTP stubbing and cassette-based recording, coverage reporting with CI-compatible output |
| Deployment | Capistrano onto a managed AWS application stack |
| Content site | WordPress with WooCommerce, a fully custom theme, custom editor blocks and an editor-driven flexible content builder |
Technical Challenges & Solutions
| Challenge | Our Approach |
|---|---|
| Quoting a made-to-order product where price depends on configuration, weight and destination | An automated pricing engine that assembles landed cost from component pricing, finish, fees and live freight, then applies margin through a single governed rule with a protected floor — producing a consistent price in the time a buyer is willing to wait. |
| Getting a real freight rate for goods that do not yet exist | Freight class, pallet count, per-pallet weight and stacked height derived as first-class domain calculations from the chosen layout and materials, isolated in a shipping service and reused wherever the order is re-priced. |
| Four carrier integrations in three different protocols, all inside a customer-facing flow | One class per carrier behind a shared shipping-option interface, so REST, token-authenticated REST and SOAP differences are contained; the pricing engine simply requests and compares options, and carriers can be added or retired without touching pricing. |
| Supplier invoices that arrive as PDF email attachments and rarely match the purchase order | An inbound email pipeline that stores attachments, extracts text from PDF, matches invoices to the originating order, computes and stores the variance against the purchase order, and routes anything out of tolerance into a typed exception workflow with defined resolutions. |
| Logistics data buried in unstructured documents | Pattern extraction of tracking identifiers and carrier from PDF attachments on inbound carrier email, attached to the order and used to trigger customer shipping and installation communications automatically. |
| One order, many roles, many stages | An explicit state machine with every transition logged, complemented by parallel operational flags and per-stage task dashboards with claim and release, so work never stalls invisibly between teams. |
| Scheduled work in a horizontally scaled environment | A database-level lock with an explicit lock duration and deadlock handling guarding every scheduled task, allowing instances to be added without duplicating follow-ups, emails or reports. |
| Multiple payment methods, each with its own refund path | A payment layer abstracting card, bank transfer, terms and wire, with transaction records per method, refunds resolved against the correct original transaction, and scheduled reconciliation of asynchronous payment declines. |
| Keeping the operational platform and the accounting system in step | Direct integration covering customers, items, invoices, vendors, purchase orders and bills, with integration errors captured as records so failures are visible and re-runnable rather than silent. |
Security & Reliability
Policy-based authorization. Access is decided by explicit policy classes defined per resource across the administrative surface, with public access declared deliberately rather than by omission.
Credential handling. Passwords are hashed with bcrypt, previous password digests are retained to prevent reuse, and passwords expire on a fixed cycle.
Account-free customer access. Buyers reach their own quote, payment and invoice pages through non-sequential tokenised links rather than by creating accounts — reducing both friction and the amount of customer credential material the platform holds.
Role separation across the operational surface. Distinct roles for sales, drafting, order processing, support, management and finance, with administrative areas restricted separately.
Communication auditability. Outbound mail is intercepted and logged, and inbound mail is stored as records threaded to the order it concerns, so the full correspondence history around an order is retained rather than living in individual mailboxes.
Financial traceability. Purchase orders, supplier invoices, variance calculations, exceptions, adjustments, refunds and cancellations are all stored as records, so any figure can be traced to its origin.
Workflow auditability. Order status transitions, response tracking, delivery expectation calls and per-stage processor attribution are logged, giving a complete history of who did what and when.
Operational monitoring. Error reporting, application performance monitoring and structured logs shipped to a hosted platform, with scheduled-job execution logged and attributed to the host that ran it.
Tested integrations. The carrier and gateway integrations are covered by a test suite using HTTP stubbing and recorded interactions, so third-party behaviour can be regression-tested without live calls.
Scalability & Performance
Stateless application tier. Application instances hold no local state — uploads go to cloud object storage and sessions are externalised — so capacity is added by adding instances.
Distributed-safe scheduling. The database lock around scheduled work is what makes horizontal scaling possible at all: without it, every added instance would duplicate every follow-up email and every daily report.
Asynchronous processing. Document generation, email dispatch and other slow work is pushed to a background queue rather than executed in the request cycle.
Batch rather than on-demand reporting. Daily sales logs and export files are generated on schedule, so management reporting does not compete with customer-facing traffic.
Query discipline on heavy reads. Reporting queries that join across orders, payments, transactions and shipping options use explicit eager loading, with N+1 detection wired into the development environment to catch regressions before they ship.
Optimised asset and image delivery. Images are optimised server-side on upload and served from cloud storage; application assets are compiled and compressed.
Contained external latency. Third-party latency is concentrated in the carrier rating step and isolated behind a single interface, so it can be tuned, cached or parallelised without touching the surrounding pricing logic.
Business Outcomes
- Buyers get a freight-inclusive price immediately instead of waiting for a manual quote, at the moment they are comparing suppliers.
- Pricing is consistent and governed, applied by one rule with a protected floor rather than varying with whoever prepared the quote.
- Freight is priced from real carrier rates rather than estimated, removing a significant source of margin erosion on heavy shipments.
- The back office scales with automation rather than headcount — purchase orders, invoice matching, tracking extraction and accounting sync all happen without manual re-keying.
- Supplier invoice discrepancies surface as workflow, with the variance quantified and an explicit resolution path, instead of being found late or not at all.
- Customers are notified when their goods ship without anyone reading a carrier email first.
- Every order has a visible owner and stage, so work does not stall in the gaps between sales, drafting, processing and finance.
- Follow-up happens by default, generated automatically at quote creation rather than depending on individual discipline.
- Management has current numbers, with daily logs, paced goals, live leaderboards and exportable reports produced on schedule.
Why it worked
The interesting problem in this project was not the web application. It was that an accurate price required solving a physical logistics problem first. You cannot get a freight rate without a freight class, and you cannot get a freight class without knowing what the finished goods weigh and how they stack on a pallet — for a product that has not been made yet, configured by a buyer who is not going to wait. Most quoting tools sidestep this by estimating shipping. We modelled it properly, because in this trade an estimate is the difference between a profitable order and an unprofitable one.
The same judgement runs through the rest of the build. We treated inbound email as a system input rather than a mailbox, because that is genuinely where supplier invoices and carrier tracking arrive, and pretending otherwise means a person retyping them forever. We built carrier integrations as interchangeable implementations of one interface, because carrier relationships change and pricing logic should not. We put a database lock around scheduled work, because a platform that cannot be scaled horizontally without sending duplicate emails is not really scalable. And we made the order workflow explicit, because when five roles touch one record, the expensive failure is not a bug — it is an order nobody realises is waiting.
Our teams work across Ruby on Rails and long-lived business platforms, payment and accounting integration, carrier and logistics APIs, document generation and parsing, workflow modelling, and content and commerce delivery — with the domain judgement to identify which part of a business problem is the one the software actually has to get right.
Final Summary
A manufacturer of configurable, made-to-order building products faced a problem familiar to that whole sector: the product cannot have a price list, so every enquiry consumed a salesperson, a freight phone call and a day or two — while buyers, comparing several suppliers at once, went with whoever answered first.
Our team built a platform that answers immediately. Buyers configure their requirement step by step; the platform derives what the finished goods will weigh, how they will palletise and what freight class they fall into; rates several national carriers live; selects an option; and assembles a complete, freight-inclusive price under a single governed margin rule. Buyers who prefer to send drawings, and representatives quoting over the phone, feed the same quote and revision model, so nothing downstream has to care how the quote began.
Behind that sits the part that determines whether the business can grow: the operational chain after the order. Purchase orders are generated into the accounting system. Supplier invoices arriving as PDF attachments are extracted, matched to the originating order, and reconciled — with the variance quantified and anything unusual routed into an explicit exception workflow. Tracking numbers are recovered from carrier email attachments and used to notify customers automatically. Orders move through a logged state machine with per-stage task queues, so ownership is never in doubt. Leads are assigned and followed up on a schedule generated at quote creation. Scheduled work is guarded by a database-level lock so the platform can scale across instances without duplicating a single email.
The result is a business that can quote in minutes instead of days, price freight from real rates rather than estimates, and absorb more orders without absorbing proportionally more back office — which, for a made-to-order manufacturer, is the whole game.