List Affiliate Links
curl --request GET \
--url https://api.centralcart.io/v1/webstore/affiliate/links \
--header 'Authorization: Bearer <token>' \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/affiliate/links"
headers = {
"x-store-domain": "<x-store-domain>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-store-domain': '<x-store-domain>', Authorization: 'Bearer <token>'}
};
fetch('https://api.centralcart.io/v1/webstore/affiliate/links', 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/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.centralcart.io/v1/webstore/affiliate/links"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-store-domain", "<x-store-domain>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.centralcart.io/v1/webstore/affiliate/links")
.header("x-store-domain", "<x-store-domain>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/affiliate/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": 7,
"name": "Link principal",
"ref_code": "joao",
"url": "https://minhaloja.centralcart.com/?ref=joao",
"sales": 12,
"revenue": 1896
}
]{
"errors": [
{
"message": "Sessão inválida ou expirada.",
"code": "CUSTOMER_UNAUTHENTICATED"
}
]
}{
"errors": [
{
"message": "Afiliado não encontrado"
}
]
}Afiliados
List Affiliate Links
Links de indicação do afiliado, com vendas e receita acumuladas por link.
Para as visitas por link, use
include_visits=true em GET /webstore/affiliate/me.GET
/
webstore
/
affiliate
/
links
List Affiliate Links
curl --request GET \
--url https://api.centralcart.io/v1/webstore/affiliate/links \
--header 'Authorization: Bearer <token>' \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/affiliate/links"
headers = {
"x-store-domain": "<x-store-domain>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-store-domain': '<x-store-domain>', Authorization: 'Bearer <token>'}
};
fetch('https://api.centralcart.io/v1/webstore/affiliate/links', 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/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.centralcart.io/v1/webstore/affiliate/links"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-store-domain", "<x-store-domain>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.centralcart.io/v1/webstore/affiliate/links")
.header("x-store-domain", "<x-store-domain>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/webstore/affiliate/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-store-domain"] = '<x-store-domain>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": 7,
"name": "Link principal",
"ref_code": "joao",
"url": "https://minhaloja.centralcart.com/?ref=joao",
"sales": 12,
"revenue": 1896
}
]{
"errors": [
{
"message": "Sessão inválida ou expirada.",
"code": "CUSTOMER_UNAUTHENTICATED"
}
]
}{
"errors": [
{
"message": "Afiliado não encontrado"
}
]
}Autorizações
access_token do comprador, devolvido por POST /webstore/auth/verify.
Cabeçalhos
Domínio da sua loja (ex: sualoja.centralcart.ai)
Resposta
Links do afiliado
Link pronto para compartilhar.
Vendas acumuladas por este link.
Receita acumulada por este link.
Visitas dos últimos 7 dias. Só vem preenchido em GET /webstore/affiliate/me com include_visits=true; nos demais casos é null.
⌘I