diff --git a/.changeset/bundle-components-transaction.md b/.changeset/bundle-components-transaction.md new file mode 100644 index 0000000000..9297215380 --- /dev/null +++ b/.changeset/bundle-components-transaction.md @@ -0,0 +1,5 @@ +--- +'@shopify/ui-extensions': minor +--- + +Added optional `components` field to `LineItem` interface with new `LineItemComponent` type to provide properties of product bundle components. 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 8ab2576bfd..7d3c57eefb 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 @@ -1,5 +1,6 @@ import {CountryCode} from './country-code'; import {TaxLine} from './tax-line'; +import {Money} from './money'; export interface Cart { /** @@ -53,6 +54,24 @@ export interface LineItem { * The currently selected selling plan for this line item. */ sellingPlan?: SellingPlan; + /** + * The components associated if LineItem represents a product bundle. + */ + components?: LineItemComponent[]; +} + +/** + * Product data for a single component in a line item bundle. Not including + * uuid because we do not want any chance of these components being mutated. + */ +export interface LineItemComponent { + title: string; + quantity: number; + price: Money; + taxable: boolean; + taxLines: TaxLine[]; + variantId?: string; + productId?: string; } /**