Skip to main content
POST
https://api.firmly.work
/
api
/
v1
/
domains
/
{domain}
/
cart
/
shipping-method
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"}'
{
  "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": "[email protected]",
    "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
  }
}

Overview

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

Authentication

x-firmly-authorization
string
required
Device authentication token from browser session

Path Parameters

domain
string
required
Merchant domain (e.g., staging.luma.gift)

Request Body

shipping_method
string
required
Shipping method SKU from available options (e.g., standard_ground)

Response

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

Response Fields

Same as Get Cart response, with the selected shipping method reflected in pricing.
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"}'
{
  "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": "[email protected]",
    "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
  }
}

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