Cart

Change carts, discount codes, and restock requests through secure hosted forms.

POST /checkout/buy-now
{% form 'buy_now' %}

Starts checkout for the submitted selection without adding to or replacing the shopping cart.

Form fields

product_id Required

Product to purchase.

variant_id Optional

Required when the product has variants.

quantity Optional

Defaults to 1.

properties[<namespace>.<key>]… Optional

Declared buyer-writable cart-line properties.

gift_card_send_as_gift Optional

Gift card products only. Recipient details control delivery, not who can redeem the code. Send true to deliver the card to the recipient fields below. Leave it (and gift_card_recipient) out to deliver the card to the buyer's checkout contact.

gift_card_recipient_name Optional

Recipient name. Read only when gift_card_send_as_gift is true.

gift_card_recipient_email Optional

Recipient email. Sending as a gift needs an email or a phone; when both are present the card is sent by email.

gift_card_recipient_phone Optional

Recipient phone in international format, starting with +.

gift_card_recipient_message Optional

Optional message shown with the card.

gift_card_deliver_at Optional

Optional future send time in RFC 3339 with an offset, for example 2026-12-24T09:00:00-04:00. A bare datetime-local value (2026-12-24T09:00) is read as UTC, so convert the shopper's local time before submitting. Leave it out to send right after payment.

gift_card_recipient Optional

Alternative to the separate fields: one JSON object {name, email, phone, message, deliver_at}. Unknown keys are refused. When present it is used instead of the separate fields.

client_mutation_id Optional

Unique retry key, up to 128 characters. Reusing it for the same action prevents a successful mutation from being applied twice for 24 hours.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

Validation

Product, selected variant, quantity, inventory, sales-channel availability and buyer-writable properties follow the same validation as Add to Cart. Required app customizations cannot be bypassed. The checkout URL belongs to the current shopper; it is not a shareable sign-in link.

Limits

Quantity defaults to 1 and follows stock and purchase limits. Gift card recipient field lengths: ctx.forms.buy_now..max_length. Reuse a retry key only with the same selection. Starting checkout does not reserve stock or skip verification, delivery, payment or final availability checks.

Response

{
  success,
  checkout_url,
  user_errors,
  refresh_required: false
}

Open checkout_url (the hosted checkout page). The original shopping cart and its discounts stay unchanged. The browser form response redirects to checkout. A conflicting retry key returns success: false with user_errors.

POST /cart/add
{% form 'cart_add' %}

quantity defaults to 1; variant_id is required for products with variants.

Form fields

product_id Required

Product to add.

purchase_intent Optional

cart (default) adds to the shopping cart. buy_now opens checkout for this selection while preserving the shopping cart. A submit button may supply this value.

variant_id Optional

Required when the product has variants.

quantity Optional

Defaults to 1.

properties[<namespace>.<key>]… Optional

Declared buyer-writable cart-line properties.

gift_card_send_as_gift Optional

Gift card products only. Recipient details control delivery, not who can redeem the code. Send true to deliver the card to the recipient fields below. Leave it (and gift_card_recipient) out to deliver the card to the buyer's checkout contact.

gift_card_recipient_name Optional

Recipient name. Read only when gift_card_send_as_gift is true.

gift_card_recipient_email Optional

Recipient email. Sending as a gift needs an email or a phone; when both are present the card is sent by email.

gift_card_recipient_phone Optional

Recipient phone in international format, starting with +.

gift_card_recipient_message Optional

Optional message shown with the card.

gift_card_deliver_at Optional

Optional future send time in RFC 3339 with an offset, for example 2026-12-24T09:00:00-04:00. A bare datetime-local value (2026-12-24T09:00) is read as UTC, so convert the shopper's local time before submitting. Leave it out to send right after payment.

gift_card_recipient Optional

Alternative to the separate fields: one JSON object {name, email, phone, message, deliver_at}. Unknown keys are refused. When present it is used instead of the separate fields.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

client_mutation_id Optional

Unique retry key, up to 128 characters. Reusing it for the same action prevents a successful mutation from being applied twice for 24 hours.

Validation

Positive product/variant ids; variant must belong to the product; quantity, inventory, purchase state, channel availability, and declared buyer-writable properties are validated server-side. Gift card recipient fields are read only for products with is_gift_card: sending as a gift needs a valid email or a + international phone, and deliver_at must be in the future.

Limits

Quantity defaults to 1. The final line quantity cannot exceed available stock or product.quantity_max (or the selected variant's quantity_max). At most 20 properties per line. Gift card recipient field lengths: ctx.forms.cart_add..max_length.

Response

JSON returns {success, cart, user_errors, refresh_required}. cart is the committed compact cart snapshot; refresh the storefront context when refresh_required is true. A refused action returns the unchanged current cart.

POST /cart/clear
{% form 'cart_clear' %}

Empties the cart.

Form fields

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

client_mutation_id Optional

Unique retry key, up to 128 characters. Reusing it for the same action prevents a successful mutation from being applied twice for 24 hours.

Validation

Requires a valid visitor/customer cart owner.

Limits

No action-specific numeric limit.

Response

{
  success,
  cart,
  user_errors
}
POST /cart/estimate

Estimates shipping, tax, duties and cash on delivery for the cart at a country, state and postal code, priced exactly as checkout prices the same cart there. Nothing is stored: no address, cart change or checkout. A JavaScript workflow: POST the fields with the CSRF token in the X-CSRF-Token header (or _csrf) and read the JSON answer.

Request fields

country_code Required

ISO 3166-1 alpha-2 code from ctx.cart.shipping_estimate.countries.

province_code Optional

State, province or prefecture as its ISO 3166-2 code from the country's province_code field in ctx.cart.shipping_estimate.fields_by_country (e.g. IN-MH). Tax and shipping rates set by state need it; without it the estimate leaves state rates out.

postal_code Optional

Postal code. Checked against the country's format; cash on delivery areas set by postal code need it.

Validation

Requires the CSRF token and a visitor session. country_code must be one of ctx.cart.shipping_estimate.countries: a country the store sells to at other prices returns CART_ESTIMATE_OTHER_MARKET (the shopper changes country to see them) and one it does not sell to CART_ESTIMATE_COUNTRY_UNAVAILABLE. province_code must be a subdivision of the country (SUBDIVISION_INVALID on field province_code) and postal_code must match the country's format (POSTAL_CODE_INVALID on field postal_code). Other refusals: CART_ESTIMATE_EMPTY, CART_ESTIMATE_PICKUP (the cart is collected in store), CART_ESTIMATE_ITEMS_UNAVAILABLE (a line can't be bought as it is: ctx.cart.issues), CART_ESTIMATE_NO_SHIPPING (no shipping option reaches the address) and CART_ESTIMATE_UNAVAILABLE.

Limits

Rate limited per visitor (30 a minute; CART_ESTIMATE_RATE_LIMITED, HTTP 429). Automatic discounts, applied codes and the optional fees chosen in the cart are included. An estimate is not a quote: checkout prices the order again with the full address.

Response

{
  success,
  estimate,
  user_errors
}

estimate is {country_code, province_code, postal_code, currency_code, requires_shipping, shipping_options, shipping, fees, tax, duties, cash_on_delivery, total}. shipping_options lists every option for the address as {name, description, price, formatted_price, free}, in the order checkout lists them; shipping is the first of them (the one checkout starts with), null when nothing ships. fees lists the optional fees chosen in the cart as {name, amount, formatted}. tax is {amount, formatted, included, needs_state}: included true means prices already contain it; needs_state true means the tax depends on a state the shopper did not give. duties is null when nothing is imported, else {collected_at_checkout, amount, formatted, note}: note is the market's duty statement (for example duties paid on delivery). cash_on_delivery is null when checkout would not offer it, else {available, fee, formatted_fee, note}: fee is null without a fee; note says why it is unavailable here, or when its fee is waived. total is {amount, formatted}: what checkout charges with the first shipping option, without a cash on delivery fee. Amounts are decimal strings in the cart currency; formatted ones are in the shopper's language. A refusal returns success: false and user_errors [{code, message, field}]; show user_errors[0].message, which is in the shopper's language.

POST /cart/fees
{% form 'cart_fee_select' %}

Adds or removes an optional checkout fee (for example gift wrapping) from ctx.cart.optional_fees. Checkout starts with these fees selected, prices and taxes them, and the shopper can still change them there. Example: {% form 'cart_fee_select' %}{% endform %}

Form fields

fee_id Required

id of an entry in ctx.cart.optional_fees.

selected Required

true to add the fee to the order, false to remove it.

text Optional

