Is it possible to change a contract selling plan with a graphql mutation?

Is it possible to change a contract selling plan with a graphql mutation?

cavin
Shopify Partner
3 0 0

I have a few subscription contracts that have invalid selling plans due to unknown reasons (Potentially missing variants or products). I want to change the selling plan associated with each contract. Is it possible to do this with a graph ql mutation and admin api? Which mutation would I use?

Reply 1 (1)

J-ROM
Shopify Staff (Retired)
66 6 8

Hey Cavin,

 

It is possible to update the selling plan attached to a contract by following the steps below:

1. Call the subscriptionContractUpdate mutation with the ID of the contract you want to update. You'll get the ID of a draft contract back.
2. Call the subscriptionDraftLineUpdate mutation with the ID of the draft contract and the subscription line you wish to change. In the Input parameter of the mutation, provide the new selling plan ID.
3. Call the subscriptionDraftCommit mutation to finalize the contract update and make the new selling plan active.

Thank you for your patience while I got back to you. Hope this helps, and wishing you a happy end of year break.

Cheers,
Jerome

To learn more visit the Shopify Help Center or the Community Blog.