Apply Quote Shipping Estimate
POST/api/quotes/:quote/shipping-estimates/:shippingEstimate/apply
Applies one rate from a recorded estimate to the quote: creates or replaces its "Shipping" revenue line (a product-less quote line with the Shipping line type, described as "<Carrier> <Service> (est.)", taxed at the quote's tax rate) and recalculates the quote totals. With record_only it records the cost only.
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Request body:
option_key(string, required, max 120): thekeyof one of the estimate's options, e.g.UPS|Ground.markup_type(string, nullable):percentorflat. Defaults to the account's default markup.markup_value(number, nullable, 0–100000): percent of the rate, or a flat amount added to it.charge_amount(number, nullable, 0–1000000): charge exactly this amount; wins over any markup.replace_quote_line_id(integer, nullable): the existing Shipping line to replace. When omitted, a quote with no Shipping line gets a new one, one with a single Shipping line has it replaced, and one with several is refused with 422 until you name one or sendadd_new.add_new(boolean): add a new Shipping line even when one exists.set_shipping_method(boolean): also set the shipping method to the account's method that matches this carrier and service, when one clearly does.record_only(boolean): record the rate as the shipping cost only, without adding a charge.
Response (data): quote_line (the line written, with its financial_line_type; null for record_only) and estimate (the updated estimate row).
Errors: 404 when the estimate does not belong to this quote; 422 when the quote is not editable, the option_key is unknown, the named line is not one of the quote's Shipping lines, or several Shipping lines exist and none was chosen.
Authentication: Requires Bearer token.
Requires permission: quotes.update
Request
Responses
- 200
- 401
- 403
- 404
- 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.
Not Found
Response Headers
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.