mirror of
https://github.com/marcusDenslow/terminalShop.git
synced 2026-10-25 18:08:45 +01:00
Shippo's /v1/orders endpoint rejects >2 decimal places on parcel weight and >4 on line_items[].weight. Converting ounces to kg (oz * 0.0283495) routinely produces 6-decimal values, so the first real label purchase 400'd with "Ensure that there are no more than N decimal places". Round at the payload boundary in createShippoOrder rather than in the caller — keeps the precision of the source (Coffee.Ounces) and only loses it when the wire format demands it.