With selected=true, for a fee with ctx.cart.optional_fees[].text: the shopper's text (a gift message). Sent replaces the saved text, empty clears it, left out keeps it.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

Validation

fee_id must be an enabled optional fee of the cart's current market, as listed in ctx.cart.optional_fees; anything else (an unknown, disabled, required or other market's fee) returns CART_OPTIONAL_FEE_INVALID and leaves the cart unchanged. selected must be true or false. Removing a fee the cart carries is always allowed. Selections are kept with the market they were made in: after the shopper changes country they no longer apply and the next selection replaces them. A fee the cart does not meet (applies false) can still be chosen; it is charged once the cart meets it. text is trimmed; line breaks are kept and other control characters removed. Text longer than the fee's text.max_length, or text for a fee that asks for none, returns CART_OPTIONAL_FEE_TEXT_TOO_LONG on field text and leaves the cart unchanged. A required text may be left empty in the cart; checkout asks for it.

Limits

At most 10 selected fees (CART_OPTIONAL_FEE_LIMIT). Repeating the same selection changes nothing. The cart does not price or tax fees; checkout computes and charges them for the delivery market, which may differ from the cart's.

Response

{
  success,
  cart,
  user_errors,
  refresh_required
}

, like the other cart actions; read the new selection from ctx.cart.optional_fees after refreshing. Example: sending fee_id=8d1c…&selected=true&_format=json to /cart/fees returns {"success": true, "cart": {…}, "user_errors": [], "refresh_required": true}. A form submission redirects back with HTTP 303.

POST /cart/note
{% form 'cart_note_update' %}

Saves a note for the store (for example delivery instructions). Checkout shows it and places it on the order as the customer note. Example: {% form 'cart_note_update' %}{% endform %}

Form fields

note Required

The note for the store. Empty clears the note. At most ctx.cart.note_max_length characters.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

Validation

The note is trimmed; line breaks and tabs are kept and other control characters are removed. An empty note clears it.

Limits

At most ctx.cart.note_max_length characters (2000 by default, the order customer-note limit), counted as Unicode code points, so a letter in any script counts once. A longer note returns CART_NOTE_TOO_LONG and leaves the saved note unchanged.

Response

{
  success,
  cart,
  user_errors,
  refresh_required
}

, like the other cart actions; read the saved note from ctx.cart.note after refreshing. Example: sending note=Please+leave+at+the+door&_format=json to /cart/note returns {"success": true, "cart": {…}, "user_errors": [], "refresh_required": true}. A form submission redirects back with HTTP 303.

POST /cart/notify-me
{% form 'cart_notify_me' %}

Back-in-stock subscription; guests supply contact details, customers default to their account email.

Form fields

product_id Required

Out-of-stock product to watch.

variant_id Optional

Specific variant to watch.

contact_type Optional

email or sms; defaults to email.

email Optional

Required for guests using email contact.

phone Optional

Required when contact_type is sms.

Validation

Positive product/variant ids; the variant must belong to the product, which must be published to the current channel and either scheduled or out of stock. Restock alerts must be enabled. Guests may subscribe. contact_type is email (default) or sms. A signed-in customer's account email is used (or their account phone when they have no email); others enter the contact. Only channels the store can send on now are accepted: email while the Restock Notification email is on and the store can send email, sms while a messaging app sends Restock Notification texts (by SMS, WhatsApp or both). A phone is stored as a valid E.164 number.

Limits

Email is limited to 256 characters. Requests expire after the merchant-configured 1–365 day window. Repeated pending requests for the same store, product, variant and contact refresh the request. A queued request is returned unchanged; it does not create another delivery.

Response

{
  success,
  response,
  user_errors
}

success confirms the request was saved, not that a message was sent. The bridge wrapper is tringify.cart.notifyMe({product_id, variant_id?, contact_type?, email?, phone?}); it includes the CSRF token and returns this same envelope.

POST /cart/remove
{% form 'cart_remove' %}

Removes the product (or specific variant) line.

Form fields

product_id Required

Cart line's product.

variant_id Optional

Cart line's variant, when the product has variants.

line_id Optional

Required to target a line carrying properties.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

client_mutation_id Optional

Unique retry key, up to 128 characters. Reusing it for the same action prevents a successful mutation from being applied twice for 24 hours.

Validation

Positive product/variant ids; line_id targets one exact line. Bare product/variant targeting only matches a property-less line.

