When adding multiple line items with the same variantId but different properties to the POS cart, the cart merges them into a single line item with combined quantity. The distinct properties
from each line item are lost, the resulting sales order has the lines combined with only one set of attributes applied.
This happens regardless of the cart API method used (see below). This used to work correctly, so we believe this is a regression.
Steps to reproduce
Method A — bulkCartUpdate
- From a POS UI extension (pos.home.modal.render), call api.cart.clearCart()
- Call api.cart.bulkCartUpdate() with two line items sharing the same variantId but different properties.
- Complete checkout on POS
await api.cart.clearCart();
await api.cart.bulkCartUpdate({
customer: { id: customerId },
properties: {},
cartDiscounts: [],
lineItems: [
{
uuid: crypto.randomUUID(),
variantId: 12345, // same variant
quantity: 1,
properties: { _line_id: 'line-A' },
discounts: [], taxable: true, taxLines: [], isGiftCard: false,
},
{
uuid: crypto.randomUUID(),
variantId: 12345, // same variant
quantity: 1,
properties: { _line_id: 'line-B' },
discounts: [], taxable: true, taxLines: [], isGiftCard: false,
},
],
});
Method B — individual addLineItem + addLineItemProperties
- api.cart.clearCart()
- Add first item and set its properties.
- Add second item (same variant) and set its properties.
- Complete checkout on POS
const uuid1 = await api.cart.addLineItem(12345, 1);
await api.cart.addLineItemProperties(uuid1, { _line_id: ‘line-A’ });
const uuid2 = await api.cart.addLineItem(12345, 1);
await api.cart.addLineItemProperties(uuid2, { _line_id: ‘line-B’ });
Same result in both methods.
Expected
Sales order contains two line items (qty 1 each) with their respective properties:
- Line 1: { _line_id: ‘line-A’ }
- Line 2: { _line_id: ‘line-B’ }
Actual
POS merges both into one line item with qty 2. One set of properties is discarded.
Impact
Our app relies on line item properties to map sales order line items back to internal records post-checkout. When properties are lost during merge, order reconciliation breaks. This affects
any workflow where the same variant appears multiple times with distinct metadata.