# Cart Lines The API for interacting with the cart lines. ### ```jsx import { reactExtension, Text, useCartLineTarget, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.cart-line-item.render-after', () => <Extension />, ); function Extension() { const { merchandise: {title}, } = useCartLineTarget(); return <Text>Line item title: {title}</Text>; } ``` ```js import {extension} from '@shopify/ui-extensions/checkout'; export default extension( 'purchase.checkout.cart-line-item.render-after', (root, {target}) => { const text = root.createText( `Line item title: ${target.current.title}`, ); root.appendChild(text); target.subscribe((updatedTarget) => { text.updateText( `Line item title: ${updatedTarget.title}`, ); }); }, ); ``` ## StandardApi The base API object provided to `purchase` extension targets. ### Docs_Standard_CartLinesApi ### lines A list of lines containing information about the items the customer intends to purchase. ### CartLine ### attributes The line item additional custom attributes. ### cost The details about the cost components attributed to the cart line. ### discountAllocations Discounts applied to the cart line. ### 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. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### 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' ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### discountedAmount The money amount that has been discounted from the order ### type The type of the code discount ### CartAutomaticDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the automatic discount ### type The type of the automatic discount ### CartCustomDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the custom discount ### type The type of the custom discount ### CartBundleLineComponent ### attributes Additional custom attributes for the bundle line component. ### cost The cost attributed to this bundle line component. ### 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. ### type ### Merchandise ### id A globally-unique identifier. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### selectedOptions List of product options applied to the variant. ### sellingPlan The selling plan associated with the merchandise. ### sku The product variant's sku. ### subtitle The product variant's subtitle. ### title The product variant’s title. ### type ### ImageDetails ### altText The alternative text for the image. ### url The image URL. ### Product ### id A globally-unique identifier. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### vendor The product’s vendor name. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### SellingPlan ### id A globally-unique identifier. ## Related - [Targets](/docs/api/checkout-ui-extensions/targets) - [Components](/docs/api/checkout-ui-extensions/components) - [Configuration](/docs/api/checkout-ui-extensions/configuration) - [Tutorials](/apps/checkout) ## 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 ### attributes The line item additional custom attributes. ### cost The details about the cost components attributed to the cart line. ### discountAllocations Discounts applied to the cart line. ### 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. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### 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' ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### discountedAmount The money amount that has been discounted from the order ### type The type of the code discount ### CartAutomaticDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the automatic discount ### type The type of the automatic discount ### CartCustomDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the custom discount ### type The type of the custom discount ### CartBundleLineComponent ### attributes Additional custom attributes for the bundle line component. ### cost The cost attributed to this bundle line component. ### 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. ### type ### Merchandise ### id A globally-unique identifier. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### selectedOptions List of product options applied to the variant. ### sellingPlan The selling plan associated with the merchandise. ### sku The product variant's sku. ### subtitle The product variant's subtitle. ### title The product variant’s title. ### type ### ImageDetails ### altText The alternative text for the image. ### url The image URL. ### Product ### id A globally-unique identifier. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### vendor The product’s vendor name. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### SellingPlan ### id A globally-unique identifier. ## Related - [Targets](/docs/api/checkout-ui-extensions/targets) - [Components](/docs/api/checkout-ui-extensions/components) - [Configuration](/docs/api/checkout-ui-extensions/configuration) - [Tutorials](/apps/checkout) ## CheckoutApi The API object provided to `purchase.checkout` extension targets. ### Docs_Checkout_CartLinesApi ### applyCartLinesChange Performs an update on the merchandise line items. It resolves when the new line items have been negotiated and results in an update to the value retrieved through the [`lines`](/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines) property. > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `lines.canAddCartLine` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay. ### CartLineChange CartLineAddChange | CartLineRemoveChange | CartLineUpdateChange ### CartLineAddChange ### attributes The attributes associated with the line item. ### merchandiseId The merchandise ID being added. ### quantity The quantity of the merchandise being added. ### sellingPlanId The identifier of the selling plan that the merchandise is being purchased with. ### type An identifier for changes that add line items. ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### CartLine ### attributes The line item additional custom attributes. ### cost The details about the cost components attributed to the cart line. ### discountAllocations Discounts applied to the cart line. ### 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. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### 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' ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### discountedAmount The money amount that has been discounted from the order ### type The type of the code discount ### CartAutomaticDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the automatic discount ### type The type of the automatic discount ### CartCustomDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the custom discount ### type The type of the custom discount ### CartBundleLineComponent ### attributes Additional custom attributes for the bundle line component. ### cost The cost attributed to this bundle line component. ### 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. ### type ### Merchandise ### id A globally-unique identifier. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### selectedOptions List of product options applied to the variant. ### sellingPlan The selling plan associated with the merchandise. ### sku The product variant's sku. ### subtitle The product variant's subtitle. ### title The product variant’s title. ### type ### ImageDetails ### altText The alternative text for the image. ### url The image URL. ### Product ### id A globally-unique identifier. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### vendor The product’s vendor name. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### SellingPlan ### id A globally-unique identifier. ### CartLineRemoveChange ### id Line Item ID. ### quantity The quantity being removed for this line item. ### type An identifier for changes that remove line items. ### CartLineUpdateChange ### attributes The new attributes for the line item. ### id Line Item ID. ### merchandiseId The new merchandise ID for the line item. ### quantity The new quantity for the line item. ### sellingPlanId The identifier of the selling plan that the merchandise is being purchased with or `null` to remove the the product from the selling plan. ### type An identifier for changes that update line items. ### CartLineChangeResult CartLineChangeResultSuccess | CartLineChangeResultError ### CartLineChangeResultSuccess ### type Indicates that the line item was changed successfully. ### CartLineChangeResultError ### message A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer. ### type Indicates that the line item was not changed successfully. Refer to the `message` property for details about the error. ## Related - [Targets](/docs/api/checkout-ui-extensions/targets) - [Components](/docs/api/checkout-ui-extensions/components) - [Configuration](/docs/api/checkout-ui-extensions/configuration) - [Tutorials](/apps/checkout) ## useApplyCartLinesChange Returns a function to mutate the `lines` property of checkout. ### UseApplyCartLinesChangeGeneratedType Returns a function to mutate the `lines` property of checkout. #### Returns: (change: CartLineChange) => Promise export function useApplyCartLinesChange< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): (change: CartLineChange) => Promise { const api = useApi(); if ('applyCartLinesChange' in api) { return api.applyCartLinesChange; } throw new ExtensionHasNoMethodError( 'applyCartLinesChange', api.extension.target, ); } ### CartLineChange CartLineAddChange | CartLineRemoveChange | CartLineUpdateChange ### CartLineAddChange ### attributes The attributes associated with the line item. ### merchandiseId The merchandise ID being added. ### quantity The quantity of the merchandise being added. ### sellingPlanId The identifier of the selling plan that the merchandise is being purchased with. ### type An identifier for changes that add line items. ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### CartLine ### attributes The line item additional custom attributes. ### cost The details about the cost components attributed to the cart line. ### discountAllocations Discounts applied to the cart line. ### 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. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### 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' ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### discountedAmount The money amount that has been discounted from the order ### type The type of the code discount ### CartAutomaticDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the automatic discount ### type The type of the automatic discount ### CartCustomDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the custom discount ### type The type of the custom discount ### CartBundleLineComponent ### attributes Additional custom attributes for the bundle line component. ### cost The cost attributed to this bundle line component. ### 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. ### type ### Merchandise ### id A globally-unique identifier. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### selectedOptions List of product options applied to the variant. ### sellingPlan The selling plan associated with the merchandise. ### sku The product variant's sku. ### subtitle The product variant's subtitle. ### title The product variant’s title. ### type ### ImageDetails ### altText The alternative text for the image. ### url The image URL. ### Product ### id A globally-unique identifier. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### vendor The product’s vendor name. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### SellingPlan ### id A globally-unique identifier. ### CartLineRemoveChange ### id Line Item ID. ### quantity The quantity being removed for this line item. ### type An identifier for changes that remove line items. ### CartLineUpdateChange ### attributes The new attributes for the line item. ### id Line Item ID. ### merchandiseId The new merchandise ID for the line item. ### quantity The new quantity for the line item. ### sellingPlanId The identifier of the selling plan that the merchandise is being purchased with or `null` to remove the the product from the selling plan. ### type An identifier for changes that update line items. ### CartLineChangeResult CartLineChangeResultSuccess | CartLineChangeResultError ### CartLineChangeResultSuccess ### type Indicates that the line item was changed successfully. ### CartLineChangeResultError ### message A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer. ### type Indicates that the line item was not changed successfully. Refer to the `message` property for details about the error. ## Related - [Targets](/docs/api/checkout-ui-extensions/targets) - [Components](/docs/api/checkout-ui-extensions/components) - [Configuration](/docs/api/checkout-ui-extensions/configuration) - [Tutorials](/apps/checkout) ## CartLineItemApi The API object provided to `cart-line-item` extension targets. ### Docs_CartLineItem_CartLinesApi ### target The cart line the extension is attached to. Until version `2023-04`, this property was a `StatefulRemoteSubscribable`. ### CartLine ### attributes The line item additional custom attributes. ### cost The details about the cost components attributed to the cart line. ### discountAllocations Discounts applied to the cart line. ### 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. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### 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' ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### discountedAmount The money amount that has been discounted from the order ### type The type of the code discount ### CartAutomaticDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the automatic discount ### type The type of the automatic discount ### CartCustomDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the custom discount ### type The type of the custom discount ### CartBundleLineComponent ### attributes Additional custom attributes for the bundle line component. ### cost The cost attributed to this bundle line component. ### 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. ### type ### Merchandise ### id A globally-unique identifier. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### selectedOptions List of product options applied to the variant. ### sellingPlan The selling plan associated with the merchandise. ### sku The product variant's sku. ### subtitle The product variant's subtitle. ### title The product variant’s title. ### type ### ImageDetails ### altText The alternative text for the image. ### url The image URL. ### Product ### id A globally-unique identifier. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### vendor The product’s vendor name. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### SellingPlan ### id A globally-unique identifier. ## Related - [Targets](/docs/api/checkout-ui-extensions/targets) - [Components](/docs/api/checkout-ui-extensions/components) - [Configuration](/docs/api/checkout-ui-extensions/configuration) - [Tutorials](/apps/checkout) ## useTarget Returns the cart line the extension is attached to. This hook can only be used by `cart-line-item` extension targets. Until version `2023-04`, this hook returned a `PresentmentCartLine object`. ### UseTargetGeneratedType Returns the cart line the extension is attached to. This hook can only be used by extensions in the `purchase.cart-line-item.line-components.render`, `purchase.checkout.cart-line-item.render-after`, and `purchase.thank-you.cart-line-item.render-after` extension targets. Until version `2023-04`, this hook returned a `PresentmentCartLine` object. > Caution: Deprecated as of version `2023-10`, use `useCartLineTarget()` instead. #### Returns: CartLine export function useTarget(): CartLine { const api = useApi< | 'purchase.cart-line-item.line-components.render' | 'purchase.checkout.cart-line-item.render-after' | 'purchase.thank-you.cart-line-item.render-after' >(); if (!api.target) { throw new ExtensionHasNoTargetError(api.extension.target); } return useSubscription(api.target); } ### CartLine ### attributes The line item additional custom attributes. ### cost The details about the cost components attributed to the cart line. ### discountAllocations Discounts applied to the cart line. ### 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. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### 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' ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### discountedAmount The money amount that has been discounted from the order ### type The type of the code discount ### CartAutomaticDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the automatic discount ### type The type of the automatic discount ### CartCustomDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the custom discount ### type The type of the custom discount ### CartBundleLineComponent ### attributes Additional custom attributes for the bundle line component. ### cost The cost attributed to this bundle line component. ### 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. ### type ### Merchandise ### id A globally-unique identifier. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### selectedOptions List of product options applied to the variant. ### sellingPlan The selling plan associated with the merchandise. ### sku The product variant's sku. ### subtitle The product variant's subtitle. ### title The product variant’s title. ### type ### ImageDetails ### altText The alternative text for the image. ### url The image URL. ### Product ### id A globally-unique identifier. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### vendor The product’s vendor name. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### SellingPlan ### id A globally-unique identifier. ## Related - [Targets](/docs/api/checkout-ui-extensions/targets) - [Components](/docs/api/checkout-ui-extensions/components) - [Configuration](/docs/api/checkout-ui-extensions/configuration) - [Tutorials](/apps/checkout) ## useCartLineTarget Returns the cart line the extension is attached to. This hook can only be used by `cart-line-item` extension targets ### UseCartLineTargetGeneratedType Returns the cart line the extension is attached to. This hook can only be used by extensions in the following extension targets: - `purchase.cart-line-item.line-components.render` - `purchase.checkout.cart-line-item.render-after` - `purchase.thank-you.cart-line-item.render-after` #### Returns: CartLine export function useCartLineTarget(): CartLine { const api = useApi< | 'purchase.cart-line-item.line-components.render' | 'purchase.checkout.cart-line-item.render-after' | 'purchase.thank-you.cart-line-item.render-after' >(); if (!api.target) { throw new ExtensionHasNoTargetError( 'useCartLineTarget', api.extension.target, ); } return useSubscription(api.target); } ### CartLine ### attributes The line item additional custom attributes. ### cost The details about the cost components attributed to the cart line. ### discountAllocations Discounts applied to the cart line. ### 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. ### lineComponents Sub lines of the merchandise line. If no sub lines are present, this will be an empty array. ### merchandise The merchandise being purchased. ### quantity The quantity of the merchandise being purchased. ### Attribute ### key The key for the attribute. ### value The value for the attribute. ### 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' ### CartDiscountAllocation CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation ### CartCodeDiscountAllocation ### code The code for the discount ### discountedAmount The money amount that has been discounted from the order ### type The type of the code discount ### CartAutomaticDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the automatic discount ### type The type of the automatic discount ### CartCustomDiscountAllocation ### discountedAmount The money amount that has been discounted from the order ### title The title of the custom discount ### type The type of the custom discount ### CartBundleLineComponent ### attributes Additional custom attributes for the bundle line component. ### cost The cost attributed to this bundle line component. ### 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. ### type ### Merchandise ### id A globally-unique identifier. ### image Image associated with the product variant. This field falls back to the product image if no image is available. ### product The product object that the product variant belongs to. ### requiresShipping Whether or not the product requires shipping. ### selectedOptions List of product options applied to the variant. ### sellingPlan The selling plan associated with the merchandise. ### sku The product variant's sku. ### subtitle The product variant's subtitle. ### title The product variant’s title. ### type ### ImageDetails ### altText The alternative text for the image. ### url The image URL. ### Product ### id A globally-unique identifier. ### productType A categorization that a product can be tagged with, commonly used for filtering and searching. ### vendor The product’s vendor name. ### SelectedOption ### name The name of the merchandise option. ### value The value of the merchandise option. ### SellingPlan ### id A globally-unique identifier. ## Related - [Targets](/docs/api/checkout-ui-extensions/targets) - [Components](/docs/api/checkout-ui-extensions/components) - [Configuration](/docs/api/checkout-ui-extensions/configuration) - [Tutorials](/apps/checkout)