FROM CACHE - en_header

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
Shopify Staff
37 4 7

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

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
Shopify Staff
37 4 7

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

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
Shopify Staff
37 4 7

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

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
Shopify Staff
37 4 7

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