Add a line to a resolved cart (one created with lineResolver). Only the
item, quantity and metadata are sent; the app sets the name, price and
image. A refusal throws QuantityUnavailableError,
LineNotPurchasableError or LineResolverUnavailableError.
Hand off to hosted/embedded checkout. Marks the session converted (no more edits).
Create a new cart session and bind this client to it.
Read the current session + cart snapshot.
The Throttle-hosted cart page for this session. Send a buyer here to let Throttle run the cart UI instead of building one.
Ask the app that prices a resolved cart to re-check every line it owns.
changed is true when a price, name or refusal changed. An unresolved
cart comes back unchanged. Throws LineResolverUnavailableError (nothing
changed) when the app does not answer.
Bind to an existing session id — e.g. one restored from localStorage.
Pick a shipping method on a resolved cart. Throttle quotes the amount, so
only methodId is sent. A method Throttle does not quote for the cart
(it needs a shipping address first) throws ShippingMethodUnavailableError;
a failed quote throws ShippingQuoteUnavailableError.
Unit count + total for a cart badge, without pulling the whole cart.
Works on a client built with CartSessionClient.forSession — a
storefront that restored a cart_… id from localStorage and holds no
publishable token in the browser.
Set buyer-editable cart fields. Pass null to clear one.
StaticforBind to an existing session without a publishable token.
create() needs a quote token; every other route is authorized by the
opaque cart_… id alone. A caller that only ever resumes — Throttle's own
hosted cart page, or a storefront restoring from localStorage — would
otherwise have to invent a token to satisfy the constructor.
OptionalbaseUrl?: stringOptionalfetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>Optionalorigin?: stringOptionaltimeoutMs?: number
The current bound session id (after
create()/resume()), or null.