/wishlist/add
{% form 'wishlist_add' %}
Saves the product; requires wishlist enabled. Guests allowed when the store permits.
Form fields
-
product_idRequired Product to save.
-
variant_idOptional Specific variant to save.
-
properties[<namespace>.<key>]…Optional Declared buyer-writable wishlist-line properties.
-
_formatOptional Set to json when submitting with fetch; omit for the normal browser redirect.
-
client_mutation_idOptional 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; wishlist and guest-wishlist policy, ownership, product validity, and login requirements are enforced.
Limits
Merchant-configured wishlist_max_items; default 100, configurable from 1 to 1000.
Response
{
success,
wishlist,
user_errors
}
/wishlist/clear
{% form 'wishlist_clear' %}
Empties the wishlist.
Form fields
-
_formatOptional Set to json when submitting with fetch; omit for the normal browser redirect.
-
client_mutation_idOptional 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 wishlist owner; wishlist availability and login policy are enforced.
Limits
No action-specific numeric limit.
Response
{
success,
wishlist,
user_errors
}
/wishlist/move-to-cart
{% form 'wishlist_move_to_cart' %}
Validates and adds the selected purchasable line, then removes the exact saved row in the same transaction.
Form fields
-
product_idRequired Saved product to move.
-
variant_idOptional Destination variant; required when the product has variants.
-
wishlist_variant_idOptional Variant on the saved row. Omit for a product-level saved row.
-
wishlist_identity_hashOptional Identity hash of the exact saved row.
-
quantityOptional Cart quantity; defaults to 1.
-
client_mutation_idOptional 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
The saved row must exist. The destination product, selected variant, quantity, channel visibility, inventory, purchase state, and order limits use the canonical cart validation path.
Limits
Quantity defaults to 1 and uses the cart line quantity limits.
Response
{
success,
cart,
user_errors
}
cart addition and wishlist removal commit atomically.
/wishlist/remove
{% form 'wishlist_remove' %}
Removes the saved product.
Form fields
-
product_idRequired Product to remove.
-
variant_idOptional Specific saved variant.
-
identity_hashOptional Required to target one exact saved line when it carries properties.
-
_formatOptional Set to json when submitting with fetch; omit for the normal browser redirect.
-
client_mutation_idOptional 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 a valid wishlist owner; removing an absent item is idempotent.
Limits
No action-specific numeric limit.
Response
{
success,
wishlist,
user_errors
}
/wishlist/toggle
{% form 'wishlist_toggle' %}
Adds when absent, removes when present — one form for both states.
Form fields
-
product_idRequired Product to toggle.
-
variant_idOptional Specific variant to toggle.
-
properties[<namespace>.<key>]…Optional Declared buyer-writable wishlist-line properties used to identify the saved line.
-
identity_hashOptional Targets one exact existing saved line when toggling it off.
-
_formatOptional Set to json when submitting with fetch; omit for the normal browser redirect.
-
client_mutation_idOptional 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
Same policy and product validation as add; adds when absent and removes when present.
Limits
Merchant-configured wishlist_max_items applies when toggle adds an item.
Response
{
success,
wishlist,
user_errors
}
User error codes#
Code |
When |
|---|---|
STOREFRONT_WISHLIST_DISABLED |
The store has wishlists off — hide the UI via ctx.wishlist.enabled. |
STOREFRONT_WISHLIST_LOGIN_REQUIRED |
Guest wishlists are off and the visitor isn't logged in (ctx.wishlist.login_required). |
STOREFRONT_WISHLIST_MAX_ITEMS |
The wishlist is full (ctx.customer_settings.wishlist_max_items). |
STOREFRONT_WISHLIST_PRODUCT_INVALID |
product_id missing or wrong. |
STOREFRONT_WISHLIST_VARIANT_INVALID |
variant_id wrong for the product. |
STOREFRONT_WISHLIST_OWNER_REQUIRED |
No usable visitor session — reload the page. |