Installing Churni
Installing Churni on your product requires a technical installation. If you are not a developer, send these instructions to one of your front-end developers.
How does it work?
- The user clicks on your cancel button
- The user is redirected to your cancellation survey. Customer data is passed through to allow you to customize the cancellation flow or to present offers tailored to each customer.
- Depending on a customer's answers and the action on your cancellation survey, the user will be redirected to a callback URL that you will have to define.
To integrate your service with Churni.io, you will need to redirect the customer to your cancellation flow.
- To identify the customer, you will first need to generate a session by sending the customer's data to our session API endpoint.
- This will provide you with a unique URL and you will be able to redirect your customer to that URL.
const res = await fetch('https://app.churni.io/sessions', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
appID: 'YOUR_APP_ID', // Different between prod/testing envs
saveReturnURL: 'https://app.example.com/billing', // Redirect URLs
// when the user complete or quits the survey
cancelConfirmationURL: 'https://app.example.com/billing/cancel',
// Required fields to identify the customer
customer: {
id: customer.id, // your unique identifier
email: customer.email, // 'user@example.com'
name: customer.name // 'John doe',
domain: customer.domain // 'example.com',
createdAt: new Date(customer.createdAt).getTime() // Timestamp
},
variables: {
planType: 'pro' // optional variables
}
})
});
const { url } = await res.json();
// Redirect to churni.io cancel session
window.location.href = url;
Here you will find the necessary appID in your settings. The identifier is different depending on the test or production environment You can use different kind of patterns for the callbacks url
- https://app.example.com/cancel
- https://app.example.com/@acme/billing
- https://app.example.com/cancel?customerID=acme
Process cancels and offers
A user will be redirected based on their responses to the survey to either
- saveReturnURL: The user has left or accepted an offer. To apply offers or discount, a reason is passed as a URL parameter (https://app.example.com/billing?reason=offer_accepted)
- cancelConfirmationURL: The user has confirmed his intention to cancel his subscription. You should display a confirmation message and process his cancellation
You can specify save reasons by customizing the buttons on your CTA page.
By default, Churni provides two save reasons:
- footer_link : User has clicked on the link "Nevermind, take me back to my account"
- abandoned : User has left the survey
You can also use webhooks to process cancellations and offers. If you don’t have an automatic cancel process built-in or a way to programmatically change the terms of a customer’s, you can use the slack integration or emails alert through zapier to notify your support team.