stage 1 of 6 · try of as-shipped

quote-at-checkout

right

The cheapest Tern price for a cart, in pence, for checkout (needs from the docs: D1 grams, D2 current endpoint)

Made
28 Nov 2026, 20:29 UTC
Model
claude-sonnet-5-5
Steps
7
Tool calls
5
Friction
3 flagged steps
Tokens read
157k
Time
19s
Cost
$0.11
Address
tern-docs/try/20261128-2029-yseu/quote-at-checkout
1quote-at-checkoutright2quote-optionsright3book-shipmentright4sync-shipmentsright5order-statusright6cancel-before-pickupright
This is the backend of Larkspur Tea, a small online tea shop. We ship with Tern, a parcel carrier. Tern's API documentation is at http://localhost:8080/ and Tern's sandbox API is running at http://localhost:8081 (the test key is already in `shop/settings.py`). Implement `quote_at_checkout` in `shop/shipping.py`: checkout needs to show the cheapest price Tern offers to ship the cart from our warehouse to the customer's postcode, in pence. Keep the shop's existing tests passing; add your own if you like.