> ## 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.

# Get Cart

> Retrieves the current state of a shopping cart with all line items, shipments, pricing, and addon information

## Overview

The Get Cart endpoint retrieves the complete current state of a shopping cart, including:

* All line items with product details and quantities
* Multiple shipments with items grouped by fulfillment requirements
* Complete pricing breakdown (subtotal, shipping, tax, addons, total)
* Available addon offers and current selections
* Cart-level metadata and schema version

## Authentication

> [card]
>
> **x-firmly-authorization** `string` *required*
>
> Device authentication token to identify and map the session

## Path Parameters

**domain** `string` *required*

Domain of the merchant website (e.g., `staging.luma.gift`)

## Response

**cart\_id** `string`

Unique identifier for the shopping cart session

**platform\_id** `string`

Platform identifier (e.g., "shopify", "bigcommerce", "magento")

**shop\_id** `string`

Shop identifier (merchant domain, e.g., "staging.luma.gift")

**display\_name** `string`

Merchant display name

**cart\_status** `string`

Current cart status (e.g., "active")

**line\_items** `array`

Array of products currently in the cart

**Line Item Properties**

**line\_item\_id** `string`

Unique identifier for the line item

**platform\_line\_item\_id** `string`

Platform-specific line item identifier

**sku** `string`

Product SKU identifier

**variant\_description** `string`

Variant-specific description

**description** `string`

Product description

**base\_sku** `string`

Base product SKU (parent of variants)

**quantity** `number`

Quantity of the item in cart

**price** `object`

Unit price information

**currency** `string`

Currency code (e.g., USD)

**value** `number`

Price as decimal

**number** `number`

Price in smallest currency unit

**symbol** `string`

Currency symbol

**line\_price** `object`

Total price for this line (price × quantity)

**currency** `string`

Currency code (e.g., USD)

**value** `number`

Price as decimal

**number** `number`

Price in smallest currency unit

**symbol** `string`

Currency symbol

**msrp** `object`

Manufacturer's suggested retail price

**currency** `string`

Currency code (e.g., USD)

**value** `number`

Price as decimal

**number** `number`

Price in smallest currency unit

**symbol** `string`

Currency symbol

**image** `object`

Product image information

**src** `string`

Image URL

**alt** `string`

Alternative text

**requires\_shipping** `boolean`

Whether this item requires physical shipping

**shipments** `array`

Array of shipment groups, each containing line items with similar fulfillment requirements

**Shipment Properties**

**shipment\_id** `string`

Unique identifier for the shipment

**line\_item\_ids** `array`

Array of line item IDs included in this shipment

**fulfillment\_type** `object`

Selected fulfillment method (automatically set to default)

**id** `string`

Fulfillment type identifier (e.g., SHIP\_TO\_ADDRESS, SCHEDULED\_DELIVERY, IN\_STORE\_PICKUP)

**name** `string`

Display name

**description** `string`

Detailed description

**fulfillment\_type\_options** `array`

Available fulfillment types for this shipment

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

Available shipping methods for the selected fulfillment type

**shipping\_method** `object`

Selected shipping method (defaults to cheapest available option)

**id** `string`

Shipping method identifier

**description** `string`

Shipping method description

**price** `object`

Shipping cost

**estimated\_delivery** `string`

Delivery timeframe

**notes** `string`

Special instructions or notes for this shipment

**selected\_date** `string`

Selected delivery date for scheduled delivery (YYYY-MM-DD format)

**addons** `object`

Available addon services and current selections

**Addon Properties**

**offers** `array`

Available addon options

**addon\_id** `string`

Unique addon identifier

**display** `object`

Display information

**scope** `string`

Addon scope (CART or ITEM)

**price** `object`

Addon price

**selections** `array`

Currently selected addons

**sub\_total** `object`

Subtotal of all line items

**shipping\_total** `object`

Total shipping cost across all shipments

**tax\_total** `object`

Total tax amount

**addon\_total** `object`

Total cost of selected addons

**fees** `array`

Merchant-imposed fees (e.g. recycle, regulatory), if any

**Fee Properties**

**description** `string`

Human-readable label for the fee (e.g., "Recycle fee")

**value** `number`

Decimal fee amount

**currency** `string`

Currency code (e.g., USD)

**number** `number`

Value in smallest currency unit

**symbol** `string`

Currency symbol

**fee\_total** `object`

Total of all fees

**total** `object`

Grand total including all costs

**shipping\_info** `object`

Shipping address information (when address is set)

**Shipping Info Properties**

**first\_name** `string`

Recipient's first name

**last\_name** `string`

Recipient's last name

**email** `string`

Recipient's email address

