How to create a Shopify Add to Cart URL for Non-Subscription Products

Modified on Thu, 10 Jul at 10:33 AM

Creating a link that adds a product to a users cart along with discounts is easy. To assemble the URL all you will need is product variant id. This can be pulled from the Product Variant ID report located here:  https://admin.shopify.com/store/f32f3d-2/analytics/reports/214466647. To get the Product Variant ID just put the name of the product in the query where it says CONTAINS ''.

Searching for the Product Variant ID for Mug:

Now that we have the Product Variant ID we just need to add it into the correct format that Shopify is expecting.

URL Format
Add to Cart only: https://shop.aasm.org/cart/{Product_Variant_ID}:{Quantity}
Add to Cart with discount(s): https://shop.aasm.org/cart/{Product_Variant_ID}:{Quantity}?discount={discount_code_1},{discount_code_2}

Using our mug as an example our URLS would look like this:
Add to Cart only: https://shop.aasm.org/cart/40495147221079:1

This url just adds the mug to the cart.

Add to Cart with discounts: https://shop.aasm.org/cart/40495147221079:1?discount=Members,SMD25

This url adds the Member discount and also an additional discount for Sleep Medicine Disruptors 2025

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article