From 58fef364a8378a824a51e4697d83ae2d28d46f2f Mon Sep 17 00:00:00 2001 From: Alex Graffeo-Cohen Date: Thu, 30 Oct 2025 09:53:48 -0400 Subject: [PATCH] Adds components to POS cart line item interface --- .changeset/vast-planes-flow.md | 5 ++++ .../src/surfaces/point-of-sale/types/cart.ts | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .changeset/vast-planes-flow.md diff --git a/.changeset/vast-planes-flow.md b/.changeset/vast-planes-flow.md new file mode 100644 index 0000000000..5b59966b4d --- /dev/null +++ b/.changeset/vast-planes-flow.md @@ -0,0 +1,5 @@ +--- +'@shopify/ui-extensions': minor +--- + +Adds components to point of sale cart LineItem interface to represent product bundle items. diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts b/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts index 193a5d1b7a..36c07cfdc0 100644 --- a/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts +++ b/packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts @@ -55,6 +55,33 @@ export interface LineItem { * The currently selected selling plan for this line item. */ sellingPlan?: SellingPlan; + /** + * Bundle components for this line item. Only present for product bundles. + * Each component represents an individual item within the bundle with its own tax information. + */ + components?: LineItemComponent[]; +} + +/** + * Represents a component of a product bundle line item. + * Bundle components contain the individual items that make up a bundle, + * each with their own pricing and tax information. + */ +export interface LineItemComponent { + /** The title/name of the component product */ + title?: string; + /** The quantity of this component in the bundle */ + quantity: number; + /** The price of this component */ + price?: number; + /** Whether this component is taxable */ + taxable: boolean; + /** Tax lines applied to this component */ + taxLines: TaxLine[]; + /** The variant ID of this component, if applicable */ + variantId?: number; + /** The product ID of this component, if applicable */ + productId?: number; } /**