Read a cart
get_cartRead a cart: every part with its quote, the rules on it (constraints_asked), its pick (selection) and what the pick comes to — the shop, the price, the shipping speed and the arrival date — plus whether that option can be ordered right now (checkout.state: "ready"; "needs_check" = the shop has to confirm it first; "checking" = the shop is answering, read again shortly; "not_orderable" = pick another option; checkout.reason says why in a sentence and checkout.code says it as one word — on a "needs_check" part, "confirmation_lapsed" or "never_confirmed" mean reconfirm true will ask its one shop (and so will checkout_cart, by itself), "ask_limited" means the option is chosen and its shop is asked when the user pays, while "rechecking" (the part was copied from a shared cart and its shops are still being asked: read the cart again) and "shop_asks_off" (the network is not asking shops for this part right now) mean reconfirm true will start nothing for it). now is the network's own clock when the answer was made: work out the time left until checkout.confirmed_until from now, not from your own clock. by_shop groups the picked parts by the shop that makes them with subtotals and shipping, and total_cents is what the picked parts cost together. Parts with nothing picked are listed in unpicked_item_ids and are in no total. A plain read asks no shop. Pass reopen true when the user comes back to a cart: parts older than 24 hours are then asked about again, once, one part at a time (the answer's reopen says "asked", "none_needed", or "press_needed" — the old parts were already asked about again once and nothing was done to the cart since; pass pressed true only when the user asks for today's prices). picked.stale, picked.answered_at, picked.eta_days and picked.eta_approximate read as they do on an offer: when eta_approximate is true say "about N days", never the date. HOW LONG A PRICE HOLDS: a shop's confirmation of a picked option is good for 15 minutes. While it stands the part reads "ready" and checkout.confirmed_until says until when — tell the user the time they have. After it the part is NOT lost: it keeps its pick and its price and reads "needs_check" again. It is confirmed again by its one shop (nobody else is asked) when its option is chosen, and by checkout_cart itself when the user pays; reconfirm true on get_cart starts the same asks ahead of time — read the cart again and "ready" means the price stands. checkout.code "ask_limited" means the option is chosen and its shop will be asked when the user pays. When a part carries price_changed, the shop's answer moved the price or the arrival (direction "up", "down", or "same" when only the arrival moved) — tell the user the old and the new figure before they pay. checkout_cart stops ONCE by itself when the cart's total came back higher than the user agreed to (price_went_up). A part whose prices passed their 24-hour expiry is given a new quote by the read itself (quoted_anew true, price_source "instant"): it shows our instant prices again, its pick is kept, no shop was asked, and its shop confirms the pick when asked. SHIPPING IN A CART: by_shop[].shipping says how each shop's parts ship. mode "ships_separately" = each part is its own order with that shop and its own package, and pays its own shipping; mode "combined" = the shop takes those parts as ONE order and ships them together. Tell the user which it is, in the words of shipping.reason. Name a shipping saving ONLY when shipping.saved_cents is above zero, and only that amount — never promise or hint at a saving for buying several parts from one shop otherwise. When shipping.code is "speeds_differ", the parts of that shop are picked at different shipping speeds; you may tell the user that the shop sends parts together only at one speed, and read the cart again after they change a pick — do not state what it would save before the cart shows it. A SHARED CART: status "shared" means the cart came by a link and can only be read and copied. Never change it, pick on its parts' quotes, run check_offer on them or check it out — each of those is refused (cart_shared). Copy it with fork_cart and work on the copy, which is the user's own cart. A COPIED CART: copied true is present on a cart that was copied from a shared one; a cart never says which cart it was copied from. Each part's price_source says whose prices it shows: "shared" = recent shop prices that were copied with nobody asked — the prices of the person who shared the cart as they stood when it was copied, or the shops' own answers to this same part and request from the last 24 hours; "instant" = our instant prices, because the shared prices could not be copied (they were too old, or still coming in) — no shop has been asked about that part on this quote yet; "own" = this cart's own quote of the part, its shops asked. A pick that travelled with the cart but matches no option now reads selection_match.status "none": that part is still to choose. The buyer, the address, the email and any coupon never travel with a cart. PARTS OLDER THAN 24 HOURS: a shop's answer is shown for 24 hours. A cart copied with fork_cart inside them asks nobody: every part comes with its answers as they stand. A part whose answers are OLDER than 24 hours shows our instant prices first, and (unless the copy was for_link or recheck false) its shops are then asked about it again, one part at a time. Each such part's recheck says where it stands: "queued" = priced, its shops are asked when its turn comes; "asking" = its shops are being asked now; "done" = the shops' answers are in. A part with no recheck is under 24 hours old and nothing is pending for it. A part's quote_id CHANGES when its turn comes, so read quote_id off get_cart every time and never keep an old one. Until every such part reads done, tell the user the prices and dates may still move, and read the cart again; do not start a second copy to hurry it. A picked part goes first and its picked option is confirmed with its shop as part of it. HOW A CART WORKS: each part in a cart IS a quote — its material, finish, quantity, rules and its pick (selection) live on that part's quote, and nothing is kept twice. To change a part, call refine_quote on its quote_id and pass cart_item_id: the cart follows the part to the new quote by itself. To pick the option to order for a part, store the pick on its quote (refine_quote selection). The cart_id is the only key to the cart — whoever holds it can read and change it — so give it only to the user it belongs to, and never put it in a link you did not get from the network.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cart_id": "<cart_id>"
},
"name": "get_cart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reopen | No | true = the user came back to this cart: parts whose answers are older than 24 hours are asked about again, once, one part at a time (answers anyone got for the same part in the last 24 hours are copied first, and then nobody is asked). The only cart read that may ask every shop about a part. Leave it out for a plain look | |
| cart_id | Yes | The cart to read (cart_…) | |
| pressed | No | With reopen true: true = the user asked for today's prices. Needed only after an answer whose reopen read "press_needed" | |
| reconfirm | No | true = also have each picked part that reads "needs_check" confirmed by its one shop (nobody else is asked). The answer comes back at once with those parts "checking" — read the cart again for the result. Use it when the user opens the cart to pay; leave it out for a plain look |