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

# Set Shipping Info

> Sets the shipping address and gets available shipping methods

## Overview

Sets the shipping address for the cart and automatically retrieves available shipping methods. If no shipping method was previously selected, the lowest cost option is automatically selected.

## Authentication

> [card]
>
> **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

**first\_name** `string` *required*

Customer's first name

**last\_name** `string` *required*

Customer's last name

**email** `string` *required*

Customer's email address

**phone** `string`

Customer's phone number (required by some merchants)

**address1** `string` *required*

Street address line 1

**address2** `string`

Street address line 2 (apartment, suite, etc.)

**city** `string` *required*

Shipping city

**postal\_code** `string` *required*

Postal/ZIP code

**state\_or\_province** `string` *required*

State or province

**country** `string` *required*

Country name (e.g., "United States")

## Response

Returns the cart with shipping information and available shipping methods.

### Response Fields

Same as [Get Cart](https://firmly.mintlify.site/api-reference/simple-cart-api/cart/get-cart.md#response-fields) response, plus:

**shipping\_info** `object`

The shipping address that was set

**shipping\_method** `object`

The selected shipping method (auto-selected if none was previously set)

**shipping\_method\_options** `array`

Available shipping methods for the given address

**Shipping Method Object**

**sku** `string`

Shipping method identifier

**description** `string`

Shipping method description

**price** `object`

Shipping cost

**estimated\_days** `number`

Estimated delivery days

```bash cURL theme={null}
curl --request POST \
  --url https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/shipping-info \
  --header 'x-firmly-authorization: YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "first_name": "John",
    "last_name": "Smith",
    "email": "john@staging.luma.gift",
    "phone": "(555) 123-4567",
    "address1": "123 Main St",
    "city": "Seattle",
    "postal_code": "98101",
    "state_or_province": "Washington",
    "country": "United States"
  }'
```

```javascript JavaScript theme={null}
const response = await fetch('https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/shipping-info', {
  method: 'POST',
  headers: {
    'x-firmly-authorization': 'YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    first_name: "John",
    last_name: "Smith",
    email: "john@staging.luma.gift",
    phone: "(555) 123-4567",
    address1: "123 Main St",
    city: "Seattle",
    postal_code: "98101",
    state_or_province: "Washington",
    country: "United States"
  })
});

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-info',
    headers={
        'x-firmly-authorization': 'YOUR_TOKEN',
        'Content-Type': 'application/json'
    },
    json={
        'first_name': 'John',
        'last_name': 'Smith',
        'email': 'john@staging.luma.gift',
        'phone': '(555) 123-4567',
        'address1': '123 Main St',
        'city': 'Seattle',
        'postal_code': '98101',
        'state_or_province': 'Washington',
        'country': 'United States'
    }
)

cart = response.json()
```

```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
      },
      "requires_shipping": true
    }
  ],
  "shipping_info": {
    "first_name": "John",
    "last_name": "Smith",
    "email": "john@staging.luma.gift",
    "phone": "(555) 123-4567",
    "address1": "123 Main St",
    "city": "Seattle",
    "postal_code": "98101",
    "state_or_province": "Washington",
    "country": "United States"
  },
  "shipping_method": {
    "sku": "standard_ground",
    "description": "Standard Ground (5-7 business days)",
    "price": {
      "currency": "USD",
      "value": 0,
      "symbol": "$",
      "number": 0
    }
  },
  "shipping_method_options": [
    {
      "sku": "standard_ground",
      "description": "Standard Ground (5-7 business days)",
      "price": {
        "currency": "USD",
        "value": 0,
        "symbol": "$",
        "number": 0
      },
      "estimated_days": 7
    },
    {
      "sku": "express_2day",
      "description": "Express 2-Day",
      "price": {
        "currency": "USD",
        "value": 19.99,
        "symbol": "$",
        "number": 1999
      },
      "estimated_days": 2
    }
  ],
  "sub_total": {
    "currency": "USD",
    "value": 869.99,
    "symbol": "$",
    "number": 86999
  },
  "shipping_total": {
    "currency": "USD",
    "value": 0,
    "symbol": "$",
    "number": 0
  },
  "tax": {
    "currency": "USD",
    "value": 2.20,
    "symbol": "$",
    "number": 220
  },
  "fees": [
    {
      "description": "Recycle fee",
      "currency": "USD",
      "value": 2.00,
      "symbol": "$",
      "number": 200
    }
  ],
  "fee_total": {
    "currency": "USD",
    "value": 2.00,
    "symbol": "$",
    "number": 200
  },
  "total": {
    "currency": "USD",
    "value": 26.20,
    "symbol": "$",
    "number": 2620
  },
  "payment_method_options": [
    {
      "type": "CreditCard",
      "wallet": "user"
    }
  ]
}
```

## Error Responses

### 400 Bad Request

* Missing or invalid authentication header
* No items in cart that require shipping
* Invalid email format
* Invalid state for the given country

### 404 Not Found

Cart not found

### 412 Precondition Failed

Country not supported by merchant


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.