Set up the cancellation automation


 

In order to set up cancellation automation with Stripe, you need to set up the webhook in your Stripe account to listen for the cancellation event.

 

You can use the built-in Inbound webhook of UChat to set this up.

 

Also there is another important element we need to automate the cancellation process, we need the workspace ID of the customer.

 

You won’t find this parameter in the webhooks, so you need to maintain a database to keep track of the workspace ID & subscription ID (which is unique value for each subscription)

 

So, this automation might take some time to set up. Let’s get started right now.

 

Set up inbound webhook for cancellation

Usually you can set this up with a platform like Zapier/Make/Pabbly connect, but since all the subscription purchases generated from the chatbot have the meta data sent over to Stripe. So you can set up an inbound webhook right with UChat.

 

In this video, you will learn how to trigger the cancellation event, and how to find the JSON path of the userNS, and then you can pull the information from the webhook event.

 

Check the below video for more details:

 

Build cancellation of the main plan

In this video, we will build the cancellation automation of the main plan, after the plan got canceled, we will turn off the auto-renew.

 

The customer will still get access to the paid plan until the end of the current billing cycle.

 

Check the below video for more details:

 

Update Google sheet with subscription ID

In the previous video, we found the need to capture the subscription ID when the user subscribed successfully.

 

This value is the key element that we can use to search & identify the workspace we need to automate with.

 

So check the details video below to see how to update the purchase with the subscription ID.

 

Update cancellation inbound webhook

In the previous video, we already collect the subscription ID when the customer subscribes, and now we can make updates to the cancellation inbound webhook we have built before.

 

We will search the Google sheet we received for the cancellation event, and then if we can find the purchase record, we will save the workspace ID to use in the next step.

 

Check the below video for more details:

 

Update the cancellation flow

In the previous video, we can already get the workspace ID in the cancellation events, and now we can update the cancellation flow, and add the conditional checks and make sure our functions flow to cancel the main plan or add-on works properly.

 

Check the below video for more details:

 

Debug purchase & cancellation automation

Now, we have finished building the purchase and canceled the automation. It’s time for us to test and debug these automation.

 

Check the below video for more details: