Skip to content
logo
  • Company
    Company
    • About Us
    • Testimonials
    • Infrastructure
    • Culture & Values
    • Career
    • Life At BrainSpate
  • Technology
    Technology
    • WooCommerce
    • Shopify
    • Magento
    • Salesforce
  • Hire eCommerce
    Hire eCommerce
    • Hire WooCommerce Developers
    • Hire Shopify Developers
    • Hire Magento Developers
  • eCommerce
    eCommerce
    • eCommerce Development
    • eCommerce Marketplace
    • eCommerce Website Design
    • eCommerce Website Packages
    • eCommerce Management
    • eCommerce Consultant
    • B2B eCommerce
    • B2C eCommerce
    • Headless Commerce
    • eCommerce Maintenance
    • eCommerce Implementation
    • eCommerce Migration
  • Portfolio
  • Blog
  • Contact Us

How to Create an Add to Cart Link in Shopify

Quick Summary

  • Shopify ATC links allow you to add specific product variants directly to a customer’s cart through a custom URL.
  • You can create these links manually using the variant ID and quantity and even combine multiple products in one link.
  • Adding ?checkout at the end lets you skip the cart page and take users straight to checkout, speeding up the purchase process.
  • These links can be used in campaigns, pre-apply discounts, and automate sales workflows—especially with the help of Shopify development services.
publisher
Ankur Shah
|May 22, 2025
15 min read
How to Create an Add to Cart Link in Shopify
Table Of Contents
  • What is a Shopify ATC Link?
  • How to Create a Cart Permalink from Shopify Admin
  • How to Create Shopify ATC Links Manually?
  • How a Shopify ATC Link is Built?
  • How to Find Shopify Variant IDs?
  • Automating Shopify Add to Cart Links
  • Tips for Using ATC Links
  • ATC Link Security: Best Practices for Merchants
  • FAQs About Shopify ATC Links
  • Let’s Summarize

Creating a smooth shopping experience is key to driving conversions on any online store. One simple yet powerful tool many store owners overlook is the Shopify Add to Cart (ATC) link. It lets users skip the product page and add items directly to their cart, or even go straight to checkout if needed.

Whether you’re promoting a product through email, social media, or a landing page, an ATC link makes the buying process faster and easier. No distractions. No drop-offs. Just a quick path to purchase.

In this guide, we’ll show you how to create, customize, and automate Shopify ATC links. If you’d rather leave the technical stuff to professionals, consulting Shopify development experts can help you easily set it up.

What is a Shopify ATC Link?

In Shopify, every product has variants such as size, color, or material. So, when someone adds a product to their cart, they’re actually adding a specific variant.

A Shopify ATC (Add to Cart) link lets you skip the usual process of going to the product page and choosing options. Instead, you just share a URL that instantly adds the product (with the selected variant) to the customer’s cart when they click it. It’s fast, direct, and super useful for promotions, emails, or even customer support chats.

Basic Format

Here’s what the basic link looks like:

https://examplestore.com/cart/VARIANT_ID:QUANTITY
  • VARIANT_ID is the unique ID of a product variant (like a medium-sized blue t-shirt).
  • QUANTITY is how many units you want to add.

Example

https://examplestore.com/cart/41059824312345:1

Clicking this adds 1 product unit with that variant ID directly to the cart.

Multiple Products in One Link

You can also add several products to the cart using a single link. Just separate each variant and quantity with a comma:

https://examplestore.com/cart/41059824312345:1,41059824367890:2

This link will:

  • Add 1 unit of the first product
  • Add 2 units of the second product

It’s a great way to bundle products or share custom combos.

Redirect to Checkout

Want to send users straight to checkout, skipping the cart page? Just add? Check out at the end of the link:

https://examplestore.com/cart/41059824312345:1?checkout

This instantly takes the user to the payment step, and their selected items are ready to go.

How to Create a Cart Permalink from Shopify Admin

