List Affiliate Transactions
curl --request GET \
--url https://api.centralcart.io/v1/webstore/affiliate/transactions \
--header 'Authorization: Bearer <token>' \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/affiliate/transactions"
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/transactions', 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/transactions",
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/transactions"
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/transactions")
.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/transactions")
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{
"meta": {
"total": 2,
"per_page": 15,
"current_page": 1,
"last_page": 1
},
"data": [
{
"id": 501,
"operation": "COMMISSION",
"amount": 15.8,
"message": null,
"order_id": 90210,
"order_packages": [
{
"package_id": 1,
"name": "VIP Inicial",
"quantity": 1
}
],
"created_at": "2024-03-03T23:43:12.000-03:00"
},
{
"id": 498,
"operation": "WITHDRAW_PENDING",
"amount": 50,
"message": null,
"order_id": null,
"withdraw_info": {
"full_name": "João da Silva",
"pix_key": "[email protected]",
"pix_key_type": "EMAIL",
"cpf_cnpj": "12345678900"
},
"created_at": "2024-03-01T10:12:00.000-03:00"
}
]
}{
"errors": [
{
"message": "Sessão inválida ou expirada.",
"code": "CUSTOMER_UNAUTHENTICATED"
}
]
}{
"errors": [
{
"message": "Afiliado não encontrado"
}
]
}Afiliados
List Affiliate Transactions
Extrato do afiliado, da movimentação mais recente para a mais antiga.
Cada linha é uma comissão ou um saque. Nas comissões,
order_packages traz os produtos do pedido que gerou o crédito. Nos saques, withdraw_info guarda os dados de PIX usados no pedido de retirada.GET
/
webstore
/
affiliate
/
transactions
List Affiliate Transactions
curl --request GET \
--url https://api.centralcart.io/v1/webstore/affiliate/transactions \
--header 'Authorization: Bearer <token>' \
--header 'x-store-domain: <x-store-domain>'import requests
url = "https://api.centralcart.io/v1/webstore/affiliate/transactions"
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/transactions', 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/transactions",
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/transactions"
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/transactions")
.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/transactions")
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{
"meta": {
"total": 2,
"per_page": 15,
"current_page": 1,
"last_page": 1
},
"data": [
{
"id": 501,
"operation": "COMMISSION",
"amount": 15.8,
"message": null,
"order_id": 90210,
"order_packages": [
{
"package_id": 1,
"name": "VIP Inicial",
"quantity": 1
}
],
"created_at": "2024-03-03T23:43:12.000-03:00"
},
{
"id": 498,
"operation": "WITHDRAW_PENDING",
"amount": 50,
"message": null,
"order_id": null,
"withdraw_info": {
"full_name": "João da Silva",
"pix_key": "[email protected]",
"pix_key_type": "EMAIL",
"cpf_cnpj": "12345678900"
},
"created_at": "2024-03-01T10:12:00.000-03:00"
}
]
}{
"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)
Parâmetros de consulta
Página (padrão: 1). São 15 por página.
⌘I