Limits

No action-specific numeric limit.

Response

{
  success,
  cart,
  user_errors
}
POST /cart/update
{% form 'cart_update' %}

Sets the line to quantity; 0 removes it.

Form fields

product_id Required

Cart line's product.

variant_id Optional

Cart line's variant, when the product has variants.

quantity Required

New quantity; 0 removes the line.

line_id Optional

Required to target a line carrying properties.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

client_mutation_id Optional

Unique retry key, up to 128 characters. Reusing it for the same action prevents a successful mutation from being applied twice for 24 hours.

Validation

Positive product/variant ids and integer quantity; quantity 0 removes. line_id is required for a line with properties and cannot select another visitor's line.

Limits

The final line quantity cannot exceed the current cart line's quantity plus quantity_can_add. Available inventory and the resolved variant → product → store order cap are enforced.

Response

{
  success,
  cart,
  user_errors
}

cart is the current enriched cart and is unchanged when refused.

POST /cart/discount/apply
{% form 'discount_code_apply' %}

Validates the code against the current cart, customer, market, and stacking rules, then stores it only when it can apply. Unknown or ineligible codes leave the cart unchanged.

Form fields

code Required

The discount code to apply.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

client_mutation_id Optional

Unique retry key, up to 128 characters. Reusing it for the same action prevents a successful mutation from being applied twice for 24 hours.

Validation

Non-empty code; the same store-scoped pricing evaluator used to advertise available discounts validates code existence, activity, eligibility, stacking, market, customer, and current cart conditions before the cart changes.

Limits

Applied-code count and discount limits come from order-pricing configuration. Codes that do not apply are limited to 10 per visitor session and 30 per address in 15 minutes; further attempts return CART_COUPON_ATTEMPTS_LIMITED until the window ends. Codes that apply are not counted.

Response

{
  success,
  cart,
  user_errors
}

A code that does not apply leaves the cart unchanged and returns success: false with one user_errors entry and no cart, so keep showing the current one: CART_COUPON_CODE_REQUIRED (empty code), CART_COUPON_CODE_INVALID (no code by that name in this store, or its discount is disabled), CART_COUPON_LIMIT_REACHED (the cart already holds the most codes allowed), CART_COUPON_NOT_APPLICABLE (nothing in the cart qualifies, or the shopper is outside every market), CART_COUPON_REQUIREMENTS_NOT_MET (minimum spend or quantity not reached), CART_COUPON_CUSTOMER_INELIGIBLE (not for this customer, or sign-in required), CART_COUPON_UNAVAILABLE (usage limit reached), CART_COUPON_CANNOT_COMBINE (does not combine with the cart's other discounts), CART_COUPON_BETTER_DISCOUNT (the market applies one discount per order and another one already saves more), CART_COUPON_SIGN_IN_REQUIRED (the code is for chosen customers or customer groups, and the shopper is not signed in), CART_COUPON_EMAIL_NEEDED (the code is for first orders or has a per-customer limit, and the shopper has given no account, email or phone yet; a guest enters it at checkout), CART_COUPON_CODE_EMAIL (a unique code used without the email it was sent to), CART_COUPON_NOT_STARTED (the code starts later; args.date names the day), CART_COUPON_EXPIRED (the code's dates have ended) or CART_COUPON_ATTEMPTS_LIMITED (too many codes that did not apply). Show user_errors[0].message, which is in the shopper's language, rather than your own text. The JSON response is HTTP 200 either way, so check success. A form submission redirects back with HTTP 303 and reports a refusal through form_notice. A code already applied returns success with the cart unchanged.

POST /cart/discount/remove
{% form 'discount_code_remove' %}

Removes the applied code (no-op when absent).

Form fields

code Required

The applied code to remove.

_format Optional

Set to json when submitting with fetch; omit for the normal browser redirect.

client_mutation_id Optional

Unique retry key, up to 128 characters. Reusing it for the same action prevents a successful mutation from being applied twice for 24 hours.

Validation

Non-empty code; removing a code that is not applied is an idempotent no-op.

Limits

No action-specific numeric limit.

Response

{
  success,
  cart,
  user_errors
}
POST /checkout/express/address

Platform express checkout only: re-prices the quote for the partial address the wallet sheet shares (country, region, city, postal code) and lists its shipping options. Nothing is stored.

Request fields

