Skip to main content

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.

Not yet available to API tokens

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) and quantity (number > 0, required). Priced at the account's prices.
  • use_recent_order (boolean): when no items are 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​

OK

Response Headers
    Content-Type