Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Shopify/subscriptions-reference-app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Selling plan webhooks notify your app when selling plan groups are created or updated. Selling plan groups define the subscription offerings available to customers, including billing frequencies, pricing policies, and delivery schedules.In Shopify’s subscription model, selling plan groups contain multiple selling plans that define different subscription options (e.g., monthly vs. yearly subscriptions).
Webhook Topics
selling_plan_groups/create
Triggered when a new selling plan group is created.Webhook Configuration
The reference app handles both create and update events with the same webhook endpoint since the processing logic is identical.
Payload Structure
The numeric ID of the selling plan group
The GraphQL Admin API ID of the selling plan group (format:
gid://shopify/SellingPlanGroup/{id})The GraphQL Admin API ID of the app that owns this selling plan group (null if created by merchant)
The display name of the selling plan group (e.g., “Subscribe and Save”)
A merchant-facing code or identifier for the selling plan group
An array of option names that customers can choose from (e.g., [“Delivery frequency”])
An array of selling plan objects within this group
The display name of the selling plan
A description of the selling plan shown to customers
The billing policy for this plan
The billing interval unit (e.g., “day”, “week”, “month”, “year”)
The number of intervals between billings
Minimum number of billing cycles (null if no minimum)
Maximum number of billing cycles (null if unlimited)
Example Payload
Handler Implementation
The reference app creates translations for selling plans to support multi-language stores:The translation job processes each selling plan in the group and creates translations for the plan name and description in all locales configured for the store.
selling_plan_groups/update
Triggered when an existing selling plan group is updated.Webhook Configuration
Same asselling_plan_groups/create - both topics share the same webhook endpoint.
Payload Structure
The payload structure is identical to the create webhook, containing the updated selling plan group data.Handler Implementation
The handler implementation is the same as for create events, as shown above. When a selling plan group is updated, the translation job re-processes all selling plans to ensure translations are current.Understanding Selling Plans
Selling Plan Groups
A selling plan group is a collection of related subscription options. For example, a “Subscribe and Save” group might contain:- Monthly subscription (10% off)
- Quarterly subscription (15% off)
- Annual subscription (20% off)
Billing vs. Delivery Policies
- Billing Policy: Defines when the customer is charged (e.g., every month)
- Delivery Policy: Defines when the product is delivered (e.g., every month)
Pricing Policies
Pricing policies define the discount or adjustment applied to subscription purchases:| Adjustment Type | Description | Example |
|---|---|---|
percentage | Percentage discount | ”10” = 10% off |
fixed_amount | Fixed amount discount | ”5.00” = $5 off |
price | Fixed subscription price | ”29.99” = $29.99 per cycle |
Translation Job Implementation
The reference app uses a background job to create translations:Best Practices
- Translation Support: Always create translations for selling plans if you support multiple languages
- Validation: Validate selling plan configurations to ensure billing and delivery policies make sense
- Change Detection: When processing update webhooks, compare with stored data to detect what changed
- Product Associations: Track which products are associated with which selling plan groups
- Testing: Test with different billing intervals and pricing policies to ensure correct behavior
- Caching: Consider caching selling plan data to avoid repeated API calls