cURL
curl --request POST \
--url https://api.firstpromoter.com/api/v2/track/cancellation \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"uid": "<string>"
}
'import requests
url = "https://api.firstpromoter.com/api/v2/track/cancellation"
payload = {
"email": "<string>",
"uid": "<string>"
}
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Account-ID': '<account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({email: '<string>', uid: '<string>'})
};
fetch('https://api.firstpromoter.com/api/v2/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://api.firstpromoter.com/api/v2/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_POSTFIELDS => json_encode([
'email' => '<string>',
'uid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Account-ID: <account-id>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firstpromoter.com/api/v2/track/cancellation"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"uid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Account-ID", "<account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firstpromoter.com/api/v2/track/cancellation")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"uid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/track/cancellation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"uid\": \"<string>\"\n}"
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 Api
Tracking cancellations
This call will mark the customer as cancelled and will decrease the MRR generated by them.
HTTP Request
POST https://api.firstpromoter.com/api/v2/track/cancellationPOST
/
cancellation
cURL
curl --request POST \
--url https://api.firstpromoter.com/api/v2/track/cancellation \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"uid": "<string>"
}
'import requests
url = "https://api.firstpromoter.com/api/v2/track/cancellation"
payload = {
"email": "<string>",
"uid": "<string>"
}
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Account-ID': '<account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({email: '<string>', uid: '<string>'})
};
fetch('https://api.firstpromoter.com/api/v2/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://api.firstpromoter.com/api/v2/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_POSTFIELDS => json_encode([
'email' => '<string>',
'uid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Account-ID: <account-id>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firstpromoter.com/api/v2/track/cancellation"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"uid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Account-ID", "<account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firstpromoter.com/api/v2/track/cancellation")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"uid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/track/cancellation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"uid\": \"<string>\"\n}"
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
API key passed as a Bearer token in the Authorization header. You can find your API Key on Your FirstPromoter Dashboard. Navigate to Settings → Integrations section → Manage API Keys
Headers
Account id. You can find your Account ID on Your FirstPromoter Dashboard. Navigate to Settings → Integrations
Body
application/json
⌘I