The shipping price your customer paid and the price the carrier eventually charges you are two different numbers. Most checkouts are built as if they were the same one.
A rate call at checkout is a quote. It is priced from the dimensions and weight you declared, for one service level, at one moment in time. Weeks later the carrier re-measures the parcel, applies a surcharge, or reprices the lane, and the adjustment turns up in an invoice with nothing linking it back to the order.
What we settled on across multi-carrier delivery work: treat the quote as a stored artifact, not a number rendered on a page. Persist the full input set next to the order (declared dimensions, weight, destination, service, carrier, timestamp, validity window). Then re-quote at label purchase, compare against the stored quote, and apply an explicit tolerance rule that decides in advance who absorbs a difference: the customer, the margin, or a manual review queue.
The payoff comes later, not at checkout. It shows up when the monthly carrier invoice lands and every adjustment can be matched to an order, a declared measurement and a quote, so you can dispute the wrong ones instead of accepting all of them as the cost of doing business.
Unmatched carrier adjustments are probably one of the quietest margin leaks in e-commerce, because they never look like a bug.
For teams running multi-carrier shipping it tends to come down to one of two things: you reconcile carrier invoices line by line against stored quotes, or the delta gets written off as shipping cost variance.