Creating direct checkout links
The direct link to checkout lets you generate a URL that takes customers to a checkout cart preconfigured with specific product offerings.
This guide covers an overview of creating a direct link to checkout and steps for implementation.
- Migrated Shopify Checkout Integration
- Shopify Checkout Integration
Create a direct link to checkout
When a customer clicks your direct link, they will be redirected to a checkout screen with the specified product pre-populated in their cart and ready to proceed.
- Click Products and select Products from the dropdown.
- Search and select the specific product you intend to add to the checkout cart.
-
Click the horizon three dot (...) and select the Copy checkout link in the Subscription plans section.
- Embed this link anywhere on your site, social media, or marketing outreach.
Update direct link
The product page in the merchant portal must be refreshed after saving changes, such as updating frequency.
To update your product and use the newly generated link:
- Click Products and select Products from the dropdown.
- Search and select the specific product.
- Update the product or plan.
- Save your changes and refresh the page.
- Copy your updated link.
Creating custom checkout links
You can utilize Shopify permalinks to create custom checkout links that target specific products, add multiple products, or add a discount code.
These Shopify permalinks preserve items currently in the cart.
{} with the information of the products you want to target. For example [id]={VARIANT_ID}, would look something like [id]=12345.Creating a checkout link to target a specific variant
Update the following link to create a direct link to checkout that targets a specific variant:
https://{SHOP}.myshopify.com/cart/clear?return_to=/cart/add?items[][id]={VARIANT_ID}%26items[][quantity]={QUANTITY}%26items[][selling_plan]={SELLING_PLAN_ID}%26return_to=/checkout
Make sure to update the following:
- Replace
{SHOP}with your Shopify store URL - Replace
{VARIANT_ID}with the product variant ID to target a specific variant - Replace
{QUANTITY}with the number of products to be purchased - Replace
{SELLING_PLAN_ID}with the selling plan ID associated with the selling plan, which defines the terms under which a product is sold
Example
https://bare-supplements.myshopify.com/cart/clear?return_to=/cart/add?items[][id]=12345%26items[][quantity]=3%26items[][selling_plan]=9876%26return_to=/checkout
Creating a checkout link that has multiple products
Update the following link to create a direct link to the checkout that targets multiple products:
https://{SHOP}.myshopify.com/cart/clear?return_to=/cart/add?items[][id]={VARIANT_ID}%26items[][quantity]={QUANTITY}%26items[][selling_plan]={SELLING_PLAN_ID}%26items[][id]={SECOND_VARIANT_ID}%26items[][quantity]={SECOND_QUANTITY}%26items[][selling_plan]={SELLING_PLAN_ID}%26return_to=/checkout
Make sure to update the following:
- Replace
{SHOP}with your Shopify store URL - Replace
{VARIANT_ID}with the product variant ID to target a specific variant - Replace
{QUANTITY}with the number of products to be purchased - Replace
{SELLING_PLAN_ID}with the selling plan id associated with the selling plan, which defines the terms under which a product is sold - Replace
{SECOND_VARIANT_ID}with the product variant ID to target a second specific variant - Replace
{SECOND_QUANTITY}with the number of products to be purchased for the second variant ID - Replace
{SELLING_PLAN_ID}with the selling plan id associated with the second variant ID
Example
https://bare-supplements.myshopify.com/cart/clear?return_to=/cart/add?items[][id]=12345%26items[][quantity]=3%26items[][selling_plan]=9876%26items[][id]=02468%26items[][quantity]=2%26items[][selling_plan]=97531%26return_to=/checkout
Creating a checkout link with a discount code
Update the following link to create a direct link to checkout that adds a discount to a customer's order:
https://{SHOP}.myshopify.com/discount/{DISCOUNT_CODE}/?redirect=/cart/add?items[][id]={VARIANT_ID}%26items[][quantity]={QUANTITY}%26items[][selling_plan]={SELLING_PLAN_ID}%26return_to=/checkout
- Replace
{SHOP}with your Shopify store URL - Replace
{DISCOUNT_CODE}with the discount code to be applied at the checkout - Replace
{VARIANT_ID}with the product variant ID to target a specific variant - Replace
{QUANTITY}with the number of products to be purchased - Replace
{SELLING_PLAN_ID}with the selling plan id associated with the selling plan, which defines the terms under which a product is sold
Example
https://bare-supplements.myshopify.com/discount/HALFOFF/?redirect=/cart/add?items[][id]=12345%26items[][quantity]=3%26items[][selling_plan]=9876%26return_to=/checkout
Troubleshooting
If Shopify returns an error (400, 422) when the product is added to the cart, the cause may be:
- Product is out of stock
- Product doesn’t exist in Shopify anymore
- Product is in draft mode
The error is handled by printing the error message on the page and providing a link that returns to your home page. This allows the customer to continue navigating the site and prevents a blank screen when an error occurs.
Considerations
Consider the following when creating direct checkout links:
Consideration |
Notes |
| Cart behavior |
|
| Product variants |
|
| Bundle and collection support |
|
| Line item attribution | Previously, the line item attribute attribution: rc_direct_checkout_link was automatically added to line items created through a direct checkout link. This has been updated to _attribution: rc_direct_checkout_link, which hides the attribute at checkout. |
