Skip to main content
All CollectionsIntegrationsZapier
Zapier tutorial: Revoke permissions when a subscription is cancelled
Zapier tutorial: Revoke permissions when a subscription is cancelled

Learn how to use Zapier to automate the revoking of user permissions when their subscription is cancelled.

Vesa Vahermaa avatar
Written by Vesa Vahermaa
Updated today

Welcome to a practical Zapier tutorial! In this guide, we'll use Zapier to revoke user permissions when a subscription in Stripe is cancelled. We do not focus on any one specific user permission, since the same set up steps apply to all permissions in Zapier. We do assume that a subscription fee has been set up to charge for these permissions using Stripe.

IMPORTANT: After the subscription is canceled on Stripe, the user permissions are changed automatically by Zapier, but not instantly.

The speed of the automation depends on how quickly Zapier polls your marketplace for updates. The time it takes Zapier to get new information from your marketplace is called the 'polling time' and its length depends on which Zapier plan you are subscribed to.

The default polling time is two minutes, which means that when a transaction is canceled, it can take up to two minutes until the user permissions are revoked.

What is Zapier?

Zapier is a powerful and versatile tool for integrating different tools to your marketplace. You can learn more about Zapier in our introductory article or through this brief video from Zapier.

If you haven’t read the introduction and the action/event Zapier articles, we encourage you to do so to understand better how Zapier works. But if you want to dive straight into action, feel free to read on!

What do you need for this tutorial?

External accounts

  1. Zapier Account

    • Create a Zapier account if you don’t already have one. You can sign up at www.zapier.com.

    • During registration, Zapier may ask which apps you plan to use. You can enter Sharetribe at this point or add it later.

How to set up your marketplace

  1. Correct User Permissions

    • This tutorial assumes that you have set up your marketplace so that some rights are limited to only subscribed users. For example, only users with an active subscription can view listings, post listings, or initiate transactions. You can set this up in the Access Control section of your Console.

  2. Subscription system on Stripe

    • You’ll need to have set up membership subscriptions on your Stripe account. You can find more about this from this article.

    • In order to test this Zap, there needs to be at least one user with a canceled subscription on your Stripe account. You can both initiate and cancel the subscription manually from your Stripe dashboard for the purposes of this tutorial.

  3. Metadata settings on Stripe

    • The user whose rights you are modifying needs to have the correct metadata in their user account. Specifically, they need to have a field called “User ID” that includes their Sharetribe user ID.

      • This is something that you can add manually on the Stripe dashboard, for example just for the sake of this tutorial. If you choose to do so, you can find the metadata settings by opening the customer's information sheet on your Stripe dashboard, and editing the metadata from the lower right corner of the screen.

      • However, it’s best to automate this step. See the article on how to granting permissions after a subscription fee is paid.

  4. Integration API Application

    • You’ll also need to create an application using the Integration API. The instructions for doing this are below. For the purposes of this tutorial, you don’t need to know details about using the APIs, but if you want, you can read about them from our technical documentation here.

With these pieces in place, let's get started!

Getting your Integration API key from Sharetribe Console

  1. Click on “+ Add a new application”

  2. Give the application a descriptive name (like Zapier), and select ‘Integration API’.

  3. Click ‘Add application’.

  4. Important: Copy and paste the Client ID and Client secret to a safe place, like a password manager.

    1. Think of the Client ID and secret as a sort of password to your marketplace that can be used through other services. Note that you won’t be able to ever see the Client secret to this application again in the Console under any circumstances. Make sure you copy it to a secure place. If you lose it, you will need to create a new application.

Creating the Zap, step by step

(Optional) Importing a pre-existing Zap

  1. Go to www.zapier.com and log in with your account (or create a free one, if you don't already have one)

  2. Open the pre-made Zap for revoking permissions on Sharetribe here

  3. Click on ‘Try this Zap'

Step 1: Find a canceled subscription from your Stripe account

  1. Connect your Stripe account by logging in with your username and password

  2. Choose ‘Canceled Subscription’ as the Trigger event

  3. Click ‘Continue’ to move to the ‘Configure’ section

  4. Leave the search field empty

  5. Select ‘False’ in ‘Would you like to use test mode data for the test sample?’

  6. Click ‘Continue’ to move to the ‘Test’ section

  7. Test the trigger, and make sure it finds a cancelled subscription from your marketplace, along with all related information.

Step 2: Revoke user permissions

  1. Select ‘Sharetribe’ as the app. Use the Client ID + Secret that you created earlier to log in.

  2. As the ‘Action event’, select ‘Update Permissions’

  3. Click ‘Continue’ to move to the ‘Configure’ section

  4. Under ‘User ID’, click the Plus sign +, and Select “1. Customer Metadata User ID: xxxx” from the drop down. You can quickly find it by searching for “metadata”.

  5. Select “False” the permissions you would like to revoke. Note that you do not need to set values for all the permissions: you can choose any number of permissions to revoke from the user. The options are:

    1. Viewing listings

    2. Posting listings

    3. Initiating transactions

  6. Select ‘False’ for ‘Expand the response to return the full resource?’, as it is not needed here.

  7. Click 'Continue' to go to the 'Test' section. Test the Zap, and make sure from your Sharetribe Console that the permissions were correctly revoked for the correct user.

Final thoughts

Thanks for reading this tutorial about creating a Zap for automated permission revoking! Feel free to read through other parts of our Zapier guide as well: the Introduction and the article about Events and Actions.

We also have tutorials and templates for various different Zaps available, including SMS notifications, digital calendar invites, and more. You can read about all our templates in this article.

Please get in touch with us from your Console or from the bottom right section of this page from the chat widget if you have any questions about this guide, or anything else. We'll be happy to help!

Did this answer your question?