Cancellation

The cancellation event stream represents the occurrence of cancellations in your data, enabling likelihood to churn predictions.

In this tutorial, we'll show you how to:

  • Add data representing your cancellation events using a dataset.

Let's dive in.

  1. You'll need a Faraday account — signup is free!

Add data

Create a cancellation event stream

Using CSV as an easy example

This section describes how to add data securely using a CSV file that you export from your data infrastructure.

Most Faraday users eventually update their configuration to pull data directly from their data warehouses, cloud buckets, or databases. To do that, you’ll add your source as a Connection and then choose it below instead of CSV.

For more, see our docs on Datasets and Connections.

  1. Extract a CSV representing your cancellation from your systems, or download the sample transactions file from Farazona. Either way, save it someplace memorable.
API via cURL
Dashboard

First, upload your data with a POST /uploads request:

curl --request POST \ --url https://api.faraday.ai/v1/uploads/cancellations/YOUR_CSV_FILE.csv \ --header 'Accept: application/json' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/octet-stream' \ --data-binary "@YOUR_CSV_FILE.csv"

Then use a POST /datasets request to register the data:

curl https://api.faraday.ai/datasets --json '{
  "name": "Cancellation",
  "identity_sets": {
    "shipping": {
      "city": "shipping_city",
      "house_number_and_street": [
        "shipping_address1",
        "shipping_address2"
      ],
      "person_first_name": "shipping_address_fn",
      "person_last_name": "shipping_address_ln",
      "postcode": "shipping_postcode",
      "state": "shipping_state"
    }
  },
  "options": {
    "type": "hosted_csv",
    "upload_directory": "cancellation_data_files"
  },
  "output_to_streams": {
    "cancellation": {
      "data_map": {
        "datetime": "created_at"
      },
      "value": "total"
    }
  }
}'

Your event stream will start building in the background. You can proceed immediately with the next set of instructions. When your stream is done building, you’ll get an email.