**phone** `string`

Recipient's phone number

**company** `string`

Company name (optional)

**address\_line\_1** `string`

Street address line 1

**address\_line\_2** `string`

Street address line 2 (optional)

**city** `string`

City name

**state\_code** `string`

State/province code

**zip** `string`

ZIP/postal code

**country\_code** `string`

Country code (e.g., US, CA)

**payment\_handle** `string`

Payment handle identifier (when payment is configured)

**payment\_method\_options** `array`

Available payment methods for checkout

**Payment Method Object**

**type** `string`

Payment method type (e.g., "CreditCard", "PayPal")

**wallet** `string`

Wallet identifier (e.g., "user", "paypal")

**notices** `array`

Cart notices providing information about cart state and issues

**Notice Properties**

**code** `string`

Notice code identifier

**Available Codes**

* `ITEM_NOT_SHIPPABLE` - Item cannot be shipped to selected address
* `ITEM_OUT_OF_STOCK` - Item is out of stock
* `PROMO_EXPIRED` - Promotion code has expired
* `PROMO_NOT_APPLICABLE` - Promotion doesn't apply to cart
* `SHIPPING_NOT_AVAILABLE` - Shipping method unavailable
* `PRICE_INCREASED` - Item price has increased
* `PRICE_DECREASED` - Item price has decreased

**severity** `string`

Notice severity level: `info`, `warning`, or `error`

**item\_id** `string`

Line item ID if notice is item-specific

**details** `object`

Additional notice details

**Details Properties**

**description** `string`

Detailed description of the notice

**promo\_code** `string`

Affected promo code (for promo-related notices)

**old\_value** `object`

Previous price (for price change notices)

**new\_value** `object`

New price (for price change notices)

**reason** `string`

Reason for the notice

**schema\_version** `string`

Cart schema version ("2.0")

## Code Examples

```bash cURL theme={null}
curl --request GET \
  --url https://api.firmly.work/api/v2/domains/staging.luma.gift/cart \
  --header 'x-firmly-authorization: YOUR_TOKEN'
```

```javascript JavaScript theme={null}
const response = await fetch('https://api.firmly.work/api/v2/domains/staging.luma.gift/cart', {
  method: 'GET',
  headers: {
    'x-firmly-authorization': 'YOUR_TOKEN'
  }
});

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

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

response = requests.get(
    'https://api.firmly.work/api/v2/domains/staging.luma.gift/cart',
    headers={
        'x-firmly-authorization': 'YOUR_TOKEN'
    }
)

cart = response.json()
print(cart)
```

```php PHP theme={null}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.firmly.work/api/v2/domains/staging.luma.gift/cart",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "x-firmly-authorization: YOUR_TOKEN"
  ],
]);

$response = curl_exec($curl);
curl_close($curl);

$cart = json_decode($response, true);
print_r($cart);
?>
```

