Skip to main content

ShopifyCart

interface ShopifyCart {
    id: string
    checkoutUrl: string
    totalQuantity: number
    cost: {
        totalAmount: ShopifyMoney
        subtotalAmount: ShopifyMoney
        totalTaxAmount: ShopifyMoney | null
    }
    lines: {
        edges: Array<{
            node: ShopifyCartLine
            cursor: string
        }>
        pageInfo: ShopifyPageInfo
    }
}

ShopifyCartLine

interface ShopifyCartLine {
    id: string
    quantity: number
    merchandise: ShopifyCartLineMerchandise
    cost: {
        totalAmount: ShopifyMoney
        amountPerQuantity: ShopifyMoney
    }
}

ShopifyCartLineMerchandise

interface ShopifyCartLineMerchandise {
    id: string
    title: string
    product: {
        title: string
        handle: string
    }
    image: ShopifyImage | null
    price: ShopifyMoney
    selectedOptions: Array<{
        name: string
        value: string
    }>
}

CartLineInput

Input for adding items to cart.
interface CartLineInput {
    merchandiseId: string
    quantity: number
}

CartLineUpdateInput

Input for updating cart items.
interface CartLineUpdateInput {
    id: string
    quantity: number
}

CartSubscriber

Callback function for cart subscriptions.
type CartSubscriber = (cart: ShopifyCart | null) => void