Criar programa de afiliados
curl --request POST \
--url https://alpa-sistema-api.onrender.com/api/affiliate/programs \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissionValue": 2,
"cookieDays": 30,
"isActive": true,
"description": "<string>",
"rules": "<string>",
"affiliatePage": "<string>",
"salesPage": "<string>",
"extendedCommission": false
}
'import requests
url = "https://alpa-sistema-api.onrender.com/api/affiliate/programs"
payload = {
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissionValue": 2,
"cookieDays": 30,
"isActive": True,
"description": "<string>",
"rules": "<string>",
"affiliatePage": "<string>",
"salesPage": "<string>",
"extendedCommission": False
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
commissionValue: 2,
cookieDays: 30,
isActive: true,
description: '<string>',
rules: '<string>',
affiliatePage: '<string>',
salesPage: '<string>',
extendedCommission: false
})
};
fetch('https://alpa-sistema-api.onrender.com/api/affiliate/programs', 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://alpa-sistema-api.onrender.com/api/affiliate/programs",
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([
'productId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'commissionValue' => 2,
'cookieDays' => 30,
'isActive' => true,
'description' => '<string>',
'rules' => '<string>',
'affiliatePage' => '<string>',
'salesPage' => '<string>',
'extendedCommission' => false
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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://alpa-sistema-api.onrender.com/api/affiliate/programs"
payload := strings.NewReader("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissionValue\": 2,\n \"cookieDays\": 30,\n \"isActive\": true,\n \"description\": \"<string>\",\n \"rules\": \"<string>\",\n \"affiliatePage\": \"<string>\",\n \"salesPage\": \"<string>\",\n \"extendedCommission\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://alpa-sistema-api.onrender.com/api/affiliate/programs")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissionValue\": 2,\n \"cookieDays\": 30,\n \"isActive\": true,\n \"description\": \"<string>\",\n \"rules\": \"<string>\",\n \"affiliatePage\": \"<string>\",\n \"salesPage\": \"<string>\",\n \"extendedCommission\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://alpa-sistema-api.onrender.com/api/affiliate/programs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissionValue\": 2,\n \"cookieDays\": 30,\n \"isActive\": true,\n \"description\": \"<string>\",\n \"rules\": \"<string>\",\n \"affiliatePage\": \"<string>\",\n \"salesPage\": \"<string>\",\n \"extendedCommission\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissionValue": 123,
"cookieDays": 123,
"isActive": true,
"description": "<string>",
"rules": "<string>",
"affiliatePage": "<string>",
"salesPage": "<string>",
"extendedCommission": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"price": 123,
"imageUrl": "<string>",
"description": "<string>"
},
"user": {
"name": "<string>"
},
"_count": {
"links": 123
}
}
}{
"message": "<string>",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"errors": [
{}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Afiliados
Criar Programa
Cria um programa de afiliados para um produto do anunciante
POST
/
api
/
affiliate
/
programs
Criar programa de afiliados
curl --request POST \
--url https://alpa-sistema-api.onrender.com/api/affiliate/programs \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissionValue": 2,
"cookieDays": 30,
"isActive": true,
"description": "<string>",
"rules": "<string>",
"affiliatePage": "<string>",
"salesPage": "<string>",
"extendedCommission": false
}
'import requests
url = "https://alpa-sistema-api.onrender.com/api/affiliate/programs"
payload = {
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissionValue": 2,
"cookieDays": 30,
"isActive": True,
"description": "<string>",
"rules": "<string>",
"affiliatePage": "<string>",
"salesPage": "<string>",
"extendedCommission": False
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
commissionValue: 2,
cookieDays: 30,
isActive: true,
description: '<string>',
rules: '<string>',
affiliatePage: '<string>',
salesPage: '<string>',
extendedCommission: false
})
};
fetch('https://alpa-sistema-api.onrender.com/api/affiliate/programs', 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://alpa-sistema-api.onrender.com/api/affiliate/programs",
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([
'productId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'commissionValue' => 2,
'cookieDays' => 30,
'isActive' => true,
'description' => '<string>',
'rules' => '<string>',
'affiliatePage' => '<string>',
'salesPage' => '<string>',
'extendedCommission' => false
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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://alpa-sistema-api.onrender.com/api/affiliate/programs"
payload := strings.NewReader("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissionValue\": 2,\n \"cookieDays\": 30,\n \"isActive\": true,\n \"description\": \"<string>\",\n \"rules\": \"<string>\",\n \"affiliatePage\": \"<string>\",\n \"salesPage\": \"<string>\",\n \"extendedCommission\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://alpa-sistema-api.onrender.com/api/affiliate/programs")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissionValue\": 2,\n \"cookieDays\": 30,\n \"isActive\": true,\n \"description\": \"<string>\",\n \"rules\": \"<string>\",\n \"affiliatePage\": \"<string>\",\n \"salesPage\": \"<string>\",\n \"extendedCommission\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://alpa-sistema-api.onrender.com/api/affiliate/programs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissionValue\": 2,\n \"cookieDays\": 30,\n \"isActive\": true,\n \"description\": \"<string>\",\n \"rules\": \"<string>\",\n \"affiliatePage\": \"<string>\",\n \"salesPage\": \"<string>\",\n \"extendedCommission\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissionValue": 123,
"cookieDays": 123,
"isActive": true,
"description": "<string>",
"rules": "<string>",
"affiliatePage": "<string>",
"salesPage": "<string>",
"extendedCommission": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"price": 123,
"imageUrl": "<string>",
"description": "<string>"
},
"user": {
"name": "<string>"
},
"_count": {
"links": 123
}
}
}{
"message": "<string>",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"errors": [
{}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Chave de API obtida através do endpoint /api/credentials. Também aceita formato Bearer Token: Authorization: Bearer <api_key>
Body
application/json
ID do produto
Available options:
PERCENTAGE, FIXED Para PERCENTAGE: % × 100 (ex: 1000 = 10%). Para FIXED: centavos.
Required range:
x >= 1Required range:
1 <= x <= 365Maximum string length:
2000Maximum string length:
5000⌘I

