1. Home
  2. Booking & Appointment Plugin for WooCommerce
  3. Zapier Integration

Zapier Integration

Introduction

Zapier is a tool that helps you automate repetitive tasks between two or more apps without reliance on coding or developers. During a Zapier operation, Zapier can instruct an app to perform a particular task when an event happens in another app. For more information on Zapier, please see https://zapier.com.

Zapier Integration has been introduced in the 5.12.0 version of the Booking & Appointment Plugin for WooCommerce ( BKAP) which lets you connect BKAP to hundreds of web services available on Zapier. Automated connections called Zaps can be set up in minutes and can do the following:

  • Automate your day-to-day tasks and build sophisticated workflows.
  • Automate tasks in the background, so you can focus on more important work.
  • Perform Triggers and Actions: Zap starts with a trigger—an event in one of your apps that kicks off your workflow. It has one app as the Trigger (where your information comes from) which causes one or more Actions (where your data gets sent automatically) in other apps.

Requirements

  1. Zapier Account
  2. WooCommerce 3.5+
  3. WordPress 4.4+
  4. Booking & Appointment Plugin 5.12.0+
  5. WordPress Pretty Permalinks – must be enabled
  6. WooCommerce Consumer and Secret Keys – must be generated
  7. Legacy REST API – must be enabled

Please read this tutorial for a guide on generating the WooCommerce Consumer and Secret Keys. After generating the keys, please keep them handy as they will be needed in creating a Zap.

Zapier Triggers and Actions available in BKAP

Triggers

  • Create Booking – Triggers when a new booking has been created on WordPress.
  • Update Booking – Triggers when an existing booking has been updated on WordPress.
  • Delete Booking – Triggers when an existing booking has been deleted on WordPress.

Actions

  • Create Booking – Creates a new booking on WordPress for a specified Product and Customer. Depending on the booking settings of the Product, certain required booking parameters have to be provided else the booking creation process will fail. Information on the required booking parameters is usually displayed after the selection of a Product.
  • Update Booking – Updates booking information of a specified Booking. Booking ID of the booking to be updated is required.
  • Delete Booking – Deletes a Booking. Booking ID of the booking to be deleted is required.

Note: Zapier Integration for the Booking & Appointment Plugin for WooCommerce is currently in early access. You can find it in the Zapier app directory here.

Setting up Zapier on WordPress

This step is required to ensure that Zapier is allowed to successfully interact with WordPress.

  • Go to the Booking Settings page and click on the Integrations tab. Booking -> Settings -> Integrations.
  • Click on Zapier Integration and activate the Zapier Integration option.
  • Also, activate the Zapier Trigger and Zapier Actions.
  • Activate the Log option to view debug and error messages.

 

Setting up Zap Triggers on Zapier & WordPress

A trigger is an event that starts a Zap. For example, you may want to send a Slack message each time a customer places a booking on your WooCommerce site. In this case, the trigger is Create Booking while the action is Send Channel Message in Slack.

On WooCommerce, triggers are usually triggered during:

  • Create Booking: During the checkout process and completion of the order.
  • Update Booking: On the Edit Booking page on the Admin Panel. Quantity and Date can only be updated.
  • Delete Booking: On the Edit Booking page when the “Move to trash” link is clicked.

Getting started with setting up a Zap is super easy! You just have to follow the following steps to complete your first zap!

1. Sign up for a Zapier account

To get started you’ll need a Zapier account. You may need to create an account on Zapier if you do not have one already. Once logged into the Zapier platform, click on the Create Zap button.

2. Select the Trigger app

Select Tyche Softwares as your trigger app from the list of apps.

3. Select Trigger Event

Based on what you intend to do, you can select Create Booking, Update Booking or Delete Booking. The steps to set up Zapier for Create Booking, Update Booking or Delete Booking are all similar.

4. Connect WordPress account

Here, you will need to create WC API Rest keys.

Add the Consumer Public Key as Username and Consumer Secret Key as password. In the domain field, enter the domain for your WooCommerce store.

5. Enter Trigger Label

This label would be used to identify this Trigger setting on WooCommerce, so give the label a very descriptive word.

6. Select User

Select the User to who this Trigger would be assigned. Users cannot use or execute triggers not assigned to them.

7. Test Trigger

This will place a call to the Zapier API on WooCommerce and fetch a recent booking for testing purposes.

8. Complete your Zap by adding an Action step

This is the app or execution step that will occur when the Trigger is activated by WooCommerce. For this tutorial, we’ll use Slack (a widely used team messaging app), which will send a message to a Slack channel when a booking has been created/updated/edited on WooCommerce.

In the workflow above, Slack was used as the action step in configuring the Zapier Trigger. During the configuration, Zapier would send a test message to the Slack channel to confirm that it can actually send messages to the channel.

Zapier Integration - Tyche Softwares Documentation

