App Subscriptions GraphQL webhook response documentation

Solved

App Subscriptions GraphQL webhook response documentation

kyle_truong
Shopify Partner
60 6 16

I'm implementing webhooks with the GraphQL API and I'm having some trouble finding what the response will look like when handling it.

 

I've found resources showing the response of the created webhook but not what Shopify will actually send to my callback url. I don't care what returns when I create the webhook but I do care about what data will come through to my callback url specified in the creation of the webhook.

I tried looking at the REST admin API for the response but the topic for app subscriptions doesn't seem to be present:

https://shopify.dev/docs/admin-api/rest/reference/events/webhook

Any idea where I can find some examples of what the response can return?

Accepted Solution (1)
kyle_truong
Shopify Partner
60 6 16

This is an accepted solution.

This is the body of the request received in my webhook after shortly confirming the charge: 

{
  app_subscription: {
    admin_graphql_api_id: 'gid://shopify/AppSubscription/222222',
    name: 'Tester plan',
    status: 'ACTIVE',
    admin_graphql_api_shop_id: 'gid://shopify/Shop/22222',
    created_at: '2020-03-09T14:25:38-04:00',
    updated_at: '2020-03-09T14:25:53-04:00',
  },
};
 

View solution in original post

Replies 3 (3)

kyle_truong
Shopify Partner
60 6 16

...unless the response is the same as the one given when manually queried. I'm going to try it out and update this when done. 

chrisandrewca
Shopify Partner
9 0 15

I had to just try it out, I'm not sure the webhook response is documented. There's a lot of change in the GraphQL API.

kyle_truong
Shopify Partner
60 6 16

This is an accepted solution.

This is the body of the request received in my webhook after shortly confirming the charge: 

{
  app_subscription: {
    admin_graphql_api_id: 'gid://shopify/AppSubscription/222222',
    name: 'Tester plan',
    status: 'ACTIVE',
    admin_graphql_api_shop_id: 'gid://shopify/Shop/22222',
    created_at: '2020-03-09T14:25:38-04:00',
    updated_at: '2020-03-09T14:25:53-04:00',
  },
};