cURL
curl --request POST \
--url https://firstpromoter.com/api/v1/payouts/create \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/payouts/create"
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/payouts/create', 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/payouts/create",
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/payouts/create"
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/payouts/create")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/payouts/create")
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": 2710287,
"status": "pending",
"amount": 3000,
"date_paid": null,
"due_date": "2024-10-11T00:00:00.000Z",
"unit": "cash",
"created_at": "2024-09-12T14:02:53.135Z",
"has_issues": false,
"reward": null,
"promoter": {
"id": 8262622,
"status": "active",
"cust_id": "",
"email": "[email protected]",
"created_at": "2024-05-27T17:43:38.935Z",
"temp_password": "xsKyiS",
"default_promotion_id": 9441115,
"pref": "w4wfj9q",
"default_ref_id": "testxeak1xz1",
"note": "This is a test promoter. You can use it to test the integration.",
"w8_form_url": null,
"w9_form_url": null,
"parent_promoter_id": null,
"earnings_balance": {
"cash": 23000
},
"current_balance": {
"cash": 23000
},
"paid_balance": null,
"auth_token": "bFahsKx8v9_zL9sPTZCDH8JnQAbTeDpy"
},
"campaign": {
"id": 15161,
"name": "Test new campaign",
"landing_url": "http://testmax.maxwelladapoe1.com/",
"description": "",
"private": false,
"color": "#00bcd4",
"default_webhook_url": "",
"auto_approve_rewards": true,
"auto_approve_promoters": true
}
}{
"error": "You need to pass either promoter_email or promoter_id."
}Payouts
Create a new payout
This call allows you to create a payout for a specific promoter for the entire unpaid amount.
POST
/
create
cURL
curl --request POST \
--url https://firstpromoter.com/api/v1/payouts/create \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/payouts/create"
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/payouts/create', 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/payouts/create",
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/payouts/create"
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/payouts/create")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/payouts/create")
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": 2710287,
"status": "pending",
"amount": 3000,
"date_paid": null,
"due_date": "2024-10-11T00:00:00.000Z",
"unit": "cash",
"created_at": "2024-09-12T14:02:53.135Z",
"has_issues": false,
"reward": null,
"promoter": {
"id": 8262622,
"status": "active",
"cust_id": "",
"email": "[email protected]",
"created_at": "2024-05-27T17:43:38.935Z",
"temp_password": "xsKyiS",
"default_promotion_id": 9441115,
"pref": "w4wfj9q",
"default_ref_id": "testxeak1xz1",
"note": "This is a test promoter. You can use it to test the integration.",
"w8_form_url": null,
"w9_form_url": null,
"parent_promoter_id": null,
"earnings_balance": {
"cash": 23000
},
"current_balance": {
"cash": 23000
},
"paid_balance": null,
"auth_token": "bFahsKx8v9_zL9sPTZCDH8JnQAbTeDpy"
},
"campaign": {
"id": 15161,
"name": "Test new campaign",
"landing_url": "http://testmax.maxwelladapoe1.com/",
"description": "",
"private": false,
"color": "#00bcd4",
"default_webhook_url": "",
"auto_approve_rewards": true,
"auto_approve_promoters": true
}
}{
"error": "You need to pass either promoter_email or promoter_id."
}Authorizations
Query Parameters
required if promoter_id is null
Email of the promoter
required if promoter_email is null
Id of the promoter to assign the payout
The payout status
Available options:
pending, processing, completed For what campaign to create the payout. If it is null, we'll take the promoter's default
Response
Success response
Example:
2710287
Example:
"pending"
Example:
3000
Example:
null
Example:
"2024-10-11T00:00:00.000Z"
Example:
"cash"
Example:
"2024-09-12T14:02:53.135Z"
Example:
false
Example:
null
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I