Skip to content

Commit b965a97

Browse files
committed
Add optional discountAllocations field to pos bundle lineItemComponent
1 parent 9a1b5d4 commit b965a97

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': minor
3+
---
4+
5+
Added optional `discountAllocations` field to POS bundle `LineItemComponent` so extensions can access the discount amount allocated to each bundle component.

packages/ui-extensions/docs/surfaces/point-of-sale/generated/pos_ui_extensions/2026-07-rc/generated_docs_data_v2.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,14 @@
440440
"description": "Represents a component of a [product bundle](/docs/apps/build/product-merchandising/bundles) line item. Bundle components contain the individual items that make up a bundle, each with their own pricing and tax information.",
441441
"isPublicDocs": true,
442442
"members": [
443+
{
444+
"filePath": "src/surfaces/point-of-sale/types/cart.ts",
445+
"syntaxKind": "PropertySignature",
446+
"name": "discountAllocations",
447+
"value": "DiscountAllocation[]",
448+
"description": "An array of discount allocations applied to this component, providing a detailed breakdown of how discounts are distributed across bundle components. Returns `undefined` if no allocations exist.",
449+
"isOptional": true
450+
},
443451
{
444452
"filePath": "src/surfaces/point-of-sale/types/cart.ts",
445453
"syntaxKind": "PropertySignature",
@@ -494,7 +502,7 @@
494502
"isOptional": true
495503
}
496504
],
497-
"value": "export interface LineItemComponent {\n /**\n * The display name for the custom sale item. Appears on receipts and in cart displays. Should be descriptive and customer-friendly.\n */\n title?: string;\n /**\n * The quantity of the custom sale item. Must be a positive integer. Use for quantity-based pricing and inventory management.\n */\n quantity: number;\n /**\n * The price for the custom sale item as currency string. Must be a valid positive amount. Use for non-catalog items and custom pricing.\n */\n price?: number;\n /**\n * Determines whether the custom sale item is taxable. Set to `true` to apply tax calculations, `false` to exempt from taxes.\n */\n taxable: boolean;\n /**\n * An array of tax lines applied to this component.\n */\n taxLines: TaxLine[];\n /**\n * The unique numeric identifier for the product variant this component represents, if applicable.\n */\n variantId?: number;\n /**\n * The unique numeric identifier for the product this component represents, if applicable.\n */\n productId?: number;\n}"
505+
"value": "export interface LineItemComponent {\n /**\n * The display name for the custom sale item. Appears on receipts and in cart displays. Should be descriptive and customer-friendly.\n */\n title?: string;\n /**\n * The quantity of the custom sale item. Must be a positive integer. Use for quantity-based pricing and inventory management.\n */\n quantity: number;\n /**\n * The price for the custom sale item as currency string. Must be a valid positive amount. Use for non-catalog items and custom pricing.\n */\n price?: number;\n /**\n * Determines whether the custom sale item is taxable. Set to `true` to apply tax calculations, `false` to exempt from taxes.\n */\n taxable: boolean;\n /**\n * An array of tax lines applied to this component.\n */\n taxLines: TaxLine[];\n /**\n * An array of discount allocations applied to this component, providing a detailed breakdown of how discounts are distributed across bundle components. Returns `undefined` if no allocations exist.\n */\n discountAllocations?: DiscountAllocation[];\n /**\n * The unique numeric identifier for the product variant this component represents, if applicable.\n */\n variantId?: number;\n /**\n * The unique numeric identifier for the product this component represents, if applicable.\n */\n productId?: number;\n}"
498506
}
499507
},
500508
"SellingPlan": {

packages/ui-extensions/src/surfaces/point-of-sale/api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ export type {
118118

119119
export type {TaxLine} from './types/tax-line';
120120

121+
export type {DiscountAllocation} from './types/discount-allocation';
122+
121123
export type {PaymentMethod, Payment} from './types/payment';
122124

123125
export type {MultipleResourceResult} from './types/multiple-resource-result';

packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ export interface LineItemComponent {
199199
* An array of tax lines applied to this component.
200200
*/
201201
taxLines: TaxLine[];
202+
/**
203+
* An array of discount allocations applied to this component, providing a detailed breakdown of how discounts are distributed across bundle components. Returns `undefined` if no allocations exist.
204+
*/
205+
discountAllocations?: DiscountAllocation[];
202206
/**
203207
* The unique numeric identifier for the product variant this component represents, if applicable.
204208
*/

0 commit comments

Comments
 (0)