Conversions
Add commissions to a conversion
POST
/
conversions
/
{conversion_id}
/
commissions
/
Add commissions to a conversion
curl --request POST \
--url https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
[
{
"conversion_sub_amount": 20,
"comment": "Awesome!"
}
]
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{conversion_sub_amount: 20, comment: 'Awesome!'}])
};
fetch('https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/"
payload = [
{
"conversion_sub_amount": 20,
"comment": "Awesome!"
}
]
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tapfiliate.com/1.6/conversions/{conversion_id}/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([
[
'conversion_sub_amount' => 20,
'comment' => 'Awesome!'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}require 'uri'
require 'net/http'
url = URI("https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"conversion_sub_amount\": 20,\n \"comment\": \"Awesome!\"\n }\n]"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/"
payload := strings.NewReader("[\n {\n \"conversion_sub_amount\": 20,\n \"comment\": \"Awesome!\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"conversion_sub_amount\": 20,\n \"comment\": \"Awesome!\"\n }\n]")
.asString();[
{
"id": 3,
"conversion_sub_amount": 20,
"amount": 2,
"commission_type": "standard",
"approved": null,
"kind": "regular",
"affiliate": {
"id": "janejameson",
"firstname": "Jane",
"lastname": "Jameson"
},
"currency": "USD",
"created_at": "2021-03-03T12:39:19+0000",
"payout": null,
"comment": "Awesome!",
"final": null,
"commission_name": "standard"
},
{
"id": 4,
"conversion_sub_amount": 20,
"amount": 1,
"commission_type": "level-2",
"approved": null,
"kind": "level",
"affiliate": {
"id": "sandrasanderson",
"firstname": "Sandra",
"lastname": "Sanderson"
},
"currency": "USD",
"created_at": "2021-03-03T12:39:19+0000",
"payout": null,
"comment": null,
"final": null,
"commission_name": "Level 2"
}
]{
"errors": [
{
"message": "Missing mandatory parameter(s)"
}
]
}{
"message": "Authentication Failed.",
"code": 401
}{
"message": "Forbidden",
"code": 403,
"traceId": "04ed655728a22bc0d39f"
}{
"message": "Not Found",
"code": 404,
"traceId": "7ae8e92b77572da03805"
}Authorizations
Your API key, from your Tapfiliate account settings.
Path Parameters
Numeric id of the conversion to add the commission(s) to.
Body
application/json
The amount on which the commission should be calculated using the supplied, or the program's default commission type
Example:
50
If no commission type is supplied, the programs default commission type is used
Example:
"mycommissiontype"
A comment for this commission. The comment will be visible to the affiliate
Example:
"Awesome!"
Response
OK
Show child attributes
Show child attributes
⌘I
Add commissions to a conversion
curl --request POST \
--url https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
[
{
"conversion_sub_amount": 20,
"comment": "Awesome!"
}
]
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{conversion_sub_amount: 20, comment: 'Awesome!'}])
};
fetch('https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/"
payload = [
{
"conversion_sub_amount": 20,
"comment": "Awesome!"
}
]
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tapfiliate.com/1.6/conversions/{conversion_id}/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([
[
'conversion_sub_amount' => 20,
'comment' => 'Awesome!'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}require 'uri'
require 'net/http'
url = URI("https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"conversion_sub_amount\": 20,\n \"comment\": \"Awesome!\"\n }\n]"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/"
payload := strings.NewReader("[\n {\n \"conversion_sub_amount\": 20,\n \"comment\": \"Awesome!\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"conversion_sub_amount\": 20,\n \"comment\": \"Awesome!\"\n }\n]")
.asString();[
{
"id": 3,
"conversion_sub_amount": 20,
"amount": 2,
"commission_type": "standard",
"approved": null,
"kind": "regular",
"affiliate": {
"id": "janejameson",
"firstname": "Jane",
"lastname": "Jameson"
},
"currency": "USD",
"created_at": "2021-03-03T12:39:19+0000",
"payout": null,
"comment": "Awesome!",
"final": null,
"commission_name": "standard"
},
{
"id": 4,
"conversion_sub_amount": 20,
"amount": 1,
"commission_type": "level-2",
"approved": null,
"kind": "level",
"affiliate": {
"id": "sandrasanderson",
"firstname": "Sandra",
"lastname": "Sanderson"
},
"currency": "USD",
"created_at": "2021-03-03T12:39:19+0000",
"payout": null,
"comment": null,
"final": null,
"commission_name": "Level 2"
}
]{
"errors": [
{
"message": "Missing mandatory parameter(s)"
}
]
}{
"message": "Authentication Failed.",
"code": 401
}{
"message": "Forbidden",
"code": 403,
"traceId": "04ed655728a22bc0d39f"
}{
"message": "Not Found",
"code": 404,
"traceId": "7ae8e92b77572da03805"
}