Skip to main content
POST
/
commissions
/
approve
Approve commissions
curl --request POST \
  --url https://api.firstpromoter.com/api/v2/company/commissions/approve \
  --header 'Account-ID: <account-id>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ids": [
    123
  ]
}
'
import requests

url = "https://api.firstpromoter.com/api/v2/company/commissions/approve"

payload = { "ids": [123] }
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({ids: [123]})
};

fetch('https://api.firstpromoter.com/api/v2/company/commissions/approve', 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/approve",
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([
'ids' => [
123
]
]),
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/approve"

payload := strings.NewReader("{\n \"ids\": [\n 123\n ]\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/approve")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n 123\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.firstpromoter.com/api/v2/company/commissions/approve")

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 \"ids\": [\n 123\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "status": "completed",
  "total": 123,
  "selected_total": 123,
  "processed_count": 123,
  "failed_count": 123,
  "action_label": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "meta": {},
  "progress": 123,
  "processing_errors": [
    "<string>"
  ]
}
{
"id": 123,
"status": "pending",
"total": 123,
"selected_total": 123,
"processed_count": 123,
"failed_count": 123,
"action_label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"meta": {},
"progress": 123,
"processing_errors": [
"<string>"
]
}
{
"message": "<string>",
"code": "<string>"
}
{
"message": "<string>",
"code": "<string>"
}

Authorizations

Authorization
string
header
required

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
string
required

Account id. You can find your Account ID on Your FirstPromoter Dashboard. Navigate to Settings → Integrations

Body

application/json
ids
integer[]

Array of commission Ids. If there are more than 5 ids on this param/field, the action will be processed asynchronously. The response for the batch status will most likely be in_progress. The available statuses are pending, in_progress, completed, failed and stopped

Response

Operation completed successfully

id
integer

Batch ID

status
enum<string>

Status of the batch operation (always completed for synchronous operations)

Available options:
completed
total
integer

Total number of items

selected_total
integer

Total number of selected items

processed_count
integer

Number of processed items

failed_count
integer

Number of failed operations

action_label
string

Label for the action

created_at
string<date-time>

Creation date of the batch operation

updated_at
string<date-time>

Last update date of the batch operation

meta
object

Additional metadata

progress
integer

Progress of the batch operation

processing_errors
string[]

List of processing errors if any