9. Configure Zap Trigger on WordPress

At this point, the Zap has been created successfully on Zapier. However, it is required to configure the created Zap with the WooCommerce store on WordPress. This way, WordPress would be able to effectively activate the Zapier trigger when a booking has been created, updated or deleted.

The configuration of the Zap with the WooCommerce store on WordPress involves a direct connection with a specific booking product. The booking event ( create, update or delete ) associated with the Zapier trigger and originating from the booking product would initiate the Zapier Trigger.

Zapier triggers that are not configured on WordPress will not be activated even if they have been successfully created on Zapier.

10. Test Zapier Trigger on WordPress ( optional )

A test booking can be placed on the WooCommerce store to make sure that things are working right. This is optional.

After the booking has been placed ( and based on the configuration of the Zapier trigger ), a message containing the booking information should be sent to the Slack channel.

Zapier Integration - Tyche Softwares Documentation

Setting up Zap Actions on Zapier

Zapier Actions are events that occur outside of WooCommerce and are expected to create, update or delete bookings. 

Actions on Zapier can be as a result of the execution of a non-Tyche Zap app ( Gmail, Calendar, WordPress, WebHooks etc ) which would perform a corresponding action on the WooCommerce store – create, update or delete bookings.

There are a couple of required fields when setting up Zapier Actions, especially in the case of creating bookings – where fields required for creating bookings are dependent on the type of booking – single day, multiple dates, multiple nights etc. Values for these required fields can be manually set ( when setting up the action ) or values from the Action Trigger execution ( Gmail, Calendar, WordPress, WebHooks etc ) can be used.

Create Booking Action

For the Create Booking Action, the Product and User must be specified while setting up the Zap. Based on the booking type which has been configured for the Product on WooCommerce, Zapier displays information on the required fields.

Note: All data types are sent as string to avoid data type mismatch errors.

single_day booking type

Key Label Required? Format
order_id Order ID No
quantity Booking Quantity Yes
start_date Booking Start Date Yes YYYY-MM-DD
end_date Booking End Date Yes YYYY-MM-DD
price Booking Price Yes

 

multiple_days booking type

Key Label Required? Format
order_id Order ID No
quantity Booking Quantity Yes
start_date Booking Start Date Yes YYYY-MM-DD
end_date Booking End Date Yes YYYY-MM-DD
price Booking Price Yes
fixed_block Fixed Block Yes

 

date_time booking type

Key Label Required? Format
order_id Order ID No
quantity Booking Quantity Yes
start_date Booking Start Date Yes YYYY-MM-DD
end_date Booking End Date Yes YYYY-MM-DD
price Booking Price Yes
start_time Booking Start Time Yes H:i
end_time Booking End Time Yes H:i

 

duration_time booking type

Key Label Required? Format
order_id Order ID No
quantity Booking Quantity Yes
start_date Booking Start Date Yes YYYY-MM-DD
end_date Booking End Date Yes YYYY-MM-DD
price Booking Price Yes
start_time Booking Start Time Yes H:i
duration Booking Duration Yes

 

Configuring Create Booking Action on Zapier using Google Sheet

We shall use Google Sheets to configure the Create Booking Action on Zapier. Google Sheets is used in this tutorial as it is usually used by most customers in keeping records of bookings. It would sure look like a great idea if bookings can be placed ( created ) for a customer by creating a new row entry in the spreadsheet. Let’s get started!

1. Create Spreadsheet

Here, we sign in to Google Sheets and create a new spreadsheet. We can call this spreadsheet Zapier Create Action. After creating the spreadsheet, we need to create column headers that match the required fields needed for each booking type.

2. Add Sample Data to Sheet Row

In order for the Zapier to configure the Zap for the Create Booking Action, we will need to add some sample data to the first row of the sheet. Zapier will use the sample data to test run the Zap, so we need to ensure that the sample data contains valid information.

3. Create Zap and select the Spreadsheet

Create a Zap on Zapier using Google Sheets as the trigger. For the trigger event, select Create Booking and select “New Spreadsheet Row” as the Trigger Event. We use this as we want the Google Sheets Trigger to be activated only when a new row has been added to the spreadsheet.

4. Configure Action for Zap

For the Action step, search for the Tyche Softwares Zapier app and select it as the Action app. The following points need to be taken into consideration:

  1. The Product and Customer need to be selected while creating the Zap. This selection will determine the required fields based on the booking type that has been checked on the selected product.
  2. For each of the required fields that have been displayed ( after selecting the Product ), link the field on the Zap to the entry on the Google Sheet by selecting the corresponding label on the dropdown.

 

4. Publish Zap

Turn on your created Zap so that it gets published on Zapier. The Zap will watch out for newly created rows in the Google Sheet and create bookings accordingly on your WooCommerce store.

Was this article helpful to you? Yes No

How can we help?