Preview Portal Shipping
POST/api/admin/portal/shipping/preview
Price a sample cart for one portal account with the saved shipping settings, showing every method's price, or why it is hidden, and the arithmetic behind it. Nothing is saved. Rate limited to 60 requests per minute.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Request body:
customer_id(integer, required): the portal account.items(array, max 200, nullable): the sample cart —product_id(integer, required) andquantity(number > 0, required). Priced at the account's prices.use_recent_order(boolean): when noitemsare sent, use the account's most recent order as the cart.ship_to(object, nullable):name,address1,city,province,province_code,zip,country_code. Defaults to the account's default shipping address (or the recent order's ship-to).
Response (data): customer, cart (source items or recent_order with sales_order_id / order_number, subtotal, currency, units, lines), destination, free_shipping (threshold, remaining, met, account_free; null when no threshold applies) and methods[]: shipping_method_id, name, configured_mode, mode (what applies to this cart — a failed live rate takes the fallback's mode), amount (null for on review), currency, label (Free, Calculated on review, Estimated or null), is_estimate, delivery days, hidden / hidden_reason, fallback_reason, free_reason, trace[] (step, label, amount, total), summary, carrier_cost, option_key and unconfigured. Buyers never see trace, summary, carrier_cost or option_key.
Errors: 422 when the account does not exist or there is no cart to price.
Authentication: Requires Bearer token (staff) with portal management access.
Request
Responses
- 200
- 401
- 403
- 422
- 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.
Unprocessable Content
Response Headers
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.