Last Updated on by Dan S
Originally Published March 16, 2021.


How to simply & clearly create a unique URL to add a product to Shopify cart

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. 

How to create a cart permalink?

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}(,…)

How to add a discount to the cart permalink?

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. 

How to use a cart permalink?

You can use the cart permalink for creating a sales channel app for your store. Such links work best in cases where buyers purchase items from one merchant. 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.