Update customer when product subscription ends

mikegdev
New Member
3 0 0

When a user purchases a subscription product we use the Flow app to add a tag to their customer record. This allows us to identify the user as a subscriber throughout the shop.

When a subscription is no longer active, we need to remove that tag from the customer.

I have not found a way to do this with the Flow app so I am looking to webhooks or the Admin API for a solution.

The webhook documentation lists a `subscription_contracts/update` webhook that may provide us with the event needed but it is not available from within the Shopify admin at `/admin/settings/notifications`. Using the 2021-01 version of the Admin API to create this also returns an error - "Invalid topic specified: subscription_contracts\/update. Does it exist? Is there a missing access scope?" The error also provides a list of allowed topics. `subscription_contracts/update` is not included in that list.

How can I remove a tag from a customers record when a product subscription has ended and not when they take the action to cancel or pause their subscription?

0 Likes
mikedasilva
Shopify Staff
Shopify Staff
28 2 2

Hi @mikegdev,

Might be a scopes issue. Do you have the read_orders scope enabled?

Cheers

mikedasilva | Developer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
mikegdev
New Member
3 0 0

Hey @mikedasilva. Thanks for your response.

It does sound like a scope issue. I've enabled read access for read_orders, write_orders, read_order_edits and write_order_edits without any luck.

Are there any other permissions I can enable that will give access to the subscription-related webhooks listed in the docs at https://shopify.dev/tutorials/create-manage-subscription-contracts#subscription-related-webhooks?

 

0 Likes
mikegdev
New Member
3 0 0

If anyone has any ideas we're still looking for a solution.

Thank you!

0 Likes