This article applies to Contextual Commerce. (Looking for Classic Commerce documentation?)
Zapier is a third-party, user-friendly, online automation tool that makes it easier to connect two or more unrelated web applications. Normally when two systems do not integrate directly, middleware must be coded and hosted to handle communication between the systems. Using Zapier, however, these communications can be processed and tasks can be dynamically triggered using only a limited amount of coding.
FastSpring sellers may choose to use Zapier to parse their webhook event posts and then pass that data to their own external solutions (e.g., CRM tools, accounting tools such as QuickBooks, etc.).
Zapier is a separate company and is not related to FastSpring. Please bear the following in mind:
- The information in this article is provided as a convenience only, and is subject to change without notice.
- FastSpring makes no claim and offers no warranty or guarantee regarding the availability or up-time of any third-party service, including Zapier.
- You are responsible for GDPR compliance and the security of all webhook event data that FastSpring may post, at your direction, to the endpoints specified in your FastSpring Store, including URLs of apps / services hosted by your company and / or by any third party (e.g. Zapier). For information from Zapier regarding their service's GDPR status, please see https://zapier.com/help/gdpr/.
- Zapier offers various pricing plans, including a free plan. In order to use the service, you must have a Zapier account and you may need a paid plan. For more on Zapier's pricing, see https://zapier.com/help/plans-pricing/.
Setting Up a Zap to Parse a Webhook Event
- After creating your Zapier account, log on at https://zapier.com/app/login/.
- From the menu at the top of the page, click Make a Zap!.
- In the left-hand pane, click the Name Your zap field and enter a name for the zap. For example, you might give it a name matching the webhook event that you will be sending to this zap (e.g. order.completed).
- In the central area of the page, under Choose a Trigger App, select Webhooks.
- In the next dialog, click show less common options.
- Select Catch Raw Hook and then click Save + Continue.
- In the Pick a Sample to Set Up your Zap dialog, click Copy to copy the Zapier URL to your clipboard.
- Log on to your FastSpring Dashboard at https://dashboard.fastspring.com.
- On the Webhooks tab of the Integrations menu, click ADD WEBHOOK.
- In the Title field of the Add Webhook dialog, enter a name for the new configuration, such as Zapier. You will be able to add multiple Zapier URLs to the same configuration as needed.
In the Edit Server Webhook dialog, click the URL field and paste in the URL that you copied from your Zapier zap above. Then, select the check box next to the webhook event to which you want to subscribe, and click ADD.
ReminderWe recommend creating a separate "zap" for each FastSpring webhook event type (e.g. order.completed) to which you want to subscribe, to avoid complications on the Zapier side, so you should only select one event to be posted to the zap URL you are pasting in.
- Back in your browser tab with the Zapier page, click OK, I did this in the still-open Pick a Sample to Set Up Your Zap dialog.
In your FastSpring Store, run a test transaction or simulate an event (depending on the type of event to which you have subscribed above). For example, if you have subscribed to the order.completed event, you can place a new test order to fire that event to the new webhook configuration.
NoteYou may need to wait a few minutes between creating a new webhook configuration and testing it (e.g. by placing a test order).
- Once Zapier has received the webhook event posting, the Pick a Sample to Set Up Your Zap dialog in your Zapier configuration will be updated to show that an event has been received, as in the following illustration. Click Continue.
- In the Almost finished here! dialog, click the Your Zap currently lacks an Action step. Add one now! link.
- In the Choose an Action App dialog, select Code.
- In the Select Code by Zapier Action dialog, select Run Python and then click Save + Continue.
- Next, in the first field under Input Data, enter "data". Then click the drop-down selector in the adjacent field and select Raw Body.
In the Code field, first delete the example code and then replace it by copying and pasting in the following code, and then click Continue:
- In the Test Code by Zapier dialog, click Send Test to Code by Zapier.
- The Test Code by Zapier dialog will be updated to let you know that the test was successful. Click Finish.
Congratulations, you have completed the initial setup process for the selected webhook event. You will now have access to all of the data in the event for any other steps you may add to your zap.
Once you have set up a zap to parse the incoming data posted from FastSpring for a certain event, the next step is to add one or more actions to your zap to do whatever you want with that data. Zapier offers actions for over 1,000 apps. For example, you might choose to use the Create Sales Receipt action with your QuickBooks Online app to conditionally send selected order data to QuickBooks. Since you presumably do not want data from future test orders to be posted to the service, you could add a condition to your zap so that the action would only occur when the Boolean data live field of an order.completed webhook event is true.
Once you have added actions to your zap to take advantage of the data it receives, remember to turn the zap on so it will be live and ready to execute those actions.