# useCartLines Returns the current line items for the checkout, and automatically re-renders your component if line items are added, removed, or updated. ## ### UseCartLinesGeneratedType Returns the current line items for the checkout, and automatically re-renders your component if line items are added, removed, or updated. #### Returns: CartLine[] export function useCartLines< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): CartLine[] { const {lines} = useApi(); return useSubscription(lines); } ### CartLine ### id These line item IDs are not stable at the moment, they might change after any operations on the line items. You should always look up for an updated ID before any call to `applyCartLinesChange` because you'll need the ID to create a `CartLineChange` object. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### cost The details about the cost components attributed to the cart line. ### attributes The line item additional custom attributes. ### discountAllocations Discounts applied to the cart line. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### Merchandise ### type ### id A globally-unique identifier. ### title The product variant’s title. ### subtitle The product variant's subtitle. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### selectedOptions List of product options applied to the variant. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### sellingPlan The selling plan associated with the merchandise. ### ImageDetails ### url The image URL. ### altText The alternative text for the image. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### Product ### id A globally-unique identifier. ### vendor The product’s vendor name. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### SellingPlan ### id A globally-unique identifier. ### CartLineCost ### totalAmount The total amount after reductions the buyer can expect to pay that is directly attributable to a single cart line. ### Money ### amount The price amount. ### currencyCode The ISO 4217 format for the currency. ### CurrencyCode 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL' ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### type The type of the code discount ### discountedAmount The money amount that has been discounted from the order ### CartAutomaticDiscountAllocation ### title The title of the automatic discount ### type The type of the automatic discount ### discountedAmount The money amount that has been discounted from the order ### CartCustomDiscountAllocation ### title The title of the custom discount ### type The type of the custom discount ### discountedAmount The money amount that has been discounted from the order ### CartBundleLineComponent ### type ### id A unique identifier for the bundle line component. This ID is not stable. If an operation updates the line items in any way, all IDs could change. ### merchandise The merchandise of this bundle line component. ### quantity The quantity of merchandise being purchased. ### cost The cost attributed to this bundle line component. ### attributes Additional custom attributes for the bundle line component. ## Related - [StandardApi](/docs/api/checkout-ui-extensions/apis/standardapi) - [CheckoutApi](/docs/api/checkout-ui-extensions/apis/checkoutapi) - [OrderStatusApi](/docs/api/checkout-ui-extensions/apis/orderstatusapi) - [CartLineItemApi](/docs/api/checkout-ui-extensions/apis/cartlineitemapi) - [PickupPointListApi](/docs/api/checkout-ui-extensions/apis/pickuppointlistapi) - [PickupLocationListApi](/docs/api/checkout-ui-extensions/apis/pickuplocationlistapi) - [ShippingOptionItemApi](/docs/api/checkout-ui-extensions/apis/shippingoptionitemapi) - [ExtensionTargets](/docs/api/checkout-ui-extensions/apis/extensiontargets)