The cart total does not add up
The buyer rejects the cart or flags a variance because the Total in the header differs from the sum of quantity times unit price across the lines — usually by a small amount.
Buyers recalculate the cart from the lines: quantity times UnitPrice, adjusted by PriceBasisQuantity. Your header total has to equal that calculation using the rounded values you actually sent. A total taken from your checkout, which rounded at a different point or applied a basket-level discount, will be out.
Causes, most likely first
Ordered by how often each one turns out to be the culprit, not by how interesting it is. Work down the list.
-
Rounding happens at different points
How to confirm: Your checkout rounds the line total; the document sends an unrounded or differently rounded unit price. The difference is a penny or two and grows with quantity.
Fix: Round the unit price to what you send, then calculate the line and header totals from that rounded value.
-
Floating-point arithmetic
How to confirm: Totals end in values like 19.999999 or are a fraction of a penny out on some carts and not others.
Fix: Calculate money in integer minor units or a decimal type, and format only at the end.
-
A basket-level discount is in the total and not in the lines
How to confirm: The gap equals a promotion or volume discount shown at checkout. The lines carry full price.
Fix: Spread the discount across the lines it applies to, so each unit price is the net price. Buyers match lines to contracts, so the line price is what counts.
-
PriceBasisQuantity is not part of your calculation
How to confirm: Only carts containing items priced per pack or per hundred are out, and by a large factor rather than pennies.
Fix: Divide by the price basis quantity when you calculate line totals, the same way the buyer will.
If it is not on your side
Ask the buyer for the line totals their system calculated from your cart. Comparing them line by line with yours shows which line is out and therefore which rule.
Check the document itself
Before chasing “The cart total does not add up” further, paste the cXML or OCI payload into our free tester. It runs in your browser and reports the structural problems buyers reject on. The interactive demo plays the whole round trip from the buyer's seat.
Open the tester Play the demoRelated questions
How many decimals should the unit price have?
As many as the currency normally uses, unless the buyer says otherwise. Prices that need more precision are better expressed with a price basis quantity than with extra decimals.
Can we leave the total out?
The PunchOutOrderMessageHeader requires a Total. Send one, calculated from the lines you are sending.
Rather not be the one debugging this?
A free PunchOut shop runs the PunchOut round trip for you: upload from Excel, test it, invite your buyer.
Start free Send us the error