Coming soon: Blockly Checkout Customizer — validation rules, upsells & checkout analytics.Get early access
Tutorial

Shopify Checkout Links: Pre-fill Products, Discounts and Customer Details

One link can send a customer straight to checkout with products in the cart, a discount applied and their email filled in. Here is how Shopify cart permalinks work and how to use them safely.

Shopify Checkout Links: Pre-fill Products, Discounts and Customer Details

Every extra click between "I want this" and "order placed" is a chance to lose the customer. For campaigns where you already know what someone wants to buy, you can skip most of those clicks. Shopify cart permalinks let you build a single link that loads specific products into checkout, applies a discount code, and even fills in the customer's email and address.

This guide covers the link format, the parameters you can add, practical use cases, and the pitfalls that catch merchants out.

A normal campaign flow looks like this: email, product page, choose variant, add to cart, cart page, checkout, enter code. A checkout link turns that into: email, checkout.

That shorter path is useful when:

  • The customer has already decided, for example a reorder reminder.
  • The offer is a specific bundle, for example "the starter kit".
  • The buyer is on mobile and typing is painful.
  • A sales rep has agreed the order with the customer and just needs them to pay.

The basic format

A cart permalink uses variant IDs and quantities:

https://your-store.com/cart/VARIANT_ID:QUANTITY

For multiple products, separate them with commas:

https://your-store.com/cart/41234567890:1,41234567891:2

This creates a new checkout containing one of the first variant and two of the second.

Finding variant IDs

Open the product in the Shopify admin and click the variant. The variant ID is the number at the end of the URL in your browser. Make sure you use the variant ID, not the product ID. Products with a single variant still have a variant ID.

Adding a discount code

Append discount as a query parameter:

https://your-store.com/cart/41234567890:1?discount=WELCOME10

The code is applied at checkout if it is valid for that cart and customer. If the code has eligibility rules, minimums, or has expired, it will not apply, so test the exact link you send.

Pre-filling customer details

Shopify supports a set of prefill parameters for checkout fields. The common ones are:

ParameterFills
checkout[email]Email address
checkout[shipping_address][first_name]First name
checkout[shipping_address][last_name]Last name
checkout[shipping_address][address1]Street address
checkout[shipping_address][city]City
checkout[shipping_address][zip]Postal code
checkout[shipping_address][country]Country

A full example:

https://your-store.com/cart/41234567890:1?discount=VIP15&checkout[email][email protected]&checkout[shipping_address][first_name]=Jane

Remember to URL-encode values, for example spaces as %20 and @ as %40 if your tool requires it.

Supported prefill parameters can change as Shopify updates checkout. Always test your links before a campaign goes out.

Adding notes and attributes

You can also pass an order note and cart attributes, which is useful for tracking where an order came from:

https://your-store.com/cart/41234567890:1?note=Gift%20order&attributes[source]=sms-campaign

Attributes appear on the order in the admin, so your team can see that the order came from a specific campaign or rep.

Adding UTM tracking

Add standard UTM parameters so the visit is attributed correctly in your analytics:

https://your-store.com/cart/41234567890:1?discount=SPRING&utm_source=newsletter&utm_medium=email&utm_campaign=spring-sale

Because the link skips product and cart pages, your analytics will show sessions landing directly in checkout. Keep that in mind when you read funnel reports. Our guide on checkout funnel analytics explains how to interpret those numbers.

Use cases

  • Email and SMS campaigns. "Reorder your usual" with the customer's last products and email prefilled.
  • Influencer links. A link that loads the featured product with the influencer's code already applied, so followers do not have to type it.
  • Sales reps. A rep builds a custom cart for a wholesale or phone customer and sends a single link to pay.
  • QR codes. Print a QR code on packaging, flyers, or in-store signage that loads a refill product directly.
  • Abandoned cart follow-ups. Shopify's own abandoned checkout emails already restore the checkout, but for custom flows, a permalink can rebuild a simplified cart.
  • Bundles. Promote a fixed set of products as one offer without building a bundle product.

Step-by-step setup

  1. Collect variant IDs for each product in the offer.
  2. Build the base link with variant IDs and quantities.
  3. Add the discount code if there is one, and confirm it is valid for those products.
  4. Add attributes and UTMs so you can track results.
  5. Add prefill fields only where you have the data, typically in personalized email or SMS.
  6. Shorten the link if it is going into SMS or print, using a shortener you trust.
  7. Test on desktop and mobile, logged in and logged out, before sending.

Pitfalls and edge cases

  • Variant IDs change. If you delete and recreate a product or variant, the old ID stops working. Links in old emails or printed QR codes will break. Prefer editing variants over recreating them.
  • Out of stock items. If a variant is out of stock and does not allow overselling, the customer may see an error or a cart missing that item. Check inventory before big sends.
  • Discount validity. Expired codes, usage limits, or customer eligibility rules can silently prevent the discount from applying, and the customer then pays full price and feels misled.
  • Links bypass cart page logic. Anything that lives on your cart page, like gift wrap options, terms checkboxes, minimum order messages, or cart upsells, will not run. If those rules matter, enforce them at checkout with validation instead. See our guide on minimum order values at checkout for an example.
  • Privacy. Do not put personal data in links that may be shared publicly, like influencer or social links. Prefill only in one-to-one messages.
  • Shared links. A personalized link forwarded to someone else will prefill the original customer's email. Keep prefill minimal.
  • Market and currency. Links may open in the store's default market. Test for each market you sell to.

How to do it with Blockly Checkout Customizer

Checkout links skip your cart page, so any rules that live only in your theme stop working. Blockly Checkout Customizer, launching soon on the Shopify App Store, helps by moving important rules into checkout itself, where every link still has to pass them:

  1. Add validation rules for conditions that used to live on the cart page, such as minimum order value or restricted product combinations.
  2. Add payment and delivery rules, such as hiding COD for high-value carts, that apply no matter how the customer arrived.
  3. Test your campaign links against these rules before sending.

Because the rules run as Shopify Functions, they apply consistently to permalinks, cart pages, and express checkouts alike.

Takeaway

Cart permalinks are one of the simplest ways to shorten the path to purchase. Use the /cart/VARIANT_ID:QUANTITY format, add a discount, attributes, and UTMs, and prefill customer details only in personal messages. Test every link before it goes out, watch for changed variant IDs and stock, and make sure your important rules live in checkout so links cannot skip them.

Up nextCheckout Upsells on Shopify: Product Offers That Don't Hurt Conversion

Related articles

More tutorial articles →
Free forever plan

Ready to protect
your store?

Join 5,000+ Shopify merchants. Install in 30 seconds and block your first bad actor today.

  • No credit card
  • 5-minute setup
  • Cancel anytime