Skip to main content
GET
https://api.firmly.work
/
api
/
v2
/
domains
/
{domain}
/
cart
Get Cart
curl --request GET \
  --url https://api.firmly.work/api/v2/domains/{domain}/cart \
  --header 'Authorization: Bearer <token>'
{
  "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": "$"
  },
  "total": {
    "currency": "USD",
    "value": 209.39,
    "number": 20939,
    "symbol": "$"
  },
  "shipping_info": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "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"
}

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

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
shipments
array
Array of shipment groups, each containing line items with similar fulfillment requirements
addons
object
Available addon services and current selections
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
total
object
Grand total including all costs
shipping_info
object
Shipping address information (when address is set)
payment_handle
string
Payment handle identifier (when payment is configured)
payment_method_options
array
Available payment methods for checkout
notices
array
Cart notices providing information about cart state and issues
schema_version
string
Cart schema version (“2.0”)

Code Examples

curl --request GET \
  --url https://api.firmly.work/api/v2/domains/staging.luma.gift/cart \
  --header 'x-firmly-authorization: YOUR_TOKEN'
{
  "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": "$"
  },
  "total": {
    "currency": "USD",
    "value": 209.39,
    "number": 20939,
    "symbol": "$"
  },
  "shipping_info": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "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

Invalid request format or missing required headers
{
  "code": 400,
  "error": "MissingAuthHeader",
  "description": "x-firmly-authorization header is required"
}
Invalid or expired authentication token
{
  "code": 401,
  "error": "InvalidJWTToken",
  "description": "The JWT token is invalid"
}
Cart does not exist for the given domain
{
  "code": 404,
  "error": "ErrorCartNotFound",
  "description": "Cart not found"
}
Store service unavailable or other processing error
{
  "code": 422,
  "error": "ErrorStoreUnavailable",
  "description": "Store service unavailable"
}