Hi @Victor_Chu, @Rune-Shopify & Shopify team,
I hope it’s ok to start a new thread about this issue. I still want to keep my other thread going to investigate cart transform issues, but I wanted to open a new issue related to shopify.cart.addLineItem(...), which both @Gunes and @derrick have both reported on.
We have been investigating add-to-cart performance in a Shopify POS UI extension and have found that shopify.cart.addLineItem(...) appears to be a major baseline bottleneck. We would appreciate guidance from Shopify on whether this latency is expected, and whether the POS cart APIs can be optimized for faster item creation.
Context
We have a POS UI extension for a cafe ordering workflow. The extension lets staff configure a product with modifiers, then adds the configured item to the Shopify POS cart with line item properties and cart properties.
The relevant APIs we tested are:
shopify.cart.addLineItem(variantId, quantity)
shopify.cart.addLineItemProperties(uuid, lineProperties)
shopify.cart.addCartProperties(cartProperties)
shopify.cart.bulkCartUpdate(cartUpdateInput)
Our original goal was to improve add-to-cart speed by moving from multiple sequential cart calls to bulkCartUpdate. After testing, we found that bulkCartUpdate is not faster for simple add-with-properties flows, but more importantly, the initial addLineItem(...) call itself consistently takes multiple seconds.
Test Environment
-
Surface: Shopify POS UI Extension
-
POS device: iPad running Shopify POS
-
Extension API package:
@shopify/ui-extensions2026.1.3 -
App type: Shopify app with embedded POS extension
-
Store/network/device kept consistent during the test runs
-
Timing captured inside the extension using
performance.now() -
Logs posted to a Gadget endpoint and streamed with
ggt logs
Tested Add-To-Cart Strategies
We tested three strategies for adding a configured product with line item properties and cart properties.
1. Legacy Sequential
const uuid = await shopify.cart.addLineItem(variantId, quantity);
await shopify.cart.addLineItemProperties(uuid, lineProperties);
await shopify.cart.addCartProperties(cartProperties);
2. Bulk Cart Update
const uuid = await shopify.cart.addLineItem(variantId, quantity);
await waitForCartLineItem(uuid);
await shopify.cart.bulkCartUpdate({
lineItems,
properties: cartProperties,
cartDiscounts,
});
3. Parallel Property Calls
const uuid = await shopify.cart.addLineItem(variantId, quantity);
await waitForCartLineItem(uuid);
await Promise.all([
shopify.cart.addLineItemProperties(uuid, lineProperties),
shopify.cart.addCartProperties(cartProperties),
]);
Timing Results
Each strategy was tested repeatedly on the same device/store/network.
=== legacySequential ===
samples: 5
p50: 3049ms
p90: 3893ms
max: 3893ms
mean: 3244ms
=== bulkCartUpdate ===
samples: 5
p50: 4934ms
p90: 5728ms
max: 5728ms
mean: 4878.2ms
=== parallelProperties ===
samples: 4
p50: 2766ms
p90: 3431ms
max: 3431ms
mean: 2963.8ms
The fastest approach for our simple add-with-properties case was parallelProperties, but the total time was still usually around 2.7-3.4 seconds.
addLineItem Is a Major Baseline Cost
In a representative bulkCartUpdate run, the timing breakdown was:
addLineItemMs: 2623
waitForCartLineItemMs: 0
bulkCartUpdateMs: 2742
totalBlockingMs: 5367
strategy: bulk
This suggests that shopify.cart.addLineItem(...) alone took about 2.6 seconds.
The waitForCartLineItemMs value was 0ms in that run, which suggests the delay was not from our polling/wait helper. Instead, addLineItem(...) did not resolve until the POS cart line was already created and visible in shopify.cart.current.value.
So even after optimizing the property attachment step, the initial POS line creation remains a significant unavoidable delay.
Additional Observations
We found that bulkCartUpdate is useful for some existing-line mutation cases, but it is not a good fit for our simple add-with-properties flow.
For simple new-item adds:
-
bulkCartUpdatewas slower than dedicated property APIs. -
Resending the full cart payload is expensive.
-
Using
bulkCartUpdatefor duplicate quantity increments caused a serious issue where cart line prices changed to$0.00on-device. We avoided this by no longer usingbulkCartUpdatefor duplicate adds.
Our current fastest safe path is:
const uuid = await shopify.cart.addLineItem(variantId, quantity);
await Promise.all([
shopify.cart.addLineItemProperties(uuid, lineProperties),
shopify.cart.addCartProperties(cartProperties),
]);
Even with that optimized path, addLineItem(...) itself remains a multi-second bottleneck.
Questions For Shopify
-
Is a 2-3 second duration for
shopify.cart.addLineItem(...)expected in Shopify POS UI extensions? -
Are there known performance limitations in POS cart line creation that extension developers should account for?
-
Is Shopify planning any optimization work for
addLineItem(...)latency? -
Is there a faster supported API for adding a variant line with initial line item properties in one operation?
-
Could
addLineItem(...)accept optional initial line item properties/cart properties in the future, so POS does not require separate calls after UUID creation? -
Are there recommended profiling steps or diagnostic data Shopify would like us to capture to help investigate?
Ideal API Shape
For POS ordering workflows, the ideal API would allow a configured line to be created with properties in one call:
await shopify.cart.addLineItem({
variantId,
quantity,
properties: lineProperties,
cartProperties,
});
This would avoid requiring developers to:
-
wait for a UUID before attaching properties
-
issue separate line-property/cart-property calls
-
use
bulkCartUpdateas a workaround -
risk full-cart rewrite side effects
Request
Could the Shopify POS team please investigate the performance of shopify.cart.addLineItem(...) in POS UI extensions, especially for workflows where staff need to add configured products quickly during checkout?
For cafe/restaurant POS use cases, an add-to-cart operation taking 2-3+ seconds creates a noticeable delay for staff during order entry. Any improvement to the baseline addLineItem(...) latency, or a new API for creating a line with initial properties, would make a significant difference.
Happy to provide more logs, timing breakdowns, or reproduction details if helpful.


