Create and manage a product subscription app extension
Product subscription app extensions won't be supported as of December 3, 2025. You should migrate existing product subscription app extensions to purchase options extensions.
This tutorial explains how to create and manage a product subscription app extension. You'll use the Add
, Create
, Edit
, and Remove
extension modes to make requests to your app's backend server.
Anchor to What you'll learnWhat you'll learn
In this tutorial, you'll learn how to do the following tasks:
- Set up requests to your app's backend server
- Set up unit testing for your extension
Anchor to RequirementsRequirements
- Configure your app's backend server and acquire a session token.
- Extensions built with App Bridge Admin are hosted in Shopify. To receive requests from your extension, you need to enable cross-domain requests on your app’s server.
- Extensions built with App Bridge Admin use session tokens to authenticate requests between your extension and your app's backend server. You need to provide the session token in every request to your backend server.
Anchor to Step 1: Set up requests to your app’s backend serverStep 1: Set up requests to your app’s backend server
After you generate the product subscription app extension, you can set up requests to your app's backend server for each extension mode.
Anchor to Create a new purchase optionCreate a new purchase option
The Create
mode enables users to create a new purchase option for the current product or one of its variants. The Create plan UI should display the plan title, the delivery frequency, and the discount percentage. The Create
mode triggers the app overlay container.
The request to your backend server triggers the sellingPlanGroupsCreate mutation.
- In the
payload
, include theproductId
andvariantId
collected from the extension form. - In the header, include the session token. If the response returns an OK status, then you can request
done
to re-render the modal andclose
to close it.
Anchor to ExampleExample
Input
onPrimaryAction in Create
Anchor to Add an existing purchase option to a product or variantAdd an existing purchase option to a product or variant
The Add
mode enables users to add the current product to an existing purchase option. The Add plan UI should display a searchable list of purchase options on the shop. The purchase options that are already associated with the product either directly or through one of its variants should not be listed. The Add
mode triggers the app modal container.
The request to your backend server triggers the productJoinSellingPlanGroups mutation, applying the selected SellingPlan
objects to the current product.
- In the
payload
, include theproductId
andvariantId
collected from the extension form. - In the header, include the session token. If the response returns an OK status, then you can request
done
to re-render the modal andclose
to close it.
Anchor to ExampleExample
Input
primaryAction in Add
Anchor to Edit an existing purchase optionEdit an existing purchase option
The Edit
mode enables users to edit a product's purchase option. The Edit plan UI should display the plan title, the delivery frequency, and the discount percentage. The Edit
mode triggers the app overlay container.
The request to your backend service triggers the sellingPlanGroupUpdate mutation, applying the selected SellingPlan
objects to the current product.
- In the
payload
, include theproductId
andvariantId
collected from the extension form and thesellingPlanGroupId
. - In the header, include the session token. If the response returns an OK status, then you can request
done
to re-render the modal andclose
to close it.
Anchor to ExampleExample
Input
onPrimaryAction in Edit
Anchor to Remove an existing purchase option from a product or variantRemove an existing purchase option from a product or variant
The Remove
mode enables users to remove a product's purchase option. The Remove plan UI should display the plan and product titles. The Remove
mode triggers the app modal container.
- If the purchase option is associated at the product level (
sellingPlanGroup.appliesToProduct
istrue
), then the request to your backend server triggers the sellingPlanGroupRemoveProducts mutation. - If the purchase option is associated at the variant level (
sellingPlanGroup.appliesToProductVariants
istrue
), then the request to your backend server triggers the sellingPlanGroupRemoveProductVariants mutation.
- In the
payload
, include theproductId
,variantId
,variantIds
and thesellingPlanGroupId
. - In the header, include the session token. If the response returns an OK status, then you can request
done
to re-render the modal andclose
to close it.
Anchor to ExampleExample
Input
primaryAction in Remove
Anchor to Step 2: Set up unit testingStep 2: Set up unit testing
To thoroughly test your extension, we recommend that you set up unit testing. You can use a testing framework that best suits your needs.
- The underlying technology for App Bridge Admin is remote-ui. @remote-ui/testing is a testing library that you can use to test subscription app extension components and their usage.
- The APIs in @remote-ui/testing are inspired by the @shopify/react-testing library.
Anchor to Next stepsNext steps
- Learn how to deploy and release your app extension.