I’m building a Checkout UI extension and need to send line item prices before any discounts are applied, exactly as they appear in the checkout UI (e.g. 749.95, 699.95, 629.95).
From the Checkout API I’m using:
-
api.cost.subtotalAmount→ gives me the correct cart subtotal before discounts. -
api.cost.totalAmount→ cart total after discounts. -
For each
CartLine:-
line.cost.totalAmountis present (line total after discounts), -
but
line.cost.subtotalAmountisundefined, -
and
line.merchandise.priceis alsoundefinedin this context.
-
So right now the only per-line amount I can reliably get is line.cost.totalAmount / quantity, which is the discounted per-unit price (e.g. 747.79, 697.935, 628.14), not the original prices shown in the UI.
Question:
Is there any supported way in Checkout UI extensions to access the original per-line item price before discounts (the same value the buyer sees as the product price), or do we have to fetch it ourselves via Storefront/Admin API using the variant IDs? If this is not currently exposed, is it planned to be added to the Checkout UI extensions API (e.g., a line.cost.originalAmount or line.merchandise.price field)?