Join Affiliate Program
curl --request POST \
--url https://api.centralcart.io/v1/webstore/affiliate/join \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-store-domain: <x-store-domain>' \
--data '
{
"ref_code": "joao"
}
'import requests
url = "https://api.centralcart.io/v1/webstore/affiliate/join"
payload = { "ref_code": "joao" }
headers = {
"x-store-domain": "<x-store-domain>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-store-domain': '<x-store-domain>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ref_code: 'joao'})
};
fetch('https://api.centralcart.io/v1/webstore/affiliate/join', 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.centralcart.io/v1/webstore/affiliate/join",
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([
'ref_code' => 'joao'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/affiliate/join"
payload := strings.NewReader("{\n \"ref_code\": \"joao\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/affiliate/join")
.header("x-store-domain", "<x-store-domain>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref_code\": \"joao\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/affiliate/join")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref_code\": \"joao\"\n}"
response = http.request(request)
puts response.read_body{
"status": "affiliate",
"id": 123,
"name": "<string>",
"email": "<string>",
"ref_code": "<string>",
"percent_commission": 123,
"balance": 123,
"min_withdraw": 123,
"withdraw_settings": {
"full_name": "<string>",
"pix_key": "<string>",
"pix_key_type": "CPF",
"cpf_cnpj": "<string>"
},
"stats": {
"total_sales": 123,
"total_amount": 123,
"d7_visits": 123
},
"links": [
{
"id": 123,
"name": "<string>",
"ref_code": "<string>",
"url": "<string>",
"sales": 123,
"revenue": 123,
"d7_visits": 123
}
]
}{
"errors": [
{
"message": "Sessão inválida ou expirada.",
"code": "CUSTOMER_UNAUTHENTICATED"
}
]
}{
"errors": [
{
"message": "O auto cadastro de afiliados está desativado nesta loja."
}
]
}{
"errors": [
{
"message": "Este código já está em uso. Escolha outro."
}
]
}{
"errors": [
{
"message": "O código precisa ter pelo menos 3 caracteres."
}
]
}Afiliados
Join Affiliate Program
Cadastra o cliente autenticado como afiliado da loja.
Devolve o mesmo objeto de
GET /webstore/affiliate/me, já com o afiliado criado, então não é preciso chamar o painel logo em seguida. Um cliente que já é afiliado recebe o painel dele sem erro. O ref_code é escolhido pelo cliente, precisa ter ao menos 3 caracteres e ser único na loja.POST
/
webstore
/
affiliate
/
join
Join Affiliate Program
curl --request POST \
--url https://api.centralcart.io/v1/webstore/affiliate/join \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-store-domain: <x-store-domain>' \
--data '
{
"ref_code": "joao"
}
'import requests
url = "https://api.centralcart.io/v1/webstore/affiliate/join"
payload = { "ref_code": "joao" }
headers = {
"x-store-domain": "<x-store-domain>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-store-domain': '<x-store-domain>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ref_code: 'joao'})
};
fetch('https://api.centralcart.io/v1/webstore/affiliate/join', 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.centralcart.io/v1/webstore/affiliate/join",
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([
'ref_code' => 'joao'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-store-domain: <x-store-domain>"
],
]);
$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.centralcart.io/v1/webstore/affiliate/join"
payload := strings.NewReader("{\n \"ref_code\": \"joao\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-store-domain", "<x-store-domain>")
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.centralcart.io/v1/webstore/affiliate/join")
.header("x-store-domain", "<x-store-domain>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref_code\": \"joao\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/affiliate/join")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref_code\": \"joao\"\n}"
response = http.request(request)
puts response.read_body{
"status": "affiliate",
"id": 123,
"name": "<string>",
"email": "<string>",
"ref_code": "<string>",
"percent_commission": 123,
"balance": 123,
"min_withdraw": 123,
"withdraw_settings": {
"full_name": "<string>",
"pix_key": "<string>",
"pix_key_type": "CPF",
"cpf_cnpj": "<string>"
},
"stats": {
"total_sales": 123,
"total_amount": 123,
"d7_visits": 123
},
"links": [
{
"id": 123,
"name": "<string>",
"ref_code": "<string>",
"url": "<string>",
"sales": 123,
"revenue": 123,
"d7_visits": 123
}
]
}{
"errors": [
{
"message": "Sessão inválida ou expirada.",
"code": "CUSTOMER_UNAUTHENTICATED"
}
]
}{
"errors": [
{
"message": "O auto cadastro de afiliados está desativado nesta loja."
}
]
}{
"errors": [
{
"message": "Este código já está em uso. Escolha outro."
}
]
}{
"errors": [
{
"message": "O código precisa ter pelo menos 3 caracteres."
}
]
}Autorizações
access_token do comprador, devolvido por POST /webstore/auth/verify.
Cabeçalhos
Domínio da sua loja (ex: sualoja.centralcart.ai)
Corpo
application/json
Código que vai aparecer no link de indicação, em ?ref=.
Resposta
Painel do afiliado recém-cadastrado
Opções disponíveis:
affiliate Código principal do afiliado, usado em ?ref=.
Percentual de comissão padrão deste afiliado.
Saldo disponível para saque.
Valor mínimo por saque. null usa o padrão da loja.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I