Skip to main content

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.

Not yet available to API tokens

This endpoint currently requires session authentication; Personal Access Token scope support is in progress.

Request​

Responses​

OK

Response Headers
    Content-Type
    Cache-Control