cURL
curl --request POST \
--url https://firstpromoter.com/api/v1/track/cancellation \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/track/cancellation"
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/track/cancellation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://firstpromoter.com/api/v1/track/cancellation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://firstpromoter.com/api/v1/track/cancellation"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://firstpromoter.com/api/v1/track/cancellation")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/track/cancellation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 33848911,
"type": "cancellation",
"amount_cents": null,
"reward": null,
"lead": {
"id": 20738339,
"state": "cancelled",
"email": "[email protected]",
"uid": null,
"customer_since": "2024-09-11T14:22:12.160Z",
"cancelled_at": "2024-09-11T15:07:46.174Z",
"plan_name": null,
"suspicion": "no_suspicion",
"username": null,
"website": null,
"created_at": "2024-09-09T16:22:44.168Z",
"split_promotion_id": null,
"custom_fields": null,
"split_percentage_value": null,
"visitor_sub_id": null
},
"promoter": {
"id": 3920164,
"status": "active",
"cust_id": "",
"email": "[email protected]",
"created_at": "2022-04-26T15:28:24.800Z",
"temp_password": "xxxxxxxxxx",
"default_promotion_id": 4210919,
"pref": "db1znwe",
"default_ref_id": "8yi2epelut",
"note": "This is a note",
"w8_form_url": null,
"w9_form_url": null,
"parent_promoter_id": 577918,
"earnings_balance": {
"cash": 50744
},
"current_balance": {
"cash": 20044
},
"paid_balance": {
"cash": 30700
},
"auth_token": "xxxxxxxxxxxxxx"
}
}{
"message": "Error. Email and uid can not be blank!"
}Tracking
Tracking cancellations
This call will mark the customer as cancelled and will decrease the MRR generated by him/her.
HTTP Request
POST https://firstpromoter.com/api/v1/track/cancellationPOST
/
cancellation
cURL
curl --request POST \
--url https://firstpromoter.com/api/v1/track/cancellation \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/track/cancellation"
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/track/cancellation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://firstpromoter.com/api/v1/track/cancellation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://firstpromoter.com/api/v1/track/cancellation"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://firstpromoter.com/api/v1/track/cancellation")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/track/cancellation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 33848911,
"type": "cancellation",
"amount_cents": null,
"reward": null,
"lead": {
"id": 20738339,
"state": "cancelled",
"email": "[email protected]",
"uid": null,
"customer_since": "2024-09-11T14:22:12.160Z",
"cancelled_at": "2024-09-11T15:07:46.174Z",
"plan_name": null,
"suspicion": "no_suspicion",
"username": null,
"website": null,
"created_at": "2024-09-09T16:22:44.168Z",
"split_promotion_id": null,
"custom_fields": null,
"split_percentage_value": null,
"visitor_sub_id": null
},
"promoter": {
"id": 3920164,
"status": "active",
"cust_id": "",
"email": "[email protected]",
"created_at": "2022-04-26T15:28:24.800Z",
"temp_password": "xxxxxxxxxx",
"default_promotion_id": 4210919,
"pref": "db1znwe",
"default_ref_id": "8yi2epelut",
"note": "This is a note",
"w8_form_url": null,
"w9_form_url": null,
"parent_promoter_id": 577918,
"earnings_balance": {
"cash": 50744
},
"current_balance": {
"cash": 20044
},
"paid_balance": {
"cash": 30700
},
"auth_token": "xxxxxxxxxxxxxx"
}
}{
"message": "Error. Email and uid can not be blank!"
}Authorizations
Query Parameters
required if uid is null
Email of the lead/sign-up
required if email is null
uid of the lead added on signup tracking
Unique ID of the cancellation event from your billing provider. Used for deduplication.
ISO 8601 date string of when the cancellation occurred. Defaults to now.
Set to true to skip email notifications. Default is false.
⌘I