Download our free guide - 42 ways to improve your product page
Flying Spares Case Study by magic42

Flying Spares

International B2B Magento with 240k catalogue, Khaos Control Integration and digital marketing.
Find out more
Stone Computers Case Study by magic42

Stone Computers

Adobe Magento Commerce B2C, B2B portal and PunchOut sites and bespoke loan payment solution.
Find out more

Alan Paine

Multisite, B2C migration from Magento to Shopify Plus with ERP integration.
Find out more
haws case study image (1)

Haws Watering Cans

B2C eCommerce strategy, UX improvements, AdWords and Klaviyo email marketing management.
Find out more

Alan Paine

Multisite, B2C migration from Magento to Shopify Plus with ERP integration.
Find out more
Berry Flirt smoothie pouring into a glass

Berry Flirt

Fast moving B2C theme and bundling solution on Shopify
Find out more

Call Us

Speak to a Shopify expert:

0121 663 6360

Get in touch 
September 21, 2021

How to automatically add a discounted product to checkout via a link on Shopify

We’re going to show you how to create an automatically generated discount checkout link in Shopify.

Automatic discount checkout links can be set up very quickly and be very effective for your marketing campaigns.

This feature can be used for anything from pre-order offers, flash sales, or discount codes.

In this article, we will show you how to create automatically generated discount links and how they can be used to drive additional sales to your Shopify store.

How to add discount codes automatically to Shopify checkouts?

  1. How to create a discount in Shopify
    1. Create a manual checkout link
    2. Find your product variant ID
    3. Create an automatically discounted checkout link
  2. When would you use automatically discounted checkout links?
    1. Use automatically discounted checkout links on your website
    2. Using automatically discounted checkout URLs for marketing campaigns
  3. Looking for Shopify support?

How can creating automatic discount links in Shopify help enhance your customers’ experience?

Entering discount codes manually can be a nuisance for customers and can even be a barrier to purchase if they are not easy enough to apply at checkout. They can be especially difficult for users to apply when using smaller devices like mobiles and tablets. 

Automatically generated discount URLs in Shopify solve this problem. They allow you to send customers directly to your store checkout without the need to enter a discount code. 

This means that you can create offers quickly for your customers and run effective, sales-driven marketing campaigns that encourage customers to use your offers.

1. How to create a discount in Shopify

Applying discounts in Shopify is very straightforward.

Shopify allows you to create instant discounts that can be applied at both store and product level.

You can choose from different product variants, quantities and discounts when setting them up so that every customer has their own tailored experience with your store. 

So, how do you create a discount in Shopify?

  1. Go to “Discounts” from your Shopify admin panel
  2. Click “Discount codes”
  3. Go through and select your discount. You can choose from “percentage discounts” as “buy x get x free”
  4. Go through and adjust each setting accordingly and click save.  

A manual checkout link enables you to send your customers directly to the checkout of a particular product via a URL that is created with product variants.

If you want to generate a checkout link for a specific product, then you can do this by adding parameters to the end of your store domain.

Your checkout link needs to begin with your store’s domain, with /cart/ at the end (e.g.

You can then add your product variant ID and quantity to the end of the URL, separated by commas if you wish to add multiple products to the checkout.

Note: To find a product variant ID, click here.

A one-variant checkout link should look like this:

1.2 How to find a product variant ID in Shopify

In order to find the variant ID for a particular product, you need to follow these steps.

  1. Go to “Products” and search for a product that you know has different variants. (Whether that be colour, size etc)
  2. Select the product and scroll down to the variants on the product page.
  3. Select “Edit” and it will bring up that particular product variation.
  4. You will notice in the address bar a number at the end of that particular page URL. This is your variant ID which you will need to create a checkout link for that particular product. (40524549324974 in the example below)

The product variant URL should display something like this below:

You may want to run offers on single products that have no variants. In this case, you will have to use a different method in order to find your variant ID.

  1. Select a product that you wish to run an offer on.
  2. Go to the URL of that particular page in the address bar and add “.xml” onto the end of the page URL.
  3. Scroll down and you will see the variant section. Take that first ID line and that will be your product ID which you can use for your discount offer. (40524549324974 in the video example)

Now that you understand how to add a discount and find the variant ID of a product, you can now use this information to create an automatic checkout link. This will send customers directly to checkout without the need to manually input any discount codes. 

Note: You must set up a discount in Shopify before creating a discount checkout link.

Apply a discount to the checkout by adding:


to the end of your checkout link. For example, if you have a discount code titled “10off” to offer customers 10% off your products, add


to the end of the link.

The discount is applied automatically when a customer checks out using the specific link, as you can see from the image below.

Your link should display as something like this:

Creating discount codes as links gives your customers a quick way to access offers exclusive only to that URL.

You can create a very personalised experience for customers as well as continue to provide them value.

So, how exactly would your customers be able to use these kinds of checkout links?

Automatically generated discount codes can be used as checkout links in webpages as regular links or buttons.

This is a great way to increase customer engagement with your website as it cuts out the product selection steps and takes them directly to a point of sale, in turn driving more revenue to your business. 

2.2. Using automatically discounted checkout URLs for marketing campaigns

They can also be shared directly with customers when being used in email campaigns, social media posts, or chat messages.

This is another great way to encourage users to interact with your store and drive sales. You can also run offers against each other to see which of your campaigns prove most effective.

3. Looking for Shopify Support?

If you are looking for assistance in finding out more about Shopify as a platform, then please do not hesitate to get in touch with one of our Shopify development team who will be more than happy to assist you.

magic42 is unique in that it evolved from Mobile Fun, an award-winning online retailer with 20 years of experience, 27 international websites and a global distribution network managed from the heart of Birmingham.
Company No. 11572347 VAT No. 310 2436 61
© Copyright 2023 magic42 Limited - All Rights Reserved
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram