diff --git a/.changeset/cold-windows-occur.md b/.changeset/cold-windows-occur.md new file mode 100644 index 0000000000..5b59966b4d --- /dev/null +++ b/.changeset/cold-windows-occur.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 d4559836b7..da13ae3c34 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 @@ -49,6 +49,33 @@ export interface LineItem { properties: {[key: string]: string}; isGiftCard: boolean; attributedUserId?: number; + /** + * 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; } export interface Discount {