Subscription Plans
Update subscription group details and product assignments
Updates an existing subscription group (selling plan group) including its name, selling plans configuration, and optionally manages product/variant assignments. This endpoint provides comprehensive update capabilities for both the subscription group structure and its product associations.
Key Capabilities:
- Update subscription group name
- Modify existing selling plan configurations (discounts, frequencies, trials, etc.)
- Optionally add or remove products/variants through updateProducts and deleteProducts
- Add a selling plan by sending it without ‘idNew’
- Delete a selling plan by leaving it out of subscriptionPlans
- Automatically handles complex discount transitions for free trials and prepaid plans
- Updates delivery profile associations if changed
- Triggers asynchronous operations for metafield updates and free product checks
Important Notes:
- The ‘id’ field is required and must match an existing subscription group
- subscriptionPlans is the group’s full list of plans. A plan you leave out is deleted, so send every plan you want to keep
- Build the request from
GET /api/external/v2/subscription-groups/{id}and change only what you need. Each plan you send replaces the saved plan, so a field you leave out goes back to its default. For example, a plan sent without discountEnabled loses its discount - Send each plan you keep with ‘idNew’ set to its selling plan ID. A plan without ‘idNew’ is created as a new plan, even if it has an ‘id’
- A new plan needs a frequencyName that no other plan in subscriptionPlans has, ignoring case and spaces. Otherwise the call returns 400 with errorKey frequencyNameNotUnique
- The response doesn’t show the saved plans. It can return ‘idNew’ and appstleCycles empty, and a new plan without its ‘id’. Read the group with GET for plan IDs and rewards, and don’t send this response back as an update
- Plan modifications maintain the same selling plan ID in Shopify
- updateProducts and deleteProducts are optional. A call without them, or with them empty, changes the group name and plans and leaves the group’s products as they are. To change only a plan’s discount, send the group from GET with the new discountOffer and no updateProducts
- updateProducts adds products only when it has productDetails or variantDetails, or allProduct set to true. deleteProducts removes products only when it lists productIds or variantIds, so deleteAllProduct without IDs does nothing
- A plan with discountEnabled set to true needs a discountOffer. Without it the call returns 400 with errorKey discountOfferMissing and changes nothing
- Product/variant updates are processed after group details are updated
- Large product updates (allProduct=true) run asynchronously
Selling Plan Updates:
- Can change discount amounts and types, and the orders they start on (afterCycle1, afterCycle2)
- Can modify billing/delivery frequencies
- Can add/remove free trials
- Can change member restrictions and tags
- Can update specific day delivery settings
- Can modify min/max cycles
Rewards (appstleCycles):
- appstleCycles is saved only on a new plan, one sent without ‘idNew’
- On a plan that already exists, appstleCycles is ignored. The call still returns 200, and the plan keeps its rewards
- To change the rewards of an existing plan, edit the plan under Subscription Plans in the Appstle Subscriptions app
- A new plan’s rewards are checked before anything is saved. If one is refused, the call returns 400 and the group doesn’t change. Show the response’s title: it says what to fix
- The errorKey is loyaltyRewardsNotIncluded when the store’s Appstle plan doesn’t include subscription rewards. It’s featureLocked when advanced rewards are locked for the store: three or more reward steps, a SHIPPING reward or a repeating reward
- After the call, check each new plan’s rewards with GET
Authentication: Requires valid X-API-Key header
PUT
/
api
/
external
/
v2
/
subscription-groups
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-groups \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"groupName": "Coffee Collection Subscription",
"id": 123456789,
"subscriptionPlans": [
{
"afterCycle1": 0,
"discountEnabled": true,
"discountOffer": 15,
"discountType": "PERCENTAGE",
"frequencyCount": 1,
"frequencyDescription": "All coffee products eligible",
"frequencyInterval": "MONTH",
"frequencyName": "Monthly Coffee Box",
"idNew": "gid://shopify/SellingPlan/111111",
"planType": "PAY_AS_YOU_GO"
}
],
"updateProducts": {
"allProduct": true,
"collectionId": "987654321"
}
}
'
{
"groupName": "Coffee Subscriptions",
"id": 123456789,
"productCount": null,
"productVariantCount": null,
"subscriptionPlans": [
{
"afterCycle1": 0,
"appstleCycles": [],
"billingFrequencyCount": 1,
"billingFrequencyInterval": "MONTH",
"defaultSelectedPlan": false,
"deliveryPolicyPreAnchorBehavior": "ASAP",
"discountEnabled": true,
"discountEnabled2": false,
"discountOffer": 10,
"discountType": "PERCENTAGE",
"freeTrialEnabled": false,
"frequencyCount": 1,
"frequencyDescription": "",
"frequencyInterval": "MONTH",
"frequencyName": "Monthly Coffee",
"frequencySequence": 0,
"frequencyType": "ON_PURCHASE_DAY",
"gift": false,
"id": "gid://shopify/SellingPlan/111111",
"idNew": null,
"inventoryPolicyReserve": "ON_SALE",
"planType": "PAY_AS_YOU_GO",
"repeatingCycle": false,
"specificDayEnabled": false
},
{
"afterCycle1": 0,
"appstleCycles": [],
"billingFrequencyCount": 2,
"billingFrequencyInterval": "WEEK",
"defaultSelectedPlan": false,
"deliveryPolicyPreAnchorBehavior": "ASAP",
"discountEnabled": true,
"discountEnabled2": false,
"discountOffer": 5,
"discountType": "PERCENTAGE",
"freeTrialEnabled": false,
"frequencyCount": 2,
"frequencyDescription": "",
"frequencyInterval": "WEEK",
"frequencyName": "Coffee Every 2 Weeks",
"frequencySequence": 1,
"frequencyType": "ON_PURCHASE_DAY",
"id": null,
"idNew": null,
"inventoryPolicyReserve": "ON_SALE",
"planType": "PAY_AS_YOU_GO",
"repeatingCycle": false,
"specificDayEnabled": false
}
]
}
Body
application/json
Complete subscription group update request including group details, selling plans, and optional product management
Response
Subscription group successfully updated
⌘I
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-groups \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"groupName": "Coffee Collection Subscription",
"id": 123456789,
"subscriptionPlans": [
{
"afterCycle1": 0,
"discountEnabled": true,
"discountOffer": 15,
"discountType": "PERCENTAGE",
"frequencyCount": 1,
"frequencyDescription": "All coffee products eligible",
"frequencyInterval": "MONTH",
"frequencyName": "Monthly Coffee Box",
"idNew": "gid://shopify/SellingPlan/111111",
"planType": "PAY_AS_YOU_GO"
}
],
"updateProducts": {
"allProduct": true,
"collectionId": "987654321"
}
}
'
{
"groupName": "Coffee Subscriptions",
"id": 123456789,
"productCount": null,
"productVariantCount": null,
"subscriptionPlans": [
{
"afterCycle1": 0,
"appstleCycles": [],
"billingFrequencyCount": 1,
"billingFrequencyInterval": "MONTH",
"defaultSelectedPlan": false,
"deliveryPolicyPreAnchorBehavior": "ASAP",
"discountEnabled": true,
"discountEnabled2": false,
"discountOffer": 10,
"discountType": "PERCENTAGE",
"freeTrialEnabled": false,
"frequencyCount": 1,
"frequencyDescription": "",
"frequencyInterval": "MONTH",
"frequencyName": "Monthly Coffee",
"frequencySequence": 0,
"frequencyType": "ON_PURCHASE_DAY",
"gift": false,
"id": "gid://shopify/SellingPlan/111111",
"idNew": null,
"inventoryPolicyReserve": "ON_SALE",
"planType": "PAY_AS_YOU_GO",
"repeatingCycle": false,
"specificDayEnabled": false
},
{
"afterCycle1": 0,
"appstleCycles": [],
"billingFrequencyCount": 2,
"billingFrequencyInterval": "WEEK",
"defaultSelectedPlan": false,
"deliveryPolicyPreAnchorBehavior": "ASAP",
"discountEnabled": true,
"discountEnabled2": false,
"discountOffer": 5,
"discountType": "PERCENTAGE",
"freeTrialEnabled": false,
"frequencyCount": 2,
"frequencyDescription": "",
"frequencyInterval": "WEEK",
"frequencyName": "Coffee Every 2 Weeks",
"frequencySequence": 1,
"frequencyType": "ON_PURCHASE_DAY",
"id": null,
"idNew": null,
"inventoryPolicyReserve": "ON_SALE",
"planType": "PAY_AS_YOU_GO",
"repeatingCycle": false,
"specificDayEnabled": false
}
]
}