Skip to content

Get Shipping Methods

Retrieve available shipping methods based on address and cart contents.

Endpoint

GET /api/shop/checkout-shipping-methods

Listing the rates is a GET with no body. The same path also accepts a POST, but that is the setter — see Set Shipping Method. A POST sent here without a shippingMethod fails.

Request Headers

HeaderRequiredDescription
AcceptYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesThe cart's own token as a Bearer token, or a logged-in customer's token.

The destination is taken from the address already saved on the cart. There is no way to quote rates for an arbitrary country, state, or postcode — those are not request parameters.

Response Fields (200 OK)

A bare array of rates.

FieldTypeDescription
idstringRate identifier, e.g. flatrate_flatrate_flatrate.
methodstringThe value to send to Set Shipping Method, e.g. flatrate_flatrate. Note it differs from id.
codestringShort carrier code.
label / methodTitlestringDisplay name for the rate.
description / methodDescriptionstringDescription shown alongside it.
price / basePricenumberRate cost, in cart and base currency.
formattedPrice / baseFormattedPricestringThe same amounts, currency-formatted.
carrier / carrierTitlestringCarrier the rate belongs to.

There is no delivery estimate — the payload carries no estimatedDays or delivery date.

Use Cases

  • Shipping step of checkout — call after the address is saved and render one radio option per rate, using formattedPrice for the label.
  • Show "free shipping" when it qualifies — free-shipping rules surface as an ordinary rate with a price of 0, so nothing special is needed to detect them.

Best Practices

  • Save the address first — with none on the cart the response is [], which reads as "no carriers available" rather than "step out of order".
  • Send method, not id, to the setter — the two look similar and the id value is rejected.
  • Re-fetch after changing the address — rates depend on the destination and are not recalculated on the client.
  • Treat an empty array as a blocked checkout — the order cannot be placed until a shipping method is set for a cart with shippable items.

Released under the MIT License.