One click checkout link
This article will walk you through on how to build a one click checkout link to purchase a product as a subscription
Permalink URL format
Here is the format of the URL that we will be building and the variables that you would need to fill in to achieve this behavior.
https://{myshopifydomain}/cart/clear?return_to=/cart/add?items[][id]={variantId}%26items[][quantity]={Quantity}%26items[][selling_plan]={sellingPlanID}%26return_to=/checkout
Variables that you would need to fill in
Variable | Description |
---|---|
{myshopifydomain} | Your myshopify domain in the format example {domain}.myshopify.com |
{variantId} | Shopify Variant ID of the product that you want to generate this link for. |
{Quantity} | Quantity of the variant Id |
{sellingPlanID} | The ID of the frequency/cadence that you require. |
Build the permalink URL
Pre-requisites
- Selling plans should be set up on Loop
- Widget should be installed and working on the store
How to open the Network section on your browser
To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools.
You can also use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux).
Record the Payload
Select the required purchase option on the widget and then open the Network section of your browser’s developer tools before clicking the add to cart button, and then click on the add to cart button to record the payload being sent to Shopify.
This should provide you with {sellingPlanID} and {variantId} of the product. All that needs to be done is to fill in these values in its respective places.
A completed one click URL will look like this. Make sure to remove the “{” and “}” when modifying the respective fields
https://demo.loopwork.co/cart/clear?return_to=/cart/add?items[][id]=43029709684955%26items[][quantity]=1%26items[][selling_plan]=3079897307%26return_to=/checkout
Facing issues ?
If you have any queries or doubts about any of these steps. Please reach out to support@loopwork.co
Thanks
Loop Subscription Team