AppSubscription created with Test = true doesn't show up in the Store's active AppSubscriptions?

Highlighted
New Member
3 0 1

I'm trying to develop a Shopify application, but as far as I can tell, test AppSubscriptions don't show up in Shopify both in the Store, and the API when I query for it

So I have this active AppSubscription (this is the response from a webhookSubscription that I've registered to listen for status change)

 

 

Array
(
    [admin_graphql_api_id] => gid://shopify/AppSubscription/18723930270
    [name] => Shopify-150-01
    [status] => ACTIVE
    [admin_graphql_api_shop_id] => gid://shopify/Shop/49101930654
    [created_at] => 2020-09-18T20:55:42-04:00
    [updated_at] => 2020-09-18T21:01:43-04:00
)

 

 

 
Yet when I run these queries, both of them respond with no subscriptions found

 

{
  currentAppInstallation {
     allSubscriptions(first:10) {
       edges {
         node {
           id
         }
       }
     } 
  }
}

 

{
  currentAppInstallation {
		activeSubscriptions {
		  id
		}
  }
}

 
Am I missing something here?

0 Likes
Highlighted
New Member
3 0 1

I'm going to explain what I'm trying to do in case there's a better solution out there:

I'm trying to set up my webhookSubscriptions to listen to topic: "APP_SUBSCRIPTIONS_UPDATE" so that I will be notified when an AppSubscription is activated or canceled.

The problem I'm having is when an AppSubscription is activated for a Store that already had an active subscription, I receive 2 webhook callbacks: 1 for the AppSubscription that was just activated, and a second callback for the previous AppSubscription that was cancelled. I can't tell which one is the "real" charge that still exists on Shopify's end because for example if a Store activated a charge for the first time then cancelled it immediately, I'd receive a similar response from the webhook callback - I can't tell if the Store has an active subscription. My plan was to query for the active AppSubscription and just check the status on Shopify, but I cannot find any AppSubscription at all with my query, active or not. My suspicion is because my app is still in development mode, I'm creating test AppSubscriptions which don't actually show up. But if that's the case, I don't know how I'm to test this feature.

Of course I could just remember on my own server the last AppSubscription that was created for the store, and compare the id's to the ones that come back and from there be fairly confident which AppSubscription is the 'real' one, but I'd rather not add the complexity and risk getting out of sync.

0 Likes