POS Cart merges line items with same variant ID, discarding distinct line item properties (regression)

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

  1. From a POS UI extension (pos.home.modal.render), call api.cart.clearCart()
  2. Call api.cart.bulkCartUpdate() with two line items sharing the same variantId but different properties.
  3. 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

  1. api.cart.clearCart()
  2. Add first item and set its properties.
  3. Add second item (same variant) and set its properties.
  4. 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.

1 Like

Hey, thanks for the detailed report.

To help us pinpoint when this regression was introduced, could you let us know:

  1. Last working version — What POS version did this last work correctly on?
  2. Current version — What POS version are you seeing the issue on now?
  3. Platform — iOS, Android, or both?

Even an approximate timeline would help. Thanks!