Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Query Available subscriptions contracts

Query Available subscriptions contracts

ThiagoMine
Tourist
13 0 1

I'm developing a subscription app using post-purchase extension for it, I have several subscriptions example made in orders, but when I try to query available contracts to show this information in app admin the query don't return any contracts.

 

I'm using the suggest query in the documentation: https://shopify.dev/apps/subscriptions/contracts#query-the-available-contracts-on-a-store, but no results, some one have a clue of what I maybe missing here?

Replies 7 (7)

J-ROM
Shopify Staff (Retired)
66 6 8

Hey ThiagoMine,

Thank you for your patience. Is this problem still persisting today? If so, does the query return any error, or just an empty list of subscriptions contracts though you know some exist. Could you share the store URL so I could try the documentation's query on it?

Cheers,
Jerome

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

ThiagoMine
Tourist
13 0 1

Hi Jerome

The problem persist, here is the link of the store

https://linkerdots-test.myshopify.com/

J-ROM
Shopify Staff (Retired)
66 6 8

Hey ThiagoMine,

 

I see no subscription contract, which is consistent with the query's response.

However, I see some subscription drafts (aka not active yet). You'd need to update them to set the pricing and delivery policies, add line items and then commit them to turn them into subscription contracts you can retrieve. Hope this helps.

Cheers,
Jerome

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

ThiagoMine
Tourist
13 0 1

Jerome

 

Thanks so much for the tips, I've one last question, How do I retrive this drafts?

J-ROM
Shopify Staff (Retired)
66 6 8

Hey ThiagoMine,

 

You need to keep track of the draft ID returned by the subscriptionContractCreate mutation, so you can later use this ID to retrieve the draft created or update it.

Cheers,
Jerome

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

ThiagoMine
Tourist
13 0 1

 

What seems strange for me is that I'm finishing orders buying products with plans like you can see with the post purchase option, in this case, the correct is generate a contract, isn't it?

Screenshot_20211207_144029.pngScreenshot_20211207_143545.png

J-ROM
Shopify Staff (Retired)
66 6 8

I believe we're investigating the root cause in this post.

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