Skip to main content

Get Fulfillment Order Label Rates

POST 

/api/fulfillment-orders/:fulfillmentOrder/label-rates

Rate-shops one fulfillment order for a shipping label: every connected label account (EasyPost, Shippo, ShipStation, Starshipit, ShipRush, Shiptheory, Shippit) plus the order's marketplace label program — Ship with Walmart for a Walmart order, Amazon Buy Shipping for an Amazon order — when its store offers its own labels. Nothing is bought. Pick one of the rates and send it to Buy Fulfillment Order Label.

Required scope: orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Behind the scenes the order goes into a one-order label batch (source = single, hidden from List Label Batches), so the account's label batch defaults apply: the package, ship date, label format, marketplace_labels and amazon_prefer_protected from the shipping label settings. Calling it again re-uses that batch and re-rates.

Body (all optional; the shipping label settings fill the rest):

  • package (object; package.mode required when sent): mode from_products (weigh the order's products, plus tare_weight) or fixed; preset_id (max 64), name (max 120); length, width, height (> 0, max 1000) and dimension_unit (in, cm; unit is accepted as an alias); weight (> 0, max 5000; required when mode=fixed) and weight_unit (lb, oz, kg, g); tare_weight (0-5000).
  • ship_date (Y-m-d): today up to 6 days ahead.
  • label_format: pdf or zpl.

Response data:

  • shipping_label_batch_id and item_id: the one-order batch and its row. Send item_id to Buy Fulfillment Order Label; print or void the bought label with the label batch item endpoints.
  • rates[], cheapest first (a tie lists the marketplace rate first): integration_instance_id, integration_instance_name, provider, provider_label, is_marketplace, service_token, service_name, carrier, amount, currency, delivery_days, benefits (e.g. claims_protected = Amazon A-to-z claim protection), excluded_benefits (each {benefit, reasons}) and is_test.
  • recommended_rate (or null): the rate the label batch rules would pick — service_token, provider, integration_instance_id and reason (cheapest, fixed_service, prefer_marketplace or prefer_protected).
  • unavailable[]: label programs and accounts that offered no rate, each with provider, provider_label, integration_instance_id (null for a program the order is not on) and reason.
  • rule: the marketplace label rule the rates were picked under — include (marketplace rates compete on price), prefer (a marketplace rate wins when one is offered) or exclude (no marketplace rates).
  • protected_only (boolean): true when the rule is prefer and only A-to-z protected Amazon rates are preferred (amazon_prefer_protected).

422 (with errors.<field>) when the order cannot be rated: it is not open or not shipped from your own warehouse, it is already in a label batch, it already has a label bought here (void it first) or a purchase is still finishing, the ship-from or ship-to address is incomplete, it is international, a product has no weight, no label account is connected and no marketplace label is available, or every provider failed (errors.rates carries their messages). Validation errors for the body also return 422.

Requires the orders write scope and the fulfillment_orders.index and fulfillment_orders.ship permissions.

Request​

Responses​

OK

Response Headers
    Content-Type