> Deprecated:
> 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](/docs/apps/build/purchase-options/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.
## What 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
## Requirements
- [Configure your app's backend server and acquire a session token](/docs/apps/build/purchase-options/product-subscription-app-extensions/authenticate-extension-requests).
- Extensions built with App Bridge Admin are hosted in Shopify. To receive requests from your extension, you need to [enable cross-domain requests](/docs/apps/build/purchase-options/product-subscription-app-extensions/authenticate-extension-requests#configure-your-apps-backend-server) 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](/docs/apps/build/purchase-options/product-subscription-app-extensions/authenticate-extension-requests) in every request to your backend server.
## Step 1: Set up requests to your app’s backend server
After you [generate the product subscription app extension](/docs/apps/build/purchase-options/product-subscription-app-extensions/start-building), you can set up requests to your app's backend server for each extension mode.
### Create 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](/docs/apps/build/purchase-options/product-subscription-app-extensions#containers).
The request to your backend server triggers the [sellingPlanGroupsCreate](/docs/api/admin-graphql/latest/mutations/sellingplangroupcreate) mutation.
1. In the `payload`, include the `productId` and `variantId` collected from the extension form.
1. In the header, include the session token. If the response returns an **OK** status, then you can request `done` to re-render the modal and `close` to close it.
#### Example
### Add 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](/docs/apps/build/purchase-options/product-subscription-app-extensions#containers).
The request to your backend server triggers the [productJoinSellingPlanGroups](/docs/api/admin-graphql/latest//mutations/productjoinsellingplangroups) mutation, applying the selected `SellingPlan` objects to the current product.
1. In the `payload`, include the `productId` and `variantId` collected from the extension form.
1. In the header, include the session token. If the response returns an **OK** status, then you can request `done` to re-render the modal and `close` to close it.
#### Example
### Edit 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](/docs/apps/build/purchase-options/product-subscription-app-extensions#containers).
The request to your backend service triggers the [sellingPlanGroupUpdate](/docs/api/admin-graphql/latest/mutations/sellingplangroupupdate) mutation, applying the selected `SellingPlan` objects to the current product.
1. In the `payload`, include the `productId` and `variantId` collected from the extension form and the `sellingPlanGroupId`.
1. In the header, include the session token. If the response returns an **OK** status, then you can request `done` to re-render the modal and `close` to close it.
#### Example
### Remove 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](/docs/apps/build/purchase-options/product-subscription-app-extensions#containers).
- If the purchase option is associated at the product level (`sellingPlanGroup.appliesToProduct` is `true`), then the request to your backend server triggers the [sellingPlanGroupRemoveProducts](/docs/api/admin-graphql/latest/mutations/sellingplangroupremoveproducts) mutation.
- If the purchase option is associated at the variant level (`sellingPlanGroup.appliesToProductVariants` is `true`), then the request to your backend server triggers the [sellingPlanGroupRemoveProductVariants](/docs/api/admin-graphql/latest/mutations/sellingplangroupremoveproductvariants) mutation.
1. In the `payload`, include the `productId`, `variantId`, `variantIds` and the `sellingPlanGroupId`.
1. In the header, include the session token. If the response returns an **OK** status, then you can request `done` to re-render the modal and `close` to close it.
#### Example
## Step 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](https://github.com/Shopify/remote-dom/tree/remote-ui). [@remote-ui/testing](https://github.com/Shopify/remote-dom/tree/remote-ui/packages/testing) is a testing library that you can use to test subscription app extension components and their usage.
- The APIs in [@remote-ui/testing](https://github.com/Shopify/remote-dom/tree/remote-ui/packages/testing) are inspired by the [@shopify/react-testing](https://github.com/Shopify/quilt/tree/main/packages/react-testing) library.
## Next steps
- Learn how to [deploy and release your app extension](/docs/apps/launch/deployment/app-versions).