How Create a Unique URL to Add a Product to Shopify Cart
· Updated
2 min read

How Create a Unique URL to Add a Product to Shopify Cart

Table of Contents

TL;DR

Shopify cart permalinks let you send shoppers straight to a preloaded cart using a unique URL, making checkout faster and reducing friction. The link must use variant IDs, not product IDs, and can include quantities and even a discount code, such as /cart/{variant_id}:{quantity}?discount=test. These links are useful for sales channels, buttons, emails, social posts, and chat messages because they simplify the buying flow without requiring complex payment or order handling.

To make the checkout process smoother for your customers, you can create a unique URL that will take the customers directly to the cart with a single quantity of the product already present in it.

However, the process is a little tricky but still doable if you follow the steps properly.

A cart permalink refers to the unique URL that takes the customers directly to the checkout screen where the items have been pre-loaded in the cart. A permalink looks like this:

http://your-store.myshopify.com/cart/70881412:1,70881382:1

In this link, the 70881412 refers to the unique variant ID, while 1 is the product quantity that is pre-added to the cart. You can create a permalink for your store using the following format:

http://yourstore.com/cart/#{variant_id}:#{quantity}(,…)

If you want to give your customers added incentives, you can directly put a discount on the cart permalink. Here’s the format for applying a discount:

/cart/{variant_id}:{quantity}?discount=test

In this format, the test refers to the string value for the discount code.

You can use cart permalinks for creating a sales channel app for your store or share them directly with customers. Such links work best in cases where buyers purchase items from one merchant. Cart permalinks can be embedded in webpages as links or buttons, or shared through email campaigns, social media posts, and chat messages. You need a low integration effort to build this sales channel because:

  • The app doesn’t have to process payments or make checkouts
  • The app doesn’t have to handle disputes, sync orders, or deal with refunds

When creating a cart permalink, make sure that you’re adding a variant ID and not the product ID. For instance, the product ID shows a black t-shirt, while the variant ID refers to the medium-sized black t-shirt. Only the latter works when you’re creating a cart permalink.

 

Share this article

Related Articles

Increase AOV with Upsells