> ## Documentation Index
> Fetch the complete documentation index at: https://developers.firmly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Shipping Method

> Sets the shipping method for the order

## Overview

Sets the shipping method for the cart. You must set shipping information first to get available shipping methods.

## Authentication

<Card>
  <ParamField header="x-firmly-authorization" type="string" required>
    Device authentication token from browser session
  </ParamField>
</Card>

## Path Parameters

<ParamField path="domain" type="string" required>
  Merchant domain (e.g., `staging.luma.gift`)
</ParamField>

## Request Body

<ParamField body="shipping_method" type="string" required>
  Shipping method SKU from available options (e.g., `standard_ground`)
</ParamField>

## Response

Returns the cart with the selected shipping method and updated pricing.

### Response Fields

Same as [Get Cart](/api-reference/simple-cart-api/cart/get-cart#response-fields) response, with the selected shipping method reflected in pricing.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/shipping-method \
    --header 'x-firmly-authorization: YOUR_TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{"shipping_method": "express_2day"}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/shipping-method', {
    method: 'POST',
    headers: {
      'x-firmly-authorization': 'YOUR_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      shipping_method: 'express_2day'
    })
  });

  const cart = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/shipping-method',
      headers={
          'x-firmly-authorization': 'YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'shipping_method': 'express_2day'
      }
  )

  cart = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "cart_id": "1e43868c-d4a5-418c-bd6b-5fff043550d2",
    "platform_id": "example",
    "shop_id": "staging.luma.gift",
    "display_name": "Luma Store",
    "line_items": [
      {
        "line_item_id": "1ee530e1-063d-4e07-afb2-e7e65245977e",
        "sku": "WS12-XS-Orange",
        "quantity": 1,
        "description": "Radiant Tee - Orange XS",
        "price": {
          "currency": "USD",
          "value": 22.00,
          "symbol": "$",
          "number": 2200
        },
        "line_price": {
          "currency": "USD",
          "value": 22.00,
          "symbol": "$",
          "number": 2200
        }
      }
    ],
    "shipping_info": {
      "first_name": "John",
      "last_name": "Smith",
      "email": "john@staging.luma.gift",
      "address1": "123 Main St",
      "city": "Seattle",
      "postal_code": "98101",
      "state_or_province": "Washington",
      "country": "United States"
    },
    "shipping_method": {
      "sku": "express_2day",
      "description": "Express 2-Day",
      "price": {
        "currency": "USD",
        "value": 19.99,
        "symbol": "$",
        "number": 1999
      }
    },
    "sub_total": {
      "currency": "USD",
      "value": 869.99,
      "symbol": "$",
      "number": 86999
    },
    "shipping_total": {
      "currency": "USD",
      "value": 19.99,
      "symbol": "$",
      "number": 1999
    },
    "tax": {
      "currency": "USD",
      "value": 4.40,
      "symbol": "$",
      "number": 440
    },
    "total": {
      "currency": "USD",
      "value": 46.39,
      "symbol": "$",
      "number": 4639
    }
  }
  ```
</ResponseExample>

## Error Responses

### 400 Bad Request

* Missing or invalid authentication header
* Invalid shipping method

### 404 Not Found

Cart not found

### 412 Precondition Failed

* Shipping information must be set first
* Cart must have at least one item
