Flying Spares, provider of spare parts for vintage cars and high quality marques, displaying a Rolls-Royce from their eCommerce Shopify development from magic42

Flying Spares

International B2B Magento with 240k catalogue, Khaos Control Integration and digital marketing.
See our work
Stone Computers Case Study by magic42

Stone Computers

Adobe Magento Commerce B2C, B2B portal and PunchOut sites and bespoke loan payment solution.
See our work
Alan Paine quality clothing retailer showing their brand, as featured in their case study for their eCommerce website with magic42

Alan Paine

Multisite, B2C migration from Magento to Shopify Plus with ERP integration.
See our work
Haws Watering Cans case study after eCommerce development agency, magic42, migrated their site to Shopify

Haws Watering Cans

B2C eCommerce strategy, UX improvements, AdWords and Klaviyo email marketing management.
See our work
Alan Paine quality clothing retailer showing their brand, as featured in their case study for their eCommerce website with magic42

Alan Paine

Multi-site, B2C migration from Magento to Shopify Plus with ERP integration.
Find out more
Roger Clark Motorsport automative eCommerce client case study from magic42, showing high quality silver cars in a slick garage

Roger Clark Motorsport

B2C and B2B migration of bespoke, global automotive parts website to Shopify.
Find out more

Call Us

Speak to a Shopify expert:

0121 663 6360

Get in touch 
magic42 - eCommerce development experts born from retail success

Born from a retailer

Read the full story of how our award-winning retail business developed into magic42.
Find out more
Envision Workshop documents as an outcome from our replatforming and migration meeting for your eCommerce website

How we'll work with you

Find out what it's like to partner with us and the steps involved for your eCommerce project.
Find out more
Alex Ashman, director of magic42, in a bumper car with a huge grin on his face as he mingles with his eCommerce development team at magic42

Looking for a career with us?

Take a look at what it's like to work at magic42 and the opportunities we offer.
Find out more

Call Us

Speak to our eCommerce experts:

0121 663 6360

Get in touch 

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

Alex Ashman
September 21, 2021

As an eCommerce and Shopify development agency, 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. 

Adding a Shopify Discount Code example GIF

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.

Variant ID
  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 our Shopify agency or Shopify Plus development agency.

magic42 logo
magic42 is a UK-based eCommerce development agency, born from an award-winning retailer. Having grown with the industry since the year 2000, we provide our unique perspective to help clients get the best from their eCommerce platforms.
Company No. 11572347 VAT No. 310 2436 61
Adobe Solution Partners Bronze Logo, used by verified Adobe expertsShopify Partners Logo (as used by Shopify Development Partners)
© Copyright 2024 magic42 Limited - All Rights Reserved
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram