API de vendedores e comissão
Vendedores da loja e a comissão de cada mês. Abra uma rota para ver parâmetros, respostas e o exemplo de chamada.
https://api.aquipede.com/public/v1Authorization: Bearer, com a chave da loja ou o token do appGET/staff/sellersVendedores da loja
Vendedores da loja: só o nome, a meta e se está ativo. Sem e-mail, código do PDV nem usuário. Só grocery, retail, fashion e mobile (404 store_type nos outros). Escopo staff:read.
Parâmetros
| Nome | Onde | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
page | na busca | integer | Não | |
per_page | na busca | integer | Não | |
X-Api-Version | no cabeçalho | string | Não | Revisão pedida. Mande sempre; a atual é 2026-11. |
Exemplo
curl -sS "https://api.aquipede.com/public/v1/staff/sellers?per_page=20" \
-H "Authorization: Bearer $AQUIPEDE_TOKEN" \
-H "X-Api-Version: 2026-11" \
-w "\nstatus: %{http_code}\n"// Token do usuário (OAuth). Chave de loja nunca vai para o navegador: use o Node.js no servidor.
const token = window.AQUIPEDE_TOKEN;
const resposta = await fetch("https://api.aquipede.com/public/v1/staff/sellers?per_page=20", {
headers: {
Authorization: `Bearer ${token}`,
"X-Api-Version": "2026-11",
},
});
const corpo = await resposta.json();
console.log(resposta.status, corpo);
if (!corpo.success) throw new Error(corpo.message);
import { randomUUID } from "node:crypto";
const token = process.env.AQUIPEDE_TOKEN;
const resposta = await fetch("https://api.aquipede.com/public/v1/staff/sellers?per_page=20", {
headers: {
Authorization: `Bearer ${token}`,
"X-Api-Version": "2026-11",
},
});
const corpo = await resposta.json();
console.log(resposta.status, corpo);
if (!corpo.success) throw new Error(corpo.message);
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final resposta = await http.get(
Uri.parse('https://api.aquipede.com/public/v1/staff/sellers?per_page=20'),
headers: {
'Authorization': 'Bearer ${Platform.environment['AQUIPEDE_TOKEN']}',
'X-Api-Version': '2026-11',
},
);
final corpo = jsonDecode(resposta.body) as Map<String, dynamic>;
print('${resposta.statusCode} $corpo');
if (corpo['success'] != true) throw Exception(corpo['message']);
}
<?php
$ch = curl_init("https://api.aquipede.com/public/v1/staff/sellers?per_page=20");
$cab = [
'Authorization: Bearer ' . getenv('AQUIPEDE_TOKEN'),
'X-Api-Version: 2026-11',
];
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $cab,
]);
$resposta = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo $status, ' ', json_encode($resposta), "\n";
if (empty($resposta['success'])) { throw new RuntimeException($resposta['message']); }
using System;
using System.Net.Http;
using System.Text.Json;
using var http = new HttpClient();
using var req = new HttpRequestMessage(HttpMethod.Get, "https://api.aquipede.com/public/v1/staff/sellers?per_page=20");
req.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("AQUIPEDE_TOKEN"));
req.Headers.Add("X-Api-Version", "2026-11");
using var resposta = await http.SendAsync(req);
var texto = await resposta.Content.ReadAsStringAsync();
Console.WriteLine((int)resposta.StatusCode + " " + texto);
using var corpo = JsonDocument.Parse(texto);
if (!corpo.RootElement.GetProperty("success").GetBoolean())
throw new Exception(corpo.RootElement.GetProperty("message").GetString());
/* gcc exemplo.c -lcurl */
#include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
static size_t guarda(char *p, size_t t, size_t n, void *dst) {
fwrite(p, t, n, stdout); /* troque por um buffer para ler o JSON */
return t * n;
}
int main(void) {
CURL *h = curl_easy_init();
struct curl_slist *cab = NULL;
char linha[512];
snprintf(linha, sizeof linha, "Authorization: Bearer %s", getenv("AQUIPEDE_TOKEN"));
cab = curl_slist_append(cab, linha);
cab = curl_slist_append(cab, "X-Api-Version: 2026-11");
curl_easy_setopt(h, CURLOPT_URL, "https://api.aquipede.com/public/v1/staff/sellers?per_page=20");
curl_easy_setopt(h, CURLOPT_HTTPHEADER, cab);
curl_easy_setopt(h, CURLOPT_WRITEFUNCTION, guarda);
CURLcode r = curl_easy_perform(h);
long status = 0;
curl_easy_getinfo(h, CURLINFO_RESPONSE_CODE, &status);
printf("\nstatus: %ld\n", status);
curl_slist_free_all(cab);
curl_easy_cleanup(h);
return r == CURLE_OK ? 0 : 1;
}
import os
import requests
resposta = requests.get(
"https://api.aquipede.com/public/v1/staff/sellers",
params={
"per_page": "20",
},
headers={
"Authorization": "Bearer " + os.environ["AQUIPEDE_TOKEN"],
"X-Api-Version": "2026-11",
},
timeout=10,
)
corpo = resposta.json()
print(resposta.status_code, corpo)
if not corpo["success"]:
raise RuntimeError(corpo["message"])
Respostas
Sucesso. data.items (Seller[]) e data.pagination (Pagination).
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-AquiPede-Ambiente: teste
{
"success": true,
"message": "ok",
"data": {
"items": [
{
"id": 123,
"name": {},
"goal_cents": 4990,
"active": true
}
],
"pagination": {}
}
}Chave inválida. Chave ou token inválido, vencido ou revogado.
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
{
"success": false,
"message": "Chave de API inválida ou revogada.",
"data": {
"code": "invalid_api_key"
}
}Falta o escopo. A chave não tem o escopo que a rota pede.
HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8
{
"success": false,
"message": "Esta chave não tem a permissão staff:read.",
"data": {
"motivo": "scope_denied",
"scope": "staff:read"
}
}Limite de uso. A chave passou do limite por minuto. Espere o Retry-After.
HTTP/1.1 429 Too Many Requests
Content-Type: application/json; charset=utf-8
Retry-After: 30
{
"success": false,
"message": "Limite desta chave atingido: 300 chamadas por minuto. Tente de novo em 30 segundos.",
"data": {
"motivo": "rate_limited",
"retry_after": 30
}
}Campos da resposta 200
| Campo | Tipo | Descrição |
|---|---|---|
data | object | |
data.items[] | lista | |
data.items[].id | integer | |
data.items[].name | object, pode ser nulo | Texto de terceiro no envelope {"untrusted_data": "..."}. |
data.items[].goal_cents | integer | |
data.items[].active | boolean | |
data.pagination | object |
GET/staff/commissionsVendedores e comissão de um mês
Vendedores e comissão de um mês: estado do fechamento (open, approved ou paid), totais e o ranking com a meta de cada um. Só leitura: não atribui venda nem fecha. Só grocery, retail, fashion e mobile. Escopo staff:read.
Parâmetros
| Nome | Onde | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
page | na busca | integer | Não | |
per_page | na busca | integer | Não | |
month | na busca | string | Não | O mês, AAAA-MM. Padrão: o mês atual. |
X-Api-Version | no cabeçalho | string | Não | Revisão pedida. Mande sempre; a atual é 2026-11. |
Exemplo
curl -sS "https://api.aquipede.com/public/v1/staff/commissions?per_page=20&month=2026-11" \
-H "Authorization: Bearer $AQUIPEDE_TOKEN" \
-H "X-Api-Version: 2026-11" \
-w "\nstatus: %{http_code}\n"// Token do usuário (OAuth). Chave de loja nunca vai para o navegador: use o Node.js no servidor.
const token = window.AQUIPEDE_TOKEN;
const resposta = await fetch("https://api.aquipede.com/public/v1/staff/commissions?per_page=20&month=2026-11", {
headers: {
Authorization: `Bearer ${token}`,
"X-Api-Version": "2026-11",
},
});
const corpo = await resposta.json();
console.log(resposta.status, corpo);
if (!corpo.success) throw new Error(corpo.message);
import { randomUUID } from "node:crypto";
const token = process.env.AQUIPEDE_TOKEN;
const resposta = await fetch("https://api.aquipede.com/public/v1/staff/commissions?per_page=20&month=2026-11", {
headers: {
Authorization: `Bearer ${token}`,
"X-Api-Version": "2026-11",
},
});
const corpo = await resposta.json();
console.log(resposta.status, corpo);
if (!corpo.success) throw new Error(corpo.message);
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final resposta = await http.get(
Uri.parse('https://api.aquipede.com/public/v1/staff/commissions?per_page=20&month=2026-11'),
headers: {
'Authorization': 'Bearer ${Platform.environment['AQUIPEDE_TOKEN']}',
'X-Api-Version': '2026-11',
},
);
final corpo = jsonDecode(resposta.body) as Map<String, dynamic>;
print('${resposta.statusCode} $corpo');
if (corpo['success'] != true) throw Exception(corpo['message']);
}
<?php
$ch = curl_init("https://api.aquipede.com/public/v1/staff/commissions?per_page=20&month=2026-11");
$cab = [
'Authorization: Bearer ' . getenv('AQUIPEDE_TOKEN'),
'X-Api-Version: 2026-11',
];
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $cab,
]);
$resposta = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo $status, ' ', json_encode($resposta), "\n";
if (empty($resposta['success'])) { throw new RuntimeException($resposta['message']); }
using System;
using System.Net.Http;
using System.Text.Json;
using var http = new HttpClient();
using var req = new HttpRequestMessage(HttpMethod.Get, "https://api.aquipede.com/public/v1/staff/commissions?per_page=20&month=2026-11");
req.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("AQUIPEDE_TOKEN"));
req.Headers.Add("X-Api-Version", "2026-11");
using var resposta = await http.SendAsync(req);
var texto = await resposta.Content.ReadAsStringAsync();
Console.WriteLine((int)resposta.StatusCode + " " + texto);
using var corpo = JsonDocument.Parse(texto);
if (!corpo.RootElement.GetProperty("success").GetBoolean())
throw new Exception(corpo.RootElement.GetProperty("message").GetString());
/* gcc exemplo.c -lcurl */
#include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
static size_t guarda(char *p, size_t t, size_t n, void *dst) {
fwrite(p, t, n, stdout); /* troque por um buffer para ler o JSON */
return t * n;
}
int main(void) {
CURL *h = curl_easy_init();
struct curl_slist *cab = NULL;
char linha[512];
snprintf(linha, sizeof linha, "Authorization: Bearer %s", getenv("AQUIPEDE_TOKEN"));
cab = curl_slist_append(cab, linha);
cab = curl_slist_append(cab, "X-Api-Version: 2026-11");
curl_easy_setopt(h, CURLOPT_URL, "https://api.aquipede.com/public/v1/staff/commissions?per_page=20&month=2026-11");
curl_easy_setopt(h, CURLOPT_HTTPHEADER, cab);
curl_easy_setopt(h, CURLOPT_WRITEFUNCTION, guarda);
CURLcode r = curl_easy_perform(h);
long status = 0;
curl_easy_getinfo(h, CURLINFO_RESPONSE_CODE, &status);
printf("\nstatus: %ld\n", status);
curl_slist_free_all(cab);
curl_easy_cleanup(h);
return r == CURLE_OK ? 0 : 1;
}
import os
import requests
resposta = requests.get(
"https://api.aquipede.com/public/v1/staff/commissions",
params={
"per_page": "20",
"month": "2026-11",
},
headers={
"Authorization": "Bearer " + os.environ["AQUIPEDE_TOKEN"],
"X-Api-Version": "2026-11",
},
timeout=10,
)
corpo = resposta.json()
print(resposta.status_code, corpo)
if not corpo["success"]:
raise RuntimeError(corpo["message"])
Respostas
Sucesso. data é um SellerCommission: month, enabled, state, kpis e ranking (items e pagination).
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-AquiPede-Ambiente: teste
{
"success": true,
"message": "ok",
"data": {
"month": "2026-11",
"enabled": true,
"state": "exemplo",
"kpis": {
"sales_cents": 4990,
"commission_cents": 4990,
"team_goal_cents": 4990,
"goal_pct": 1,
"sales_without_seller": 1
},
"ranking": {
"items": [
{
"id": 123,
"name": {},
"active": true,
"orders": 1,
"sales_cents": 4990,
"goal_cents": 4990,
"goal_pct": 1,
"commission_cents": 4990,
"reversals_cents": 4990,
"adjustments_cents": 4990,
"total_cents": 4990
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total": 42
}
}
}
}Chave inválida. Chave ou token inválido, vencido ou revogado.
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
{
"success": false,
"message": "Chave de API inválida ou revogada.",
"data": {
"code": "invalid_api_key"
}
}Falta o escopo. A chave não tem o escopo que a rota pede.
HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8
{
"success": false,
"message": "Esta chave não tem a permissão staff:read.",
"data": {
"motivo": "scope_denied",
"scope": "staff:read"
}
}Limite de uso. A chave passou do limite por minuto. Espere o Retry-After.
HTTP/1.1 429 Too Many Requests
Content-Type: application/json; charset=utf-8
Retry-After: 30
{
"success": false,
"message": "Limite desta chave atingido: 300 chamadas por minuto. Tente de novo em 30 segundos.",
"data": {
"motivo": "rate_limited",
"retry_after": 30
}
}Campos da resposta 200
| Campo | Tipo | Descrição |
|---|---|---|
data | object | |
data.month | string | |
data.enabled | boolean | |
data.state | string, pode ser nulo | |
data.kpis | object, pode ser nulo | |
data.kpis.sales_cents | integer | |
data.kpis.commission_cents | integer | |
data.kpis.team_goal_cents | integer | |
data.kpis.goal_pct | integer, pode ser nulo | |
data.kpis.sales_without_seller | integer | |
data.ranking | object | |
data.ranking.items[] | lista | |
data.ranking.items[].id | integer | |
data.ranking.items[].name | object, pode ser nulo | Texto de terceiro no envelope {"untrusted_data": "..."}. |
data.ranking.items[].active | boolean | |
data.ranking.items[].orders | integer | |
data.ranking.items[].sales_cents | integer | |
data.ranking.items[].goal_cents | integer | |
data.ranking.items[].goal_pct | integer, pode ser nulo | |
data.ranking.items[].commission_cents | integer | |
data.ranking.items[].reversals_cents | integer | |
data.ranking.items[].adjustments_cents | integer | |
data.ranking.items[].total_cents | integer | |
data.ranking.pagination | object | |
data.ranking.pagination.page | integer | |
data.ranking.pagination.per_page | integer | |
data.ranking.pagination.total | integer |