quote Required

quote.token from the previous express response.

address Required

The partial address the wallet sheet shares before payment: {country, region, city, postal_code}. country is an ISO 3166-1 alpha-2 code; the rest may be empty.

Validation

Requires the CSRF token and a live quote token. The country must be one the shopper's market serves. When nothing can be delivered there, the response is HTTP 422 with STOREFRONT_EXPRESS_SHIPPING_UNAVAILABLE; the sheet shows the message.

Limits

Rate limited per visitor. Only country, region, city and postal code are used before payment.

Response

{
  success:true,
  quote,
  user_errors
}

quote is {token, expires_at, currency, total:{label, amount}, display_items:[{label, amount}], shipping_options:[{id, label, amount, selected}], requires_shipping}. Amounts are integers in the currency's minor units, as wallet sheets take them; a discount display item is negative. Send quote.token with the next express action. A refusal returns success: false with user_errors (STOREFRONT_EXPRESS_UNAVAILABLE, STOREFRONT_EXPRESS_SESSION_EXPIRED, STOREFRONT_EXPRESS_SHIPPING_UNAVAILABLE, STOREFRONT_EXPRESS_ADDRESS_INVALID); the sheet shows user_errors[0].message.

POST /checkout/express/confirm

Platform express checkout only: re-prices with the full address, then places the order exactly as checkout does and charges the wallet's one-time token for exactly that total. The order is created only here.

Request fields

quote Required

quote.token from the previous express response.

wallet Required

apple_pay, google_pay, link, paypal, amazon_pay or klarna: the button the shopper tapped.

confirmation_token Required

The payment provider's one-time token from the wallet sheet.

amount Required

The total the sheet showed, as an integer in the currency's minor units.

currency Required

The sheet's currency (ISO 4217).

shipping_option_id Optional

The shipping option the shopper chose. Required when quote.requires_shipping.

shipping_address Required

The full address from the sheet: {name, address1, address2, city, region, postal_code, country, phone}. The sheet always asks for it: it is the delivery address when quote.requires_shipping and the billing address of every order.

payer Required

{name, email, phone} from the sheet. The order needs the contact the store asks for at checkout (email or phone).

Validation

Requires the CSRF token and a live quote token. The full address is validated like checkout's and the purchase is re-priced with it; stock is checked when the order is placed. When the total differs from amount/currency, nothing is charged and the response is HTTP 409 with STOREFRONT_EXPRESS_TOTAL_CHANGED and fallback_checkout_url. Otherwise the order is created through checkout's order path and the payment provider charges the token for exactly the order total.

Limits

Rate limited per visitor and challenged under heavy traffic like guest checkout (challenge_required). One order per quote: repeating a confirm returns the same order.

Response

{
  success:true,
  status,
  redirect_url,
  user_errors
}

