Launching your Flow

Launching your Flow

Launching your Flow

Once you’ve completed Step 1 - Adding the Embed Script and Step 2 - Generating the Security Token, the last step you need to do is Step 3 - Launching your Flow.
To launch the flow, you are only required to provide 2 parameters: the subscriptionId and the authKey generated in Step 2.
Here’s the simplest call you can make to launch Raaft:
raaft('startCancelFlow', { subscriptionId: '<processor-subscription-id>', authKey: '<security-token>' });
This will show your default active retention flow to your user. You should also specify the flowId, if you don’t want Raaft to use the default one.

Flow Parameters

The example above represents the simplest use case. However, you can provide additional parameters to customise the behaviour of the flow.
Here’s an example of a flow with some additional details.
raaft('startCancelFlow', subscriptionId: 'fdak4k3k4223m', flowId: 'XW3DS543543DSX', customer: { name: 'Bill Gates', email: 'bill.gates@microsoft.com', photo: 'https://news.microsoft.com/uploads/prod/2017/03/gates_page.png' }, settings: { zIndex: 100, spinnerColor: '#42b983', demoMode: true }, onComplete: function (outcome) { // do something interesting } }
The parameters you can pass to your Raaft flow are the following:

subscriptionId (required, if the processor is connected)

The subscription identifier issued by your processor (ex: Stripe, Chargebee, Recurly, etc.).
đź’ˇ
Note: If your processor is not connected and your Flow’s outcome is set to “Send Email to Support”, then you can pass customer details (see below) instead of the subscriptionId.

authKey (required)

The security token ensures that communication between your site and Raaft remain private and secure. You can learn more about the Security Token here.
 

flowId (optional)

The id of an alternate active retention flow you want to present to your user. If the flow is not found or is not active, the default will be presented.
 

customer.name (optional)

It overrides the name of the customer shown in the dashboard. By default, the customer name is retrieved from the payment processor.
 

customer.email (optional)

It overrides the email address of the customer shown in the dashboard. By default, the customer email is retrieved from the payment processor.
 

customer.photo (optional)

It sets a url for the customer's photo shown in the dashboard. By default, the customer profile photo is retrieved from the payment processor.
 
🚧
Warning: The customer email field is required if you don’t have a payment processor connected and you are launching a Flow with the “Send Email to Support” cancellation outcome.
 

settings.zIndex (optional)

You can specify a zIndex for the modal to appear. By default, this is set to 100.
 

settings.spinnerColor (optional)

You can specify a hex value color for the spinner.
 

settings.demoMode (optional)

If you want to test the flow without any results being recorded, you can use it with Demo mode set to true. By default, this is set to false.
 

onComplete (optional)

You can define a callback function that will be executed prior to exiting the flow. The callback will receive a single argument: an object representing the results of the flow. Here is a more detailed explanation of how this works.