Add Product to Existing Subscription

Solved

Add Product to Existing Subscription

PaulVomberg
Tourist
14 0 1

Is it possible to add a product to an existing subscription? If so, what's the API call to make that happen? 

Accepted Solution (1)

Brian_S
Shopify Partner
161 21 40

This is an accepted solution.

Yes - you can add lines to a SubscriptionContract:

  1. First you'll get a SubscriptionDraft Id via subscriptionContractUpdate: https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptioncontractupdate
  2. Then you add a line via subscriptionDraftLineAdd: https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftLineAdd
  3. Then you commit your draft via subscriptionDraftCommit: https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftCommit

 

Check out this tutorialhttps://shopify.dev/apps/subscriptions/contracts#add-a-line-to-the-subscription-draft

 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic

View solution in original post

Replies 2 (2)

Brian_S
Shopify Partner
161 21 40

This is an accepted solution.

Yes - you can add lines to a SubscriptionContract:

  1. First you'll get a SubscriptionDraft Id via subscriptionContractUpdate: https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptioncontractupdate
  2. Then you add a line via subscriptionDraftLineAdd: https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftLineAdd
  3. Then you commit your draft via subscriptionDraftCommit: https://shopify.dev/api/admin-graphql/2021-10/mutations/subscriptionDraftCommit

 

Check out this tutorialhttps://shopify.dev/apps/subscriptions/contracts#add-a-line-to-the-subscription-draft

 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
PaulVomberg
Tourist
14 0 1

That's great - thank you so much Brian!