curl --request POST \
--url https://firstpromoter.com/api/v1/track/signup \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/track/signup"
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/signup', 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/signup",
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/signup"
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/signup")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/track/signup")
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": 33765409,
"type": "signup",
"amount_cents": 123,
"reward": "<string>",
"lead": {
"id": 20738339,
"state": "cancelled",
"email": "hello@testmintli.com",
"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": "peluwydo@mailinator.com",
"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!"
}{
"message": "Visitor invalid, not found or you are trying to use the signup tracking test via API which doesn't work on API calls."
}{
"transaction_id": "there is already a signup event registered on this lead"
}Tracking leads and sign-ups
Capture a lead when they sign-up or fill an optin form. This endpoint is used to track leads and sign-ups. It’s not for tracking the actual sales and commissions.
Sign-ups are tracked as leads in FirstPromoter so when a person referred by the promoter/affiliate signs up, a new referral should be added inside FirstPromoter (you can see them inside the Referrals section as Leads).
_fprom_tid (_fprom_track for accounts created prior to April 2021) cookie value(which keeps the tracking id and referral identification) on your server and send it along with the sign-up data through the tid parameter. Alternative: In some special cases, you can refer sign ups directly to a promoter, by passing the referral id through ref_id parameter. Be careful when using this because the referral id can be modified by the promoter by default, however you can disable that from the campaign configuration page.
POST https://firstpromoter.com/api/v1/track/signupcurl --request POST \
--url https://firstpromoter.com/api/v1/track/signup \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/track/signup"
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/signup', 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/signup",
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/signup"
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/signup")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/track/signup")
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": 33765409,
"type": "signup",
"amount_cents": 123,
"reward": "<string>",
"lead": {
"id": 20738339,
"state": "cancelled",
"email": "hello@testmintli.com",
"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": "peluwydo@mailinator.com",
"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!"
}{
"message": "Visitor invalid, not found or you are trying to use the signup tracking test via API which doesn't work on API calls."
}{
"transaction_id": "there is already a signup event registered on this lead"
}Authorizations
Query Parameters
required if uid is null
Email of the lead/sign-up
required if email is null
ID to match the sale with the lead if the email can be changed before the first sale. If the sales are tracked by our built-in integrations and not by our API, the uid must match customer ID on Stripe, Braintree, Chargebee, Recurly. Since Stripe doesn't allow pre-defined customer id, you can also pass the uid value as fp_uid in customer metadata later, when you create the customer object.
required if ref_id is null
Visitor tracking ID. It's set when the visitor tracking script tracks the referral visit on our system. The value is found inside _fprom_tid cookie. Grab that value from the cookie and pass it here to match the lead with the referral.
required if tid is null
Default referral id of the promoter. Use this only when you want to assign the lead to a specific promoter.
IP of the visitor who generated the sign up. It's used for fraud analysis.
Email of the promoter
ISO date string of the date of the signup event
Set this to true to skip email notifications. Default is false.
Username of the lead.
First name of the lead.
Last name of the lead.
Website URL of the lead.
JSON object of custom field key-value pairs to store on the lead.
Subscriber/visitor sub-ID for tracking sub-channels.
Set to true to overwrite an existing lead record with the supplied data.