Skip to content

Set Shipping Method

Select a shipping method for the order.

Endpoint

POST /api/shop/checkout/shipping-method

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Request Body

json
{
  "shippingMethodCode": "flatrate_flatrate",
  "shippingMethod": "flat_rate"
}

Request Parameters

ParameterTypeRequiredDescription
shippingMethodCodestringYesCode of the shipping method
shippingMethodstringYesShipping method type

Response Fields (200 OK)

FieldTypeDescription
shippingMethodobjectSelected shipping method details
cartTotaldecimalUpdated cart total with shipping
messagestringSuccess message

Shipping Method Fields

FieldTypeDescription
codestringShipping method code
methodstringShipping method type
titlestringDisplay name
pricedecimalShipping cost
carrierstringCarrier name

Use Cases

  • Select standard shipping
  • Choose express shipping
  • Apply overnight delivery
  • Calculate final total
  • Proceed to payment

Important Notes

  • Must set shipping address first
  • Different methods available per location
  • Cost varies by location and weight
  • Some methods may have time restrictions

Released under the MIT License.