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

# Get Cart

> Retrieves the current shopping cart

## Overview

Gets the current state of the cart with line items and pricing information. Returns an empty cart if no items have been added yet.

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

## Query Parameters

<ParamField query="fast_mode" default="false" type="string">
  Set to `true` for faster response with potentially cached data
</ParamField>

## Response

Returns the shopping cart with line items, pricing, and available options.

### Response Fields

<ResponseField name="cart_id" type="string">
  Unique identifier for the cart
</ResponseField>

<ResponseField name="cart_status" type="string">
  Current cart status (`active`, `submitted`, etc.)
</ResponseField>

<ResponseField name="display_name" type="string">
  Merchant display name
</ResponseField>

<ResponseField name="platform_id" type="string">
  E-commerce platform identifier
</ResponseField>

<ResponseField name="shop_id" type="string">
  Merchant identifier
</ResponseField>

<ResponseField name="line_items" type="array">
  Array of items in the cart

  <Expandable title="Line Item Object">
    <ResponseField name="line_item_id" type="string">
      Unique identifier for the line item
    </ResponseField>

    <ResponseField name="sku" type="string">
      Product SKU
    </ResponseField>

    <ResponseField name="base_sku" type="string">
      Base product SKU (parent product)
    </ResponseField>

    <ResponseField name="quantity" type="number">
      Quantity of the item
    </ResponseField>

    <ResponseField name="description" type="string">
      Product description
    </ResponseField>

    <ResponseField name="price" type="object">
      Unit price

      <Expandable title="Price Object">
        <ResponseField name="currency" type="string">
          Currency code (e.g., "USD")
        </ResponseField>

        <ResponseField name="value" type="number">
          Decimal price value
        </ResponseField>

        <ResponseField name="number" type="number">
          Price in cents
        </ResponseField>

        <ResponseField name="symbol" type="string">
          Currency symbol
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="line_price" type="object">
      Total price for this line item (price × quantity)
    </ResponseField>

    <ResponseField name="image" type="object">
      Product image

      <Expandable title="Image Object">
        <ResponseField name="url" type="string">
          Primary image URL
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="requires_shipping" type="boolean">
      Whether this item requires shipping
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="sub_total" type="object">
  Subtotal before shipping and tax
</ResponseField>

<ResponseField name="shipping_total" type="object">
  Shipping cost (if shipping info has been set)
</ResponseField>

<ResponseField name="tax" type="object">
  Tax amount
</ResponseField>

<ResponseField name="total" type="object">
  Grand total including all costs
</ResponseField>

<ResponseField name="shipping_info" type="object">
  Shipping address (if set)
</ResponseField>

<ResponseField name="shipping_method" type="object">
  Selected shipping method (if set)
</ResponseField>

<ResponseField name="shipping_method_options" type="array">
  Available shipping methods (if shipping info has been set)
</ResponseField>

<ResponseField name="payment_method_options" type="array">
  Available payment methods
</ResponseField>

<ResponseField name="notice" type="array">
  Array of notice messages (Simple Cart API uses string array)
</ResponseField>

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

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

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

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

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

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

<ResponseExample>
  ```json Cart with Items theme={null}
  {
    "cart_discount": { 
      "currency": "USD", 
      "value": 0, 
      "symbol": "$", 
      "number": 0 
    },
    "line_items": [
      {
        "base_sku": "WS12",
        "description": "Radiant Tee - Orange XS",
        "image": {
          "url": "https://cdn.staging.luma.gift/products/radiant-tee/orange.jpg"
        },
        "line_item_id": "00000000-0000-0000-0000-000000000000",
        "line_price": { 
          "currency": "USD", 
          "value": 22.00, 
          "symbol": "$", 
          "number": 2200 
        },
        "msrp": { 
          "currency": "USD", 
          "value": 22.00, 
          "symbol": "$", 
          "number": 2200 
        },
        "platform_line_item_id": "4df9941b-bd06-4495-8759-61c6145dc408",
        "price": { 
          "currency": "USD", 
          "value": 22.00, 
          "symbol": "$", 
          "number": 2200 
        },
        "quantity": 1,
        "requires_shipping": true,
        "sku": "WS12-XS-Orange"
      }
    ],
    "payment_method_options": [
      {
        "type": "CreditCard",
        "wallet": "user"
      }
    ],
    "shipping_total": { 
      "currency": "USD", 
      "value": 0, 
      "symbol": "$", 
      "number": 0 
    },
    "sub_total": { 
      "currency": "USD", 
      "value": 869.99, 
      "symbol": "$", 
      "number": 86999 
    },
    "tax": { 
      "currency": "USD", 
      "value": 2.20, 
      "symbol": "$", 
      "number": 220 
    },
    "total": { 
      "currency": "USD", 
      "value": 24.20, 
      "symbol": "$", 
      "number": 2420 
    }
  }
  ```

  ```json Empty Cart theme={null}
  {
    "cart_id": "abc123",
    "cart_status": "active", 
    "display_name": "Luma Store",
    "platform_id": "example",
    "shop_id": "staging.luma.gift",
    "line_items": [],
    "sub_total": {
      "currency": "USD",
      "value": 0,
      "symbol": "$",
      "number": 0
    },
    "tax": {
      "currency": "USD", 
      "value": 0,
      "symbol": "$",
      "number": 0
    },
    "total": {
      "currency": "USD",
      "value": 0, 
      "symbol": "$",
      "number": 0
    },
    "payment_method_options": [
      {
        "type": "CreditCard",
        "wallet": "user"
      }
    ]
  }
  ```
</ResponseExample>

## Error Responses

### 400 Bad Request

Missing or invalid authentication header

### 404 Not Found

Cart was not found

### 503 Service Unavailable

Store temporarily unavailable
