create_cart starts one, update_cart fills it.
Creating a cart
create_cart returns an empty cart. The id in the response (prefixed ses_) is the session id used for every subsequent call.
Updating the cart
update_cart replaces the entire cart. It clears the merchant cart first, then adds each line in order. An empty line_items array just clears.
A failed add stops the call. Each add has a 90-second server-side deadline.
Reading the cart
get_cart reads the live merchant cart. Returns line_items with per-line and cart-level totals (subtotal and total, in minor units of currency).
available: false and a zero price. Remove it before checkout.
Cancelling
cancel_cart returns the cart as last stored and releases the browser. The session ends as abandoned.
Browser lifecycle
Each cart keeps one browser across all cart and checkout calls. If the browser is released (timeout, infrastructure), the next call opens a new one. The response includesbrowser_released: true. The new browser may be signed out or have a different merchant cart. Call get_cart to check.