```json theme={null}
{
  "cart_id": "cart_01H2XVBR8C8JS5MQSFPJ8HF9SA",
  "platform_id": "shopify",
  "shop_id": "staging.luma.gift",
  "display_name": "Luma Store",
  "cart_status": "active",
  "line_items": [
    {
      "line_item_id": "item_01H2XVBR8C8JS5MQSFPJ8HF9SB",
      "platform_line_item_id": "0",
      "sku": "MH07-XS-Gray",
      "variant_description": "Gray / XS",
      "description": "Hero Hoodie",
      "base_sku": "MH07",
      "quantity": 1,
      "price": {
        "currency": "USD",
        "value": 54.00,
        "number": 5400,
        "symbol": "$"
      },
      "line_price": {
        "currency": "USD",
        "value": 54.00,
        "number": 5400,
        "symbol": "$"
      },
      "msrp": {
        "currency": "USD",
        "value": 64.00,
        "number": 6400,
        "symbol": "$"
      },
      "image": {
        "src": "https://staging.luma.gift/images/hero-hoodie.jpg",
        "alt": "Hero Hoodie in Gray"
      },
      "requires_shipping": true
    }
  ],
  "shipments": [
    {
      "shipment_id": "ship_01H2XVBR8C8JS5MQSFPJ8HF9SD",
      "line_item_ids": ["item_01H2XVBR8C8JS5MQSFPJ8HF9SB"],
      "fulfillment_type": {
        "id": "SCHEDULED_DELIVERY",
        "name": "Scheduled Delivery",
        "description": "White glove delivery with scheduled time"
      },
      "fulfillment_type_options": [
        {
          "id": "SHIP_TO_ADDRESS",
          "name": "Ship to Address",
          "description": "Standard shipping to customer address"
        },
        {
          "id": "SCHEDULED_DELIVERY",
          "name": "Scheduled Delivery",
          "description": "White glove delivery with scheduled time"
        },
        {
          "id": "IN_STORE_PICKUP",
          "name": "In-Store Pickup",
          "description": "Pick up at store location"
        }
      ],
      "shipping_method_options": [
        {
          "id": "WHITE_GLOVE",
          "description": "White Glove Delivery Service",
          "price": {
            "currency": "USD",
            "value": 149.99,
            "number": 14999,
            "symbol": "$"
          },
          "estimated_delivery": "Scheduled delivery"
        }
      ],
      "shipping_method": {
        "id": "WHITE_GLOVE",
        "description": "White Glove Delivery Service",
        "price": {
          "currency": "USD",
          "value": 149.99,
          "number": 14999,
          "symbol": "$"
        },
        "estimated_delivery": "Scheduled delivery"
      },
      "notes": "",
      "selected_date": "2025-07-14",
    }
  ],
  "addons": {
    "offers": [
      {
        "addon_id": "shipping_protection",
        "display": {
          "name": "Shipping Protection",
          "description": "Protect your order against shipping damage"
        },
        "scope": "CART",
        "price": {
          "currency": "USD",
          "value": 12.99,
          "number": 1299,
          "symbol": "$"
        }
      }
    ],
    "selections": []
  },
  "sub_total": {
    "currency": "USD",
    "value": 54.00,
    "number": 5400,
    "symbol": "$"
  },
  "shipping_total": {
    "currency": "USD",
    "value": 149.99,
    "number": 14999,
    "symbol": "$"
  },
  "tax_total": {
    "currency": "USD",
    "value": 5.40,
    "number": 540,
    "symbol": "$"
  },
  "addon_total": {
    "currency": "USD",
    "value": 0.00,
    "number": 0,
    "symbol": "$"
  },
  "fees": [
    {
      "description": "Recycle fee",
      "currency": "USD",
      "value": 2.00,
      "number": 200,
      "symbol": "$"
    }
  ],
  "fee_total": {
    "currency": "USD",
    "value": 2.00,
    "number": 200,
    "symbol": "$"
  },
  "total": {
    "currency": "USD",
    "value": 211.39,
    "number": 21139,
    "symbol": "$"
  },
  "shipping_info": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@staging.luma.gift",
    "phone": "+1234567890",
    "company": "",
    "address_line_1": "123 Main Street",
    "address_line_2": "Apt 4B",
    "city": "New York",
    "state_code": "NY",
    "zip": "10001",
    "country_code": "US"
  },
  "payment_handle": "pay_01H2XVBR8C8JS5MQSFPJ8HF9SE",
  "payment_method_options": [
    {
      "type": "CreditCard",
      "wallet": "user"
    },
    {
      "type": "PayPal",
      "wallet": "paypal"
    }
  ],
  "notices": [
    {
      "code": "ITEM_NOT_SHIPPABLE",
      "severity": "error",
      "item_id": "item_01H2XVBR8C8JS5MQSFPJ8HF9SB",
      "details": {
        "description": "This item cannot be shipped to the selected address",
        "reason": "Shipping restrictions apply to this location"
      }
    }
  ],
  "schema_version": "2.0"
}
```

## Error Responses

> [accordion] 400 Bad Request
>
> Invalid request format or missing required headers
>
> ```json theme={null}
> {
>   "code": 400,
>   "error": "MissingAuthHeader",
>   "description": "x-firmly-authorization header is required"
> }
> ```

> [accordion] 401 Unauthorized
>
> Invalid or expired authentication token
>
> ```json theme={null}
> {
>   "code": 401,
>   "error": "InvalidJWTToken",
>   "description": "The JWT token is invalid"
> }
> ```

> [accordion] 404 Not Found
>
> Cart does not exist for the given domain
>
> ```json theme={null}
> {
>   "code": 404,
>   "error": "ErrorCartNotFound",
>   "description": "Cart not found"
> }
> ```

> [accordion] 422 Unprocessable Entity
>
> Store service unavailable or other processing error
>
> ```json theme={null}
> {
>   "code": 422,
>   "error": "ErrorStoreUnavailable",
>   "description": "Store service unavailable"
> }
> ```

## Related Endpoints

* [Add Line Item](https://firmly.mintlify.site/api-reference/cart-management/add-line-item.md) - Add items to cart
* [Update Line Item](https://firmly.mintlify.site/api-reference/cart-management/update-line-item.md) - Modify cart items
* [Clear Cart](https://firmly.mintlify.site/api-reference/cart-management/clear-cart.md) - Empty the cart


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