Find the Cheapest Rate, Then Buy the Label
Rate shop one order and buy the cheapest label, rehearsed first.
Use this recipe when you want the lowest rate for one order and a label to match, and you want to see the choice before anything is charged. It runs the same job three ways: a rehearsal, the live agent, and the direct commands for when you already have request bodies.
Rehearse first, nothing is bought
bash
postsale run --dry-run "Rate shop order <ord_id> and prepare the cheapest label"Inspect envelope simulated_effects and any real confirmed_effects.
Buy the label, which charges your carrier account
bash
postsale run "ship order <ord_id> with the cheapest carrier" --yesThe same job with direct commands
bash
postsale shipments get-rates --input rates.json
postsale orders create-shipment <ord_id> --yes
postsale labels purchase --shipment-id <shipment_id> --yesAdditional Reading
- Rates, Shipments, and Labels
- Intent builders: what the agent fills in for you
- Safety Model
- Ship One Order
On this page
Related