--- title: Build a subscription link extension description: >- Learn how to build a subscription link extension that allows Partners to customize the View subscription link that displays in the Shopify admin. source_url: html: >- https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building md: >- https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md --- ExpandOn this page * [What you'll learn](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#what-youll-learn) * [Requirements](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#requirements) * [Step 1: Generate a new extension](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#step-1-generate-a-new-extension) * [Step 2: Preview the extension](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#step-2-preview-the-extension) * [Step 3: Deploy the extension](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#step-3-deploy-the-extension) # Build a subscription link extension Note Creation of new Subscription link extensions from the Partner Dashboard is deprecated. If you have an existing Subscription link extension and would like to continue to manage it, please migrate it to Shopify CLI following the [migration guide](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/migrate-to-cli). 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](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/build-a-subscription-contract) for more information about how to create a subscription contract. *** ## 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 * You have a Shopify app with the [latest version of Shopify CLI](https://shopify.dev/docs/api/shopify-cli#upgrade) installed. *** ## Step 1: Generate a new extension 1. Use Shopify CLI to generate a new extension: ## Terminal ```terminal shopify app generate extension --template subscription_link_extension --name subscription-link --flavor react ``` You should now have a new extension directory at `extensions/subscription-link`. 2. Navigate to `extensions/subscription-link/shopify.extension.toml` and make sure the `pattern` matches your endpoint. This ensures that the **View subscription** link redirects to the correct endpoint: ## extensions/subscription-link/shopify.extension.toml ```toml [[extensions]] name = "subscription-link" type = "subscription_link_extension" uid = "6d03b9f2-a131-2fb2-477e-0f5c88a337b3256fe3e4" handle = "subscription-link" pattern = "/subscriptions{?customer_id,shop}&id={contract_id}" ``` Note The `pattern` must match the URL that you want to redirect to. It can be a relative path, or an absolute URL template. *** ## Step 2: Preview the extension To preview the extension, either start or restart your server with the following command: ## Terminal ```terminal shopify app dev ``` *** ## Step 3: Deploy the extension Once you're ready to release your app, deploy the extension with the following command: ## Terminal ```terminal shopify app deploy ``` *** * [What you'll learn](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#what-youll-learn) * [Requirements](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#requirements) * [Step 1: Generate a new extension](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#step-1-generate-a-new-extension) * [Step 2: Preview the extension](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#step-2-preview-the-extension) * [Step 3: Deploy the extension](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/contracts/subscription-link-extensions/start-building.md#step-3-deploy-the-extension)