MobiariDocs

Select a freight option

POST
/storefront-api/{store_slug}/api/cart/freight/select

Applies one option of the cart's last quote to the cart; its price becomes the cart's shipping. An expired quote must be requoted.

Path Parameters

store_slug*string

Store slug

Header Parameters

x-cart-id?|

The shopper's cart; the cart_id cookie or body field works too

Formatuuid
Idempotency-Key?string

A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/storefront-api/string/api/cart/freight/select" \  -H "Content-Type: application/json" \  -d '{    "option_id": "string"  }'
{
  "cart_id": "b5b98de2-0f5f-4a68-b8c7-2aa7bb7683bb",
  "provider_code": "string",
  "quote_id": "3c071a1d-db86-46a7-9dc8-72ba3fbca992",
  "selected_option_id": "string",
  "shipping_cents": 0
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}