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.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

APP_SUBSCRIPTIONS_UPDATE webhook response

Solved

APP_SUBSCRIPTIONS_UPDATE webhook response

Alex_Buran
Shopify Partner
5 0 1

Hello community,

 

I'm looking for APP_SUBSCRIPTIONS_UPDATE webhook response. I could add it using GraphQl, but I can find response of this webhook. This is the only documentation about webhook responses I found, but there is no APP_SUBSCRIPTIONS_UPDATE event. I also can't find a way how to test this event.

I would appreciate any help.

Thank you in advance!

Accepted Solution (1)

Shaibt
Shopify Partner
34 1 34

This is an accepted solution.

Hi Alex,

I'm successfully using this webhook.

Setting it using this mutation (API version 2020-04):

webhookSubscriptionCreate(topic: APP_SUBSCRIPTIONS_UPDATE , webhookSubscription: {callbackUrl: "${appSubcriptionCB}", format: JSON}) {
                      webhookSubscription {
                        id
                        callbackUrl
                        format
                        topic
                      }
                      userErrors {
                        field
                        message
                      }
                    }

I'm receiving the webhook every time there's a status change in the app subscription.

The webhook body will include these fields:

{
admin_graphql_api_id, 
name, 
status,
admin_graphql_api_shop_id,
created_at, 
updated_at
}

 

 

View solution in original post

Replies 7 (7)

Shaibt
Shopify Partner
34 1 34

This is an accepted solution.

Hi Alex,

I'm successfully using this webhook.

Setting it using this mutation (API version 2020-04):

webhookSubscriptionCreate(topic: APP_SUBSCRIPTIONS_UPDATE , webhookSubscription: {callbackUrl: "${appSubcriptionCB}", format: JSON}) {
                      webhookSubscription {
                        id
                        callbackUrl
                        format
                        topic
                      }
                      userErrors {
                        field
                        message
                      }
                    }

I'm receiving the webhook every time there's a status change in the app subscription.

The webhook body will include these fields:

{
admin_graphql_api_id, 
name, 
status,
admin_graphql_api_shop_id,
created_at, 
updated_at
}

 

 

Alex_Buran
Shopify Partner
5 0 1

Hi Shaibt!

Thank you for your reply! I appreciate it!

Do you have any idea how can I test it, other than waiting until some subscription is changed?

Thank you in advance!

Shaibt
Shopify Partner
34 1 34

You can create test app subscription charges using a mutation such as:

mutation appSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!, $test: Boolean, $trialDays: Int) {
        appSubscriptionCreate(name: $name, lineItems: $lineItems, returnUrl: $returnUrl, test: $test, trialDays: $trialDays) {
            appSubscription {
                id
                createdAt
                lineItems {
                  id
                  plan {
                    pricingDetails {
                      __typename
                    }
                  }
                }
            }
            confirmationUrl
            userErrors {
                field
                message
            }
        }
      }`

Just make sure you set test to Boolean 'true'

Alex_Buran
Shopify Partner
5 0 1

Awesome! Thank you so much! That is what I was looking for 🙂

thalessg
Shopify Partner
3 0 0

Thanks, this is exactly what I'm looking for, and I don't know why it's not in the shopify documentation, at least it's super hard to find

1080
Shopify Partner
301 9 66

@Shaibt  @Alex_Buran  https://github.com/Shopify/shopify-api-js/blob/HEAD/docs/guides/webhooks.md  the shopify doc it was not recived the any response.

can you help me with how to added the this webhook. I am facing issue to webhook is returnt any things. 

Dayjo
Shopify Partner
4 0 1

Thanks for this, it is extremely inconvenient not having any of this information in Shopify's documentation.