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.

Associate an order with a subscription?

Solved

Associate an order with a subscription?

sleyhane
Shopify Partner
25 4 11

If a store has a subscription app installed, is it possible for another app to know if an order is associated with a subscription or not? Is there any read-only access to subscription data via webhooks or otherwise?

 

We have a fulfillment app for digital access to content. We'd like to support recurring subscriptions for access, regardless of which subscription app is used. For example, we need to know:

 

  • for a new order: the subscription contract id, if associated with a subscription
  • when a subscription is cancelled
  • change to the quantity of a subscription

 

I don't see any properties in the 'Order' webhooks that indicate whether a particular order is associated with a new or existing subscription. And it doesn't seem like we can set a scope to get access to the 'BillingAttempt' or 'SubscriptionContract' webhooks.

 

Is there any chance for an app to get read-only access to the Subscriptions API, without actually being an app that implements recurring subscriptions? Or do we need to rely on integration provided by the subscription apps for this kind of data?

 

Accepted Solution (1)
sleyhane
Shopify Partner
25 4 11

This is an accepted solution.

It is up to the subscription app for this kind of data.

 

From a Shopify order, you can only determine whether any line items were sold as part of a selling plan. And, this information is not available in the orders webhooks (which is unfortunate). You have to call Shopify's Graph QL API to determine this.

 

We have integrated our app with Seal Subscriptions. From our experience, it sometimes takes 30 seconds for Seal to create the subscriptions associated with an order. So, for subscription orders, we ignore Shopify's order webhook and wait for Seal's 'subscription/created' webhook. That webhook payload allows us to associate the subscription to a Shopify order id.

 

We also rely on Seal webhooks to determine:

  • when a subscription's status is updated
  • when the line items in the subscription changes
  • when successful billing attempts happen

Hope this helps.

View solution in original post

Replies 3 (3)

PAPsupport
Visitor
1 0 2

This is exactly the problem we are dealing with right now. Could somebody from Shopify team reply to this?

 

Thank you very much 🙂

mnearents
Shopify Partner
87 4 57

Did you find a solution for this? We had a custom digital access app built for our subscription that looks at orders to determine who gets what content. Curious what you all came up with?

sleyhane
Shopify Partner
25 4 11

This is an accepted solution.

It is up to the subscription app for this kind of data.

 

From a Shopify order, you can only determine whether any line items were sold as part of a selling plan. And, this information is not available in the orders webhooks (which is unfortunate). You have to call Shopify's Graph QL API to determine this.

 

We have integrated our app with Seal Subscriptions. From our experience, it sometimes takes 30 seconds for Seal to create the subscriptions associated with an order. So, for subscription orders, we ignore Shopify's order webhook and wait for Seal's 'subscription/created' webhook. That webhook payload allows us to associate the subscription to a Shopify order id.

 

We also rely on Seal webhooks to determine:

  • when a subscription's status is updated
  • when the line items in the subscription changes
  • when successful billing attempts happen

Hope this helps.