Carts
The carts the visitors of the website are filling, a guest's or a signed-in customer's, read as they are: their status, their totals and the order a checked-out one became. Read only: a cart is its visitor's to change.
List carts
Lists the website's carts — every status — the most recently changed first, without their lines. filter takes status (status = "ACTIVE"), customer_id and update_time; order_by takes update_time.
path Parameters
website_idId of the parent website.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: update_time desc. Sortable: update_time.
filterAIP-160 subset (§8). Filterable: customer_id, status, update_time. A field outside the list is INVALID_ARGUMENT.
List carts › Responses
One page of carts.
This page of carts, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Get cart
A cart a visitor of the website is filling — a guest's, or a signed-in customer's — read as it is: its status, its totals and, a page at a time, its lines. Its visitor changes it on the engine API; here it is only read, and reading it changes nothing. A cart nobody changes is deleted when it expires.
path Parameters
website_idId of the parent website.
cart_idId of the parent cart.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get cart › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
statusACTIVE while its visitor fills it; CONVERTED once its checkout made an order of it (order_id); MERGED when it was a guest's whose lines went into their customer account's cart on signing in.
customer_idThe website's customer whose cart it is; absent on a guest's. A customer has one ACTIVE cart at most.
view_idThe view of the website the cart is on — the one its visitor last shopped on: its prices are that view's, in the currency of its market.
market_idThe market of the cart's view — websites/{website}/catalog_markets/{market_id} — empty when the view names none. Read when the cart is made on the view or moved to it, and whenever every line is priced: a view put on another market reaches the cart at its next such reprice, at its checkout at the latest.
currency_codeThe currency of every price of the cart: its market's, read with market_id.
shipping_destinationWhere its visitor said the cart's goods go — at the checkout, its shipping address: {country_code, region?, city?, postal_code?}, the country ISO 3166-1 alpha-2, the region a code of the country's list where it has one, a part not given left out. The cart is taxed by its country; absent, by the first country of its market — a market without countries then taxes nothing.
prices_include_taxWhether the cart's prices hold the tax already: the mode of its market when the tax was last worked out. False, the tax comes on top of them.
group_idsThe customer groups the cart's prices were last resolved for — its customer's then; empty on a guest's.
line_countHow many lines the cart holds — one per variant, at most 5000. The lines are read a page at a time from carts/{cart}/lines.
subtotalWhat the lines come to: the sum of their line_total, a google.type.Money in the cart's currency.
shipping_requiredWhether the website shipped what it sells when the cart was last written: a shipping provider of it was on and ready.
shipping_methodsThe ways to ship the cart was offered at its last write for its destination and lines, in the order its visitor saw them: [{code, provider, display_name, description?, amount, delivery_days_min?, delivery_days_max?}], amount a google.type.Money in the cart's currency, the names in the language of its view. Empty without a destination, without a line, or where nothing ships.
shipping_methodThe code of the way to ship chosen, one of shipping_methods: the one its visitor chose while it is offered, else the first. Absent without an offer.
shipping_totalWhat the way to ship chosen costs, a google.type.Money in total; its tax is in tax_lines and tax_total. Absent without a way chosen.
tax_linesThe tax of the lines and of the shipping by name and rate, the highest rate first: [{display_name, rate, amount}], rate a percentage as a decimal string. Empty when nothing is taxed.
tax_totalThe tax of the cart: the sum of its lines' tax_amount and of its shipping's tax, a google.type.Money, zero when nothing is taxed.
totalWhat the cart costs: subtotal + shipping_total + tax_total while the tax comes on top of the prices, subtotal + shipping_total while they hold it.
repriced_atWhen every line of the cart was last priced at once. Reading a cart here prices nothing: a line's own priced_at says when its price was resolved.
order_idThe order a CONVERTED cart became, websites/{website}/orders/{order_id}.
expire_timeWhen the cart is deleted unless it changes before: 30 days past its last change for a guest's, 90 for a customer's.