Create a commission
curl --request POST \
--url https://api.firstpromoter.com/api/v2/company/commissions \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"commission_type": "sale",
"referral_id": 123,
"sale_amount": 123,
"plan_id": 123,
"event_id": "<string>",
"event_date": "2023-12-25",
"internal_note": "<string>",
"external_note": "<string>",
"notify_promoter": true
}
'import requests
url = "https://api.firstpromoter.com/api/v2/company/commissions"
payload = {
"commission_type": "sale",
"referral_id": 123,
"sale_amount": 123,
"plan_id": 123,
"event_id": "<string>",
"event_date": "2023-12-25",
"internal_note": "<string>",
"external_note": "<string>",
"notify_promoter": True
}
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({
commission_type: 'sale',
referral_id: 123,
sale_amount: 123,
plan_id: 123,
event_id: '<string>',
event_date: '2023-12-25',
internal_note: '<string>',
external_note: '<string>',
notify_promoter: true
})
};
fetch('https://api.firstpromoter.com/api/v2/company/commissions', 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/company/commissions",
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([
'commission_type' => 'sale',
'referral_id' => 123,
'sale_amount' => 123,
'plan_id' => 123,
'event_id' => '<string>',
'event_date' => '2023-12-25',
'internal_note' => '<string>',
'external_note' => '<string>',
'notify_promoter' => true
]),
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/company/commissions"
payload := strings.NewReader("{\n \"commission_type\": \"sale\",\n \"referral_id\": 123,\n \"sale_amount\": 123,\n \"plan_id\": 123,\n \"event_id\": \"<string>\",\n \"event_date\": \"2023-12-25\",\n \"internal_note\": \"<string>\",\n \"external_note\": \"<string>\",\n \"notify_promoter\": true\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/company/commissions")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"commission_type\": \"sale\",\n \"referral_id\": 123,\n \"sale_amount\": 123,\n \"plan_id\": 123,\n \"event_id\": \"<string>\",\n \"event_date\": \"2023-12-25\",\n \"internal_note\": \"<string>\",\n \"external_note\": \"<string>\",\n \"notify_promoter\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/commissions")
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 \"commission_type\": \"sale\",\n \"referral_id\": 123,\n \"sale_amount\": 123,\n \"plan_id\": 123,\n \"event_id\": \"<string>\",\n \"event_date\": \"2023-12-25\",\n \"internal_note\": \"<string>\",\n \"external_note\": \"<string>\",\n \"notify_promoter\": true\n}"
response = http.request(request)
puts response.read_body[
{
"id": 123,
"status": "pending",
"metadata": {},
"is_self_referral": true,
"commission_type": "sale",
"created_by_user_email": "<string>",
"created_by_user_at": "2023-11-07T05:31:56Z",
"sale_amount": 123,
"original_sale_amount": 123,
"original_sale_currency": "<string>",
"event_id": "<string>",
"plan_id": "<string>",
"tier": 123,
"internal_note": "<string>",
"external_note": "<string>",
"unit": "cash",
"fraud_check": "no_suspicion",
"amount": 123,
"is_paid": true,
"is_split": true,
"created_at": "2023-11-07T05:31:56Z",
"status_updated_at": "2023-11-07T05:31:56Z",
"promoter_campaign": {
"id": 123,
"campaign_id": 123,
"promoter_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"promoter": {
"id": 123,
"email": "<string>",
"name": "<string>"
},
"campaign": {
"id": 123,
"name": "<string>",
"color": "<string>"
}
},
"referral": {
"id": 123,
"email": "<string>",
"uid": "<string>"
},
"reward": {
"id": 123,
"name": "<string>"
},
"split_details": {}
}
]{}{
"message": "<string>",
"code": "<string>"
}Commissions
Create a commission
Create a monetary or non-monetary commission for a promoter manually, outside of tracked sales.
POST
/
commissions
Create a commission
curl --request POST \
--url https://api.firstpromoter.com/api/v2/company/commissions \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"commission_type": "sale",
"referral_id": 123,
"sale_amount": 123,
"plan_id": 123,
"event_id": "<string>",
"event_date": "2023-12-25",
"internal_note": "<string>",
"external_note": "<string>",
"notify_promoter": true
}
'import requests
url = "https://api.firstpromoter.com/api/v2/company/commissions"
payload = {
"commission_type": "sale",
"referral_id": 123,
"sale_amount": 123,
"plan_id": 123,
"event_id": "<string>",
"event_date": "2023-12-25",
"internal_note": "<string>",
"external_note": "<string>",
"notify_promoter": True
}
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({
commission_type: 'sale',
referral_id: 123,
sale_amount: 123,
plan_id: 123,
event_id: '<string>',
event_date: '2023-12-25',
internal_note: '<string>',
external_note: '<string>',
notify_promoter: true
})
};
fetch('https://api.firstpromoter.com/api/v2/company/commissions', 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/company/commissions",
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([
'commission_type' => 'sale',
'referral_id' => 123,
'sale_amount' => 123,
'plan_id' => 123,
'event_id' => '<string>',
'event_date' => '2023-12-25',
'internal_note' => '<string>',
'external_note' => '<string>',
'notify_promoter' => true
]),
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/company/commissions"
payload := strings.NewReader("{\n \"commission_type\": \"sale\",\n \"referral_id\": 123,\n \"sale_amount\": 123,\n \"plan_id\": 123,\n \"event_id\": \"<string>\",\n \"event_date\": \"2023-12-25\",\n \"internal_note\": \"<string>\",\n \"external_note\": \"<string>\",\n \"notify_promoter\": true\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/company/commissions")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"commission_type\": \"sale\",\n \"referral_id\": 123,\n \"sale_amount\": 123,\n \"plan_id\": 123,\n \"event_id\": \"<string>\",\n \"event_date\": \"2023-12-25\",\n \"internal_note\": \"<string>\",\n \"external_note\": \"<string>\",\n \"notify_promoter\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/commissions")
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 \"commission_type\": \"sale\",\n \"referral_id\": 123,\n \"sale_amount\": 123,\n \"plan_id\": 123,\n \"event_id\": \"<string>\",\n \"event_date\": \"2023-12-25\",\n \"internal_note\": \"<string>\",\n \"external_note\": \"<string>\",\n \"notify_promoter\": true\n}"
response = http.request(request)
puts response.read_body[
{
"id": 123,
"status": "pending",
"metadata": {},
"is_self_referral": true,
"commission_type": "sale",
"created_by_user_email": "<string>",
"created_by_user_at": "2023-11-07T05:31:56Z",
"sale_amount": 123,
"original_sale_amount": 123,
"original_sale_currency": "<string>",
"event_id": "<string>",
"plan_id": "<string>",
"tier": 123,
"internal_note": "<string>",
"external_note": "<string>",
"unit": "cash",
"fraud_check": "no_suspicion",
"amount": 123,
"is_paid": true,
"is_split": true,
"created_at": "2023-11-07T05:31:56Z",
"status_updated_at": "2023-11-07T05:31:56Z",
"promoter_campaign": {
"id": 123,
"campaign_id": 123,
"promoter_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"promoter": {
"id": 123,
"email": "<string>",
"name": "<string>"
},
"campaign": {
"id": 123,
"name": "<string>",
"color": "<string>"
}
},
"referral": {
"id": 123,
"email": "<string>",
"uid": "<string>"
},
"reward": {
"id": 123,
"name": "<string>"
},
"split_details": {}
}
]{}{
"message": "<string>",
"code": "<string>"
}Authorizations
Headers
Body
application/json
- Sale Commission
- Custom Commission
Response
Successfully retrieved commissions