Get Cart
GET/api/portal/cart
Return the active account's cart, re-priced and re-validated. Each line reports its current unit price, line total, availability, and any warnings; the cart reports subtotal and minimum-order-value progress.
Called by a B2B portal buyer with the bearer token POST /api/portal/auth/login returns (or the buyer's feed key) — not with a staff Personal Access Token.
Each warning is an object: code (price_changed, backordered, insufficient_stock, out_of_stock), message (a ready-to-display sentence, which for the stock codes names the quantity actually available), and blocks_checkout (true for insufficient_stock and out_of_stock — those lines are rejected by Submit Checkout until the quantity is reduced).
subtotal is always the pre-discount goods total. When the account has an order-value discount ladder, order_discount reports the tier earned at that subtotal (percent/amount/min_subtotal, all null below the first tier) and the next tier up (next_percent/next_min_subtotal/next_remaining, all null at the top of the ladder). total is subtotal less amount — what the buyer pays before tax and shipping, and equal to subtotal when no ladder applies.
A line with excluded_from_order_discount: true is net-priced (the product's portal_exclude_from_order_discount flag): it counts toward the ladder's threshold, but the discount is taken only from the other lines. discountable_subtotal (also inside order_discount) is the part of subtotal the percentage applies to, and equals subtotal when no line is net-priced. At checkout the discount is then written as line-scope discounts on the eligible order lines instead of one order-scope discount.
Per-catalog discounts (since 2026-10-13). Each line carries portal_catalog ({id, name} or null): the ONE of the account's catalogs it is attributed to (a catalog naming the product beats a brand/category match, then the lowest catalog id). catalog_discounts lists one entry per catalog with its own order-value ladder that has lines on the cart: subtotal is that catalog's lines only and is what its thresholds measure; percent/amount come off those lines only (net-priced lines count but are not discounted); next_* nudge toward its next tier; ladder_source is catalog or account (this account's override). Lines a catalog ladder governs take no part of order_discount.amount, whose threshold still measures the whole cart. discount_total sums every order-value discount, and total = subtotal − discount_total. The same discounts are written onto the sales order at checkout, and frozen for orders that go through approval.
Pre-order mode (2026-10-13). order_mode is stock or preorder (see Set Cart Mode); preorder_available / preorder (ship window lead_time_label such as "~3–6 months", and each catalog's pre-order steps) are present when a catalog offers pre-order pricing. Line availability carries lead_time_max_days and lead_time_label (a lead-time range).
Product lifecycle: every line warning also carries discontinued (true when the shortfall cannot be backordered because the product's lifecycle state blocks backorders) and successor (id, sku, name of the replacement product visible to this buyer, or null). Such a line gets insufficient_stock ("Only 5 left. This item has been discontinued.") or out_of_stock ("Sold out. This item has been discontinued."; "This item is no longer restocked." for other states that block backorders), and both block checkout. The cart is re-checked every time it is read, so a cart saved before the product was discontinued explains itself.
Request
Responses
- 200
- 401
- 403
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.