status is paid or processing (open redirect_url: the order page, which shows the result) or requires_action (open redirect_url: the payment provider's authentication page, which returns to the order page). A refusal returns success: false with user_errors (STOREFRONT_EXPRESS_TOTAL_CHANGED, STOREFRONT_EXPRESS_ITEMS_UNAVAILABLE, STOREFRONT_EXPRESS_ADDRESS_INVALID, STOREFRONT_EXPRESS_SHIPPING_UNAVAILABLE, STOREFRONT_EXPRESS_CONTACT_REQUIRED, STOREFRONT_EXPRESS_PAYMENT_FAILED, STOREFRONT_EXPRESS_SESSION_EXPIRED, STOREFRONT_EXPRESS_UNAVAILABLE) and, when the shopper can finish at checkout, fallback_checkout_url: a checkout for the same purchase with the sheet's details filled in.

POST /checkout/express/shipping

Platform express checkout only: re-prices the quote for the chosen shipping option. Nothing is stored.

Request fields

quote Required

quote.token from the previous express response.

shipping_option_id Required

An id from quote.shipping_options.

Validation

Requires the CSRF token, a live quote token with an address, and an option id from that quote.

Limits

Rate limited per visitor.

Response

{
  success:true,
  quote,
  user_errors
}

quote is {token, expires_at, currency, total:{label, amount}, display_items:[{label, amount}], shipping_options:[{id, label, amount, selected}], requires_shipping}. Amounts are integers in the currency's minor units, as wallet sheets take them; a discount display item is negative. Send quote.token with the next express action. A refusal returns success: false with user_errors (STOREFRONT_EXPRESS_UNAVAILABLE, STOREFRONT_EXPRESS_SESSION_EXPIRED, STOREFRONT_EXPRESS_SHIPPING_UNAVAILABLE, STOREFRONT_EXPRESS_ADDRESS_INVALID); the sheet shows user_errors[0].message.

POST /checkout/express/start

Platform express checkout only (the platform express script calls it with a JSON body before the wallet sheet opens): prices the purchase for the sheet. Nothing is created, reserved or stored.

Request fields

source Required

product (buys the selected variant only; the cart is untouched), cart (buys the shopping cart) or checkout (the hosted checkout's express row: buys that checkout's purchase).

checkout_id Optional

For source checkout: the visitor's checkout, which must not have an order yet.

product_id Optional

For source product: the product id.

variant_id Optional

For source product: the selected variant id. Required when the product has variants.

quantity Optional

For source product: the quantity, default 1.

Validation

Requires the CSRF token (X-CSRF-Token header) and express checkout available for the purchase: express buttons on for the store, an express payment provider for the market and currency, and a simple purchase (no gift cards, personalised lines, discount codes, pickup, sign-in requirement or required checkout fields). Prices come from the same pricing as checkout: automatic discounts, shipping, tax, duties and fees in the shopper's currency.

Limits

Rate limited per visitor. The quote token is signed, expires after 30 minutes and belongs to the visitor session that started it. Nothing is stored: no order, cart change, stock hold or checkout.

Response

{
  success:true,
  quote,
  user_errors
}

quote is {token, expires_at, currency, total:{label, amount}, display_items:[{label, amount}], shipping_options:[{id, label, amount, selected}], requires_shipping}. Amounts are integers in the currency's minor units, as wallet sheets take them; a discount display item is negative. Send quote.token with the next express action. A refusal returns success: false with user_errors (STOREFRONT_EXPRESS_UNAVAILABLE, STOREFRONT_EXPRESS_SESSION_EXPIRED, STOREFRONT_EXPRESS_SHIPPING_UNAVAILABLE, STOREFRONT_EXPRESS_ADDRESS_INVALID); the sheet shows user_errors[0].message.

User error codes#

Code

When

STOREFRONT_CART_PRODUCT_INVALID

product_id missing or not purchasable.

STOREFRONT_CART_VARIANT_INVALID

variant_id missing for a variable product, or wrong.

STOREFRONT_CART_OWNER_REQUIRED

No usable visitor session — reload the page.

Quantity, stock, and purchase-state validation failures come back the same way — as user_errors with the CURRENT unchanged cart, never as a broken state. After a successful action, ctx.cart reflects the change on the next render.

Line properties#

A cart line can carry declared properties — the personalization channel (engraving text, a gift note). Every property key must match one of the store's cart line definitions (Settings → Metafield definitions → Cart lines, or an app's declaration), written as ".". The theme adds one input per property; the platform validates the key and the value against the definition.

vascula
{% form 'cart_add' %}
  <input type="hidden" name="product_id" value="{{ product.id }}">
  <input name="properties[custom.engraving]" maxlength="30" placeholder="{{ 'products.engraving' | t }}">
  <button type="submit">{{ 'products.add_to_cart' | t }}</button>
{% endform %}

Properties are part of LINE IDENTITY: the same product with different property values is a SEPARATE cart line (two mugs, two engravings), each with its own line_id. Cart line forms (quantity steppers, remove buttons) must post the line's line_id — bare product/variant targeting matches only the property-less line, never silently one of several personalized lines.

vascula
{% for line in cart.items %}
  {% for prop in line.properties %}<p>{{ prop[1] }}</p>{% endfor %}
  {% form 'cart_remove' %}
    <input type="hidden" name="product_id" value="{{ line.product_id }}">
    <input type="hidden" name="line_id" value="{{ line.line_id }}">
    <button type="submit">{{ 'cart.remove' | t }}</button>
  {% endform %}
{% endfor %}

Code

When

CART_PROPERTY_UNKNOWN

The key matches no cart line definition on this store.

CART_PROPERTY_INVALID

The value fails the definition's type or rules.

CART_PROPERTY_NOT_WRITABLE

The definition is not buyer-writable (hidden), or an app wrote outside its namespace.

CART_PROPERTY_TOO_MANY

More properties than one line allows.