API surface. Rate sheets, surcharges and pricing rules are managed over GraphQL Interface. Integrators see their effect on REST rates, through rate.pricing_details.
Carriers, 3PLs and fleets price their own networks. Universal implementers price custom or offline carriers, and mark up carrier rates. All of them need the same things: a tariff by service, zone and weight, surcharges, customer-specific deals, and a way to explain any price after the fact.
The structure follows Karrio’s rate sheets, which have run in production for custom carriers: shared zones, shared surcharges, and service × zone rates in weight bands with both a sell rate and a cost.
This class diagram shows how the pricing objects reference the catalog objects from chapter 14.
1. Rate sheet
Calculation (normative)
For each candidate service:- Resolve zones with
matchZone(GraphQL Interface mutation) (purposepricing), for bothship_fromandship_to. - Billable weight = max(actual, dimensional) per parcel, rounded per
weight_rounding. Multi-parcel shipments are priced per parcel and summed, unless the sheet setsaggregate: "shipment". - Find the band, compute the base charge, and apply
min_charge. - Apply every active surcharge whose
conditionsmatch, in order (fixed amounts first, then percentages), using each surcharge’sbasis. - Apply
pricing_rules (§3), in priority order: the highestpriorityfirst, with ties broken bycreated. - Emit a
ratewithpricing: "rate_sheet", thecharges[]breakdown, andpricing_details.
pricing_details is part of the rate object in every mode where pricing is computed. It makes every price reproducible.
This flowchart shows the normative calculation for one candidate service, and which step fills each part of pricing_details.
2. Surcharge
Option prices come from surcharges with
conditions.options. The option object links back to them (chapter 14 §3).
This flowchart shows how one surcharge turns into a charge line, including the schedule[] lookup by ship date.
3. Pricing rule
Pricing rules adjust a computed rate (in Carrier, 3PL and Fleet modes) or a carrier’s rate (in Universal and 3PL modes).typeismarkup,discount, oroverride(which replaces the base with a fixedamount, for contract prices).floorstops a discount or override from pushing price belowcostplus a margin. It requirescoston the rate sheet, or the carrier cost in Universal mode.visible: falsefolds the adjustment into the line it adjusts.visible: trueemits a separateCharge(kind: "discount"or"adjustment").- In Universal mode, markups apply to carrier rates, and the rate’s
pricingbecomesimplementer. The original carrier amount is kept insystem_metadata.carrier_total, visible to owner accounts only.
4. Endpoints
simulateprices a shipment against a draft or pending version without publishing it. This is how tariff changes get tested before they go live.- The import templates (
bands_v1,matrix_v1) are published with the spec, so carriers can hand the same spreadsheet to every implementer. - Events:
rate_sheet.published,rate_sheet.retired,surcharge.updated,surcharge.schedule_updated,pricing_rule.created,pricing_rule.updated,pricing_rule.deleted.
simulate before it is published.