Shopify makes it easy to generate a cart permalink directly from your Shopify store’s dashboard. This link adds a specific product variant to the cart, which is ready for checkout. By default, each permalink includes one variant, but you can build more complex links manually if needed.

Note: Before starting, make sure you have the Buy Button sales channel installed in your Shopify admin.

Steps to Create a Cart Permalink:

  1. In your Shopify admin, navigate to Products.
  2. Select the product for which you want to create a cart permalink.
  3. Click the More Actions dropdown menu.
  4. Choose the Create Checkout Link from the menu.
Shopify Addidas Back pack
  1. Select the desired product variant.
  2. Click the Copy link to get your cart permalink ready to share.
Check Out Link

This simple process lets you quickly generate direct add-to-cart links without any coding. For more complex carts with multiple variants, consider manually building the links or using automation tools.

Generating ATC Links for Other Websites

The Shopify Buy Button app offers an easy way to create embeddable “Add to Cart” or “Buy Now” buttons that you can place on any external website, such as WordPress or Wix.

How it works:

  1. Install and open the Buy Button app in your Shopify admin.
Buy Button
  1. Choose a product or collection to create a Buy Button for.
Buy Button
  1. Select the product. Customize the button’s style and settings as desired.
Adidas Classic Back Pack
  1. Copy the generated embed code (HTML/JavaScript).
Get Your Buy Button
  1. Paste this code into the HTML of your external website page.
Shopify ATC Link
  1. Check the output on the front end after saving the changes.
Shopify ATC Link Example

This method allows customers to add products directly to their cart or purchase without leaving the external site, seamlessly connecting back to your Shopify checkout. It’s perfect for expanding sales channels beyond your Shopify store.

Want to Create High-Converting Cart and Checkout Links? We Can Help!
Get Started

How to Create Shopify ATC Links Manually?

Now that you understand what a Shopify ATC (Add to Cart) link is and how to find product variant IDs, it’s time to bring it all together. Building an ATC link manually is simple once you know the structure.

ATC links are especially useful for quick promos, landing pages, and support interactions. Here’s a step-by-step guide to creating ATC links on your own:

Step 1: Choose the Product Variant

Start by identifying the exact product variant you want to link to. For example, it might be something like “Red Hoodie – Size L.” Each variant in Shopify has a unique ID that you’ll need to build the link. To find the variant ID, you can use Shopify’s .json endpoint:

https://yourstore.com/products/product-handle.json

Once you open that URL, search for the variants array in the JSON output. It will look something like this:

{

  "id": 42555111222333,

  "title": "Red / Large"

}
Code Language

That ID is the variant ID you need for the link.

Tip: Use your browser’s “Find” (Ctrl+F or Cmd+F) to search for the word variants or id to locate it quickly.

Step 2: Insert the Variant ID into the Link Structure

Once you have the variant ID, plug it into the standard ATC link format:

https://yourstore.com/cart/VARIANT_ID:QUANTITY

Just replace the placeholder values with the actual variant ID and desired quantity. For example:

https://yourstore.com/cart/7929880182858:1

This link adds 1 unit of the Red / Large hoodie to the user’s cart as soon as they click it. You can use this format in emails, ads, chat support, or even embedded buttons.

Step 3: Add Multiple Products (Optional)

Want to link to a bundle of products? You can include multiple items in a single ATC link by separating them with commas:

https://yourstore.com/cart/42555111222333:1,42555111222444:2

This link does the following:

  • Adds 1x Red Hoodie (Large)
  • Adds 2x Black Hoodie (Medium)

It’s perfect for curated combos, suggested pairings, or limited-time offers involving more than one product.

Step 4: Redirect Directly to Checkout (Optional)

To remove one more step from the purchase journey, you can take the user straight to the checkout screen instead of the cart page. Just add? Check out the end of your link:

https://yourstore.com/cart/42555111222333:1?checkout
Price at Cart

This instantly opens the checkout page with the chosen product(s) pre-loaded, reducing friction and boosting your chances of conversion.

How a Shopify ATC Link is Built?

Understanding how a Shopify ATC (Add to Cart) link is structured is the first step to using it effectively. These links follow a consistent pattern, which makes them easy to create, reuse, and even automate for different marketing and sales campaigns.

Let’s break down the structure and its key components:

Basic Format

The base format looks like this:

https://yourstore.com/cart/VARIANT_ID:QUANTITY
  • VARIANT_ID: The unique identifier for a specific product variant (for example, a medium-sized blue hoodie).
  • QUANTITY: The number of units you want to add to the cart.

Example:

https://shoestore.com/cart/42342342342342:1

When someone clicks this link, 1 unit of the selected variant is automatically added to their cart.

Multiple Products

You can include multiple product variants in a single link by separating each with a comma:

https://shoestore.com/cart/42342342342342:1,42342342342399:2

What this does:

  • Adds 1 unit of the first variant
  • Adds 2 units of the second variant

This is especially useful for:

  • Product bundles
  • Promotional sets
  • Cross-sell or upsell campaigns

Optional: Redirect to Checkout

Want to reduce the number of steps in the buying process? You can redirect users directly to the checkout page by adding? Check out the end of your ATC link:

https://shoestore.com/cart/42342342342342:1?checkout

This is great for:

  • Limited-time offers
  • Flash sales
  • Conversion-focused campaigns

By skipping the cart page, you’re removing friction and nudging users closer to completing their purchase.

How to Find Shopify Variant IDs?

To create a Shopify ATC (Add to Cart) link, you first need the variant ID. This is a unique number tied to a specific version of a product like “Blue, Size L.” Shopify assigns these IDs automatically when you add product variants.

Even if you don’t have backend access, there are multiple quick ways to find these IDs. Let’s walk through the most reliable ones:

Method 1: View Page Source

  1. Open the product page on your browser.
  2. Right-click anywhere and select “View Page Source.”
  3. Use Ctrl+F (or Cmd+F on Mac) and search for:

 “variantId” or “variants”

You’ll see raw product data embedded in the page’s HTML. From there, you can find variant IDs. This works well when you just need one or two IDs quickly.

Method 2: Use the .js Endpoint

Shopify stores expose product data through a simple .js file:

https://yourstore.com/products/product-handle.js

Example:

https://hatsworld.com/products/blue-cap.js

Open this in your browser. It’ll return the product’s structured data (in JavaScript object format), including all its variant IDs.

Method 3: Use the .json Endpoint (Recommended)

This is the cleanest and most developer-friendly option. Use this pattern:

https://yourstore.com/products/product-handle.json

Example:

https://hatsworld.com/products/blue-cap.json

Look inside the variants array:

{

  "variants": [

    {

      "id": 42678912345678,

      "title": "Blue / Medium",

      ...

    }

  ]

}

This is the most developer-friendly and automation-ready option.

Method 4: Use Shopify Admin API (Advanced)

If you have backend access (as a developer or merchant), you can fetch variant IDs using the Shopify Admin API.

  • Requires API credentials (private or custom app)
  • Useful for bulk product management
  • Ideal for automation or data-syncing tasks

Finding the right variant ID is the foundation of any ATC link. Once you’ve grabbed it, creating fast, frictionless cart experiences becomes a straightforward task.

Automating Shopify Add to Cart Links

If you’re managing hundreds of products or planning big marketing campaigns, manually creating ATC links won’t scale well. That’s where automation saves time and reduces human error. Here are two simple ways to automate link generation:

Use a Python Script

A basic Python function can generate ATC links using variant data. Here’s a simple example:

Example script:

def build_atc_link(store_url, variants):

    base = f"{store_url}/cart/"

    items = ",".join([f"{vid}:{qty}" for vid, qty in variants])

    return base + items

# Example usage

store = "https://mystore.com"

variant_data = [(42555111222333, 1), (42555111222444, 2)]

print(build_atc_link(store, variant_data))

Output:

https://mystore.com/cart/42555111222333:1,42555111222444:2

Method 2: Use Google Sheets + Formulas

If you’re not into coding, use Google Sheets to automate link building:

  1. Create columns for Store URL, Variant ID, and Quantity.
  2. Use a formula like this:
=CONCATENATE(A2,"/cart/",B2,":",C2)
  1. For multiple products, use TEXTJOIN():
=CONCATENATE(A2,"/cart/",TEXTJOIN(",", TRUE, D2:D4))

Here, D2:D4 should have entries like 42555111222333:1.

Add Checkout Automatically

To make any link auto-redirect to checkout, just append:

?checkout

Final automated link:

https://mystore.com/cart/42555111222333:1,42555111222444:2?checkout

Automating ATC link generation is a huge time-saver, especially for large catalogs, promo drops, or campaigns. With just a bit of setup, you can handle hundreds of links without lifting a finger.

Tips for Using ATC Links

ATC (Add to Cart) links are more than just shortcuts; they’re flexible, powerful tools that can improve user experience, boost conversion rates, and support smarter marketing campaigns. Let’s break down some of the most effective ways to get more out of your ATC links.

Use ATC Links to Pre-Apply Discounts

You can combine an ATC link with a discount code to give customers an instant deal when they land on the checkout page:

https://yourstore.com/cart/42555111222333:1?discount=SUMMER%20SALE

This does two things at once:

  • Adds the product to the cart
  • Applies the SUMMER SALE discount automatically at checkout

Tip: Replace spaces in your discount code with %20 (URL encoded space).

Link Directly to Subscriptions or Bundles

If your store uses third-party apps to manage subscriptions or product bundles, those options often come with unique variant IDs. That means you can build ATC links for:

  • Monthly or annual subscription options
  • Pre-built product bundles or kits
https://yourstore.com/cart/50001111222233:1?checkout

This encourages repeat purchases or larger average order values without extra clicks. Just make sure the variant ID matches the bundled or subscription SKU.

Customize with URL Parameters (Hidden Features)

Many Shopify themes or apps recognize URL parameters beyond basic cart and discount functions. You can use these extras to enhance tracking or user interaction.

Some common uses:

  • Track campaign performance:

?utm_source=instagram&utm_medium=story

  • Trigger custom theme behavior or popups:

?show_gift=true

  • Example combined link:
https://yourstore.com/cart/42555111222333:1?utm_source=instagram&show_gift=true

This helps tie your ATC link to specific marketing efforts or experiences.

Don’t Skip Testing

It’s easy to assume your ATC links will just work, but themes, apps, and browser quirks can cause issues.

Make sure to:

  • Test on mobile and desktop
  • Try multiple browsers (Chrome, Safari, etc.)
  • Verify that discounts and products load as expected

Also, double-check variant IDs regularly. If a product gets deleted, duplicated, or reconfigured, old variant IDs might break, leading users to a 404 or empty cart.

Combine with Shopify Scripts for Advanced Logic

If your store is on Shopify Plus, you can take things even further with Shopify Scripts. These allow advanced checkout customizations that can trigger when a user arrives via a specific ATC link.

What you can do:

  • Offer tiered discounts based on cart value
  • Add a free gift when a specific product is in the cart
  • Apply custom shipping rules or messaging

Result: Dynamic cart behavior that adapts to how the customer enters the funnel—super powerful for targeted marketing and high-volume sales.

ATC Link Security: Best Practices for Merchants

While Shopify ATC links are great tools, merchants need to be mindful of potential risks and ensure their store stays secure and functional. Proper precautions help maintain control and protect your revenue.

Prevent Unauthorized Discount Abuse

When using ATC links with discount codes, be cautious about sharing publicly. If a discount code is embedded like this:

https://yourstore.com/cart/42555111222333:1?discount=SUMMER%20SALE

It can be shared beyond your intended audience, leading to unwanted discount abuse.

To reduce risk:

  • Use unique, limited-time discount codes.
  • Monitor discount usage closely via Shopify reports.
  • Combine discounts with customer account restrictions.

Regularly Audit Variant IDs

Product variants can be deleted or changed, which breaks ATC links.

Make it a habit to:

  • Review variant IDs in your links after product updates.
  • Set up automated alerts or scripts to verify link validity.
  • Update marketing materials immediately if variants change.

Use URL Parameters Wisely

Avoid adding too many custom URL parameters that may conflict with Shopify apps or your theme. Excessive parameters can cause unexpected behavior or errors in checkout.

Test new ATC links thoroughly to ensure they function across devices and browsers.

Limit Bot Traffic

Since ATC links can be used in bots or automation tools, high bot traffic might strain your store’s resources or cause inventory issues.

Mitigate this by:

  • Implementing bot detection and throttling apps.
  • Monitoring unusual spikes in cart additions or checkouts.

Taking these precautions ensures that your Shopify ATC links work smoothly without compromising your store’s security or sales integrity. With proper management, you can enjoy the benefits of ATC links while minimizing potential downsides.

FAQs About Shopify ATC Links

How to generate a payment link in Shopify?

To generate a payment link in Shopify, create a draft order in Orders > Create Order, add products, then click Email invoice or Copy payment link. This link sends users to checkout.

How do I create a tracking link in Shopify?

When fulfilling an order, enter the tracking number and carrier. Shopify generates a tracking link that is sent via email and shown on the order status page.

How to make a Shopify add to cart link?

To create a Shopify ATC link, use: https://yourstore.com/cart/VARIANT_ID:QUANTITY
Replace VARIANT_ID and QUANTITY with real values. Clicking the link adds the product to the cart.

How do I create a custom add to cart button on Shopify?

Add a button with a custom link: <a href=”/cart/1234567890:1″>Add to Cart</a>
Replace the ID with the product variant ID.

How to add a sticky add to cart in Shopify?

Use a Sticky Add to Cart app or add a custom fixed-position button in your theme code. Make sure it stays visible while scrolling.

Let’s Summarize

Shopify ATC links are a quick and powerful way to improve the shopping experience. Whether you’re adding single products, bundles, or applying discounts, these links save time and reduce clicks for your customers. Once you understand how to find variant IDs and build the links, the process becomes fast and repeatable.

With a bit of testing and automation, you can use ATC links to boost conversions and streamline campaigns.

If you want help setting up advanced cart links, integrating subscriptions, or customizing your checkout experience, we can help. With our expertise, you can boost conversions and make your store more efficient, flexible, and user-friendly. Contact us today and get started with your project!

Share this story, choose your platform!

facebook twitterlinkedin
publisher

Ankur Shah

Ankur Shah is a tech-savvy expert specializing in eCommerce solutions. With a deep understanding of WooCommerce and Shopify, he helps businesses optimize their online stores for success. Whether it's implementing new features or troubleshooting issues, Ankur is your go-to guy for all things eCommerce.

PreviousNext
Let's build a custom eCommerce store.
At BrainSpate, we recognize the power of standing out from the crowd in an effort to get more customers and product admirers. For that, you can have a consultation with us and get a free quote.
Get Free Quote
Standing Man
logo

BrainSpate is a top eCommerce development company that specializes in providing top-notch online business solutions. We cater to businesses of all sizes and offer a range of eCommerce development services.

SocialIcons SocialIcons SocialIcons SocialIcons

Our Expertise

  • eCommerce Development
  • Shopify Development
  • WooCommerce Development
  • Magento Development
  • Salesforce Development

Countries We Serve

  • CountryIcons

    Switzerland

  • CountryIcons

    Canada

  • CountryIcons

    Sweden

  • CountryIcons

    Australia

  • CountryIcons

    United Kingdom

Contact Us

  • +1 803 310 2526
  • [email protected]
  • 919, City center 2 ,
    Science City Road,
    Ahmedabad - 380060, India.
  • 3520 Aria DR,
    Melbourne
    Florida, 32904, USA.
© Copyright 2025 BrainSpate
  • All Rights Reserved
  • Privacy
  • Policies
  • Terms of Services
  • Sitemap