Welcome to a practical Zapier tutorial! In this guide, we'll introduce a new feature to your marketplace through Zapier: instant bookings.
By default, a booking on your marketplace must be accepted by the provider before it is confirmed. A customer makes a request, but only when the provider accepts the request is the customer charged and the booking confirmed. A provider can choose to reject the request instead or, if the provider does nothing, the request expires automatically.
Through Zapier's automation capabilities, we can make bookings "instant". Instant bookings are automatically confirmed without the provider needing to accept. This can reduce friction for both customers and providers.
IMPORTANT: Even though this is an 'instant booking', it is not instant in a literal sense. 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.
You can test this yourself by making another test booking while the Zap has been made live, and monitoring how long it takes for the transaction to transition from 'Payment confirmed' to 'Accepted'.
About 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 you need for this tutorial
External accounts
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
Correct Listing Type
This tutorial assumes that you are using a Calendar booking listing type, typical for service and rental marketplaces. This tutorial works with any kind of Calendar booking listing type: hourly, daily, and nightly.
Marketplace Activity
In order for Zapier to draw relevant information from your marketplace, you will need to have some activity there. On your Sharetribe marketplace, you need to have at least one recent booking request transaction that has not yet been accepted by the provider. This should ideally be a test transaction that does not involve real money, as we will be accepting it in this tutorial.
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.
(Optional): Listing field for instant bookings
Give providers control over offering instant booking or not by configuring a custom listing field to capture their preference.
Create a listing field in Console with the following details:
Listing field name: Instant bookings enabled
Listing field ID: instantbooking
Listing field type: Select one
Field options:
Option name 1: Yes
Option value 1: yes
Option name 2: No
Option value 2: no
When building this field, you can also choose to limit this field to specific listing types or categories, whether it should be mandatory, or if it should also be a filter for users.
With these pieces in place, let's get started!
Getting your Integration API key from Console
Navigate to Build > Advanced > Applications
Click on “+ Add a new application”
Give the application a descriptive name (like Zapier), and select ‘Integration API’.
Click ‘Add application’.
Important: Copy and paste the Client ID and Client secret to a safe place, like a password manager.
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
Go to www.zapier.com and log in with your account (or create a free one, if you don't already have one)
Open the pre-made Zap for auto-accepting booking requests on Sharetribe here
Click on ‘Try this Zap'
Step 1: Find a recent transaction from your marketplace
Connect your Sharetribe account by entering your Client ID and Client secret
Click ‘Continue’ to move to the ‘Trigger’ section
Choose ‘Transaction transitioned’ as the ‘Event type’
Click ‘Continue’ to move to the ‘Test’ section
Test the trigger, and make sure it finds the recent test booking from your marketplace. Make sure to choose a booking that is in the state of having been paid by the customer, but not accepted by the provider.
(Optional) Step 2: Show listing
This step is only required if you want to enable instant bookings conditionally only for the listings where the provider has enabled it.
In the 'Setup' section, choose 'Sharetribe' as the app
As the 'Action event', choose 'Show Listing'
As the 'Account', choose your Sharetribe account (configured in the previous step)
Click 'Continue' to move to the 'Configure' section
As the 'Listing ID', click the Plus (+) sign, and choose '1. Transaction Listing ID' from the drop-down list
Leave the other fields empty or with default values, and click 'Continue'
Test the action, and make sure it includes the data under 'publicData' called 'Listing Public Data Instantbooking: yes'
If it doesn't, the listing doesn't have the right value set. Make sure you've enabled the custom listing field as described above, and that the test listing has been edited to include it.
Step 3: Filter the event
We want to only run the zap in a situation where a listing has been bought. For this step, choose ‘Filter by Zapier’.
Under the ‘Only continue if…’, select the following 3 entries for the lines:
‘1. Transaction Last Transition’
(Text) Exactly matches
transition/confirm-payment
If you created an instant booking listing field, you can use the field value (accepting instant booking or not accepting) to filter further. You would do this if you want to give providers control over offering instant booking or not.
(Optional) Click '+ And', and add another filter:
‘2. Listing Public Data Instantbooking’
(Text) Exactly matches
yes
Test the filter, and make sure it says “Your Zap would have continued for this test data”
Step 4: Accept the booking request
Now we accept the booking request. For this, we'll use the Sharetribe app for Zapier for this.
After selecting 'Sharetribe' as the app, select "Transition transaction" as the event.
In the 'Account' section, you'll use your own marketplace account - the one you set up with the Client ID and Client secret earlier.
Under 'Configure', click in the field under 'Transaction ID', and select from the drop down list '1. Transaction Id: xxxxx'. This is the test transaction that you found in Step 1 earlier.
Under 'Transition name', write in 'transition/operator-accept'
Under 'Expand the response to return the full resource?', select 'false'
Go under 'Test' and test the zap. If everything works well, the test transaction that you had initiated will now be accepted. Good job! You can now publish the Zap and it will start acting on all new transactions on your marketplace.
Final thoughts
Thanks for reading this tutorial about creating a Zap for automated instant bookings! 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!