runbookify
← All plans
Logistics & Transportation / Freight Cost Audit

Freight Spend Allocator & Chargeback: Make Margins Reflect True Shipping Cost

Match the freight you actually paid to the shipments it covered, allocate that cost to departments, customers, or SKUs by the driver you choose — weight, value, or units — and issue chargeback statements, with finance approving the method and the numbers before anything posts to the GL.

IntermediateA weekendBuilds onNext.jsSupabaseResend
What you'll build

A logged-in tool where you import paid freight invoices and shipment details, match each freight charge to the shipments it covered, allocate the cost across departments, customers, or SKUs by a driver you choose (weight, value, or units), handle multi-stop splits, have finance review and approve the method and the results, and export a GL allocation file plus per-party chargeback statements.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.

Before you start

  • A Supabase account (free)
  • A Vercel account (free)
  • A Resend account (free)
  • Your paid-freight invoices as a CSV
  • A shipment detail export (customer, order, department, SKU, weight) as a CSV
  • Claude Code or any AI coding agent

The problem this kills

You paid the carrier. The invoice cleared. But ask "what did it actually cost to ship to that customer, that department, or that SKU?" and the honest answer is usually a shrug. Freight lands in one big GL bucket, gets spread by a stale percentage, and every margin number downstream is quietly wrong. Your most freight-heavy customers look more profitable than they are, your cheapest-to-ship products subsidize the bulky ones, and nobody can defend a chargeback when a department disputes it.

The spreadsheet version is worse. Someone keys carrier invoices against a shipment report, eyeballs which charges go with which orders, splits a multi-stop truck by gut feel, and pastes the result into the GL. It's slow, it's unauditable, and the moment a multi-stop load or a consolidated invoice shows up, the math falls apart. When finance asks "how did we arrive at this allocation?", there's no answer that survives scrutiny.

True freight cost is one of the largest hidden distortions in margin reporting. It deserves a real, governed tool — one that matches paid freight to the shipments it covered, allocates by a method you can defend, and never posts a number a human didn't approve.

What you'll build

A simple internal web app for your logistics-finance and cost-accounting team. You import the freight you actually paid (carrier invoices) and your shipment details (customer, order, department, SKU, weight, value, units). The tool matches each freight charge to the shipment or shipments it covered — including the messy ones: a single invoice covering many orders, or one multi-stop truck that has to be split across drops.

Then you pick an allocation driver — weight, declared value, or unit count — and the tool spreads each freight charge across the right departments, customers, or SKUs by that driver. You see the full allocation, drill into any line, and adjust before it's locked. Finance reviews and approves both the method and the results, and only then does the tool produce a GL allocation file (ready to post) and per-party chargeback statements you can send out. Every run is keyed so the same invoice can't be allocated twice.

What's inside the Implementation Plan

The downloadable plan is a step-by-step file you paste into an AI coding agent. It opens by interviewing you about your business — how freight invoices and shipment data are shaped today, your carrier and customer naming conventions, which driver you allocate by (and whether different freight types use different drivers), how you split multi-stop loads, your typical and peak shipment volumes, and the edge cases that break the math (accessorials, fuel surcharges, credits, returns, an invoice with no matching shipment). It reflects a short tailored spec back to you and gets your thumbs-up before it builds anything, so the tool fits how your freight actually flows — not a generic template.

From there it walks the agent through the data model, the freight and shipment imports, the matching engine, the multi-stop splitter, the driver-based allocation engine, the finance review-and-approve gate, and the GL file and chargeback statement exports. Every step ends with a ready-to-copy prompt. There's a full "No API yet?" path that uses Google Sheet / CSV imports as the data source and produces clean CSV exports in the exact columns your GL and AR systems expect — so you can build and run the whole thing this weekend regardless of which TMS or ERP you're on.

The governance it includes (this is the point)

This tool moves money between cost centers and bills real parties, so the controls aren't optional. The plan builds in login so only your team can use it, row-level security so you only ever see your own organization's freight data, a complete audit trail of who matched what, who changed which allocation, and who approved which run, a hard human-approval gate so no allocation posts to the GL and no chargeback goes out until finance signs off on both the method and the results, and duplicate guards — keyed on invoice + allocation run — so the same freight can never be allocated or charged back twice.

Who it's for

Logistics finance, cost accountants, and controllers who own freight cost — anyone who needs margins that reflect what shipping truly cost, who issues or defends freight chargebacks to departments or customers, and who's tired of allocating a six-figure freight spend with a spreadsheet and a guess. If you can explain how your freight invoices and shipments are shaped and how you'd fairly split a shared truck, you can build this.

You've got this — start with the plan, paste the first prompt, and answer the interview. You'll have your first defensible freight allocation on screen before the weekend's out.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.