Get Staff Cart Margin (View as buyer only)
GET/api/portal/staff/margins/cart
Staff-only: the shared cart's margin at what the buyer would pay now, in its current order_mode (stock, or preorder on the catalogs' pre-order ladders), after every earned order-value discount, per cost basis, plus each line's. Same access rule as the products endpoint (403 to buyers). A line with no cost on a basis is left out of that basis and counted in missing_cost_lines. Margin = (price − cost) / price. average = FIFO average cost of stock on hand (what SKU books as COGS); replacement = the default supplier's price. A basis with no cost is null (never 0). When the tenant sets a replacement cost adjustment (Portal settings → Staff margin overlay, e.g. −15 "at special" for a merchant that only buys at the supplier's specials), replacement is the supplier price moved by it, bases.replacement names it, and replacement_adjustment = {percent, label} (null = none). A product with no FIFO cost (never stocked) shows the adjusted replacement figure as its headline. Special order list parts on the cart are counted in bases (net — no order-value discount touches them) and listed in special_order_lines, costed from the product an earlier order created or else from the list's staff-only cost.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
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.