Build a subscription link extension
You can customize the View subscription link by managing the Subscription link app extension from your app through the Shopify CLI.
Merchants can see the View subscription link on the customer and order pages on Shopify admin. Please reference this guide for more information about how to create a subscription contract.
What you'll learn
Anchor link to section titled "What you'll learn"In this tutorial, you'll learn how to do the following tasks:
- Create a subscription link extension.
- Preview and deploy the extension.
Requirements
Anchor link to section titled "Requirements"- You have a Shopify app with the Shopify CLI version 3.70.0 or above installed.
Step 1: Generate a new extension
Anchor link to section titled "Step 1: Generate a new extension"Use Shopify CLI to generate a new extension:
You should now have a new extension directory at
extensions/subscription-link
.Navigate to
extensions/subscription-link/shopify.extension.toml
and make sure thepattern
matches your endpoint. This ensures that the View subscription link redirects to the correct endpoint:
Step 2: Preview the extension
Anchor link to section titled "Step 2: Preview the extension"To preview the extension, either start or restart your server with the following command:
Step 3: Deploy the extension
Anchor link to section titled "Step 3: Deploy the extension"Once you're ready to release your app, deploy the extension with the following command: