Listar a trilha de auditoria da loja
curl --request GET \
--url https://v4pay-api.vercel.app/audit \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/audit"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/audit', 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://v4pay-api.vercel.app/audit",
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>"
],
]);
$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://v4pay-api.vercel.app/audit"
req, _ := http.NewRequest("GET", url, nil)
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://v4pay-api.vercel.app/audit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/audit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_email": "maria@empresa.com.br",
"action": "create",
"resource": "product",
"resource_id": "<string>",
"target": "Produto Premium",
"origin": "painel",
"ip": "187.11.42.10",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "Token JWT ou chave de API ausente"
}Auditoria
Listar a trilha de auditoria da loja
Retorna as ações de escrita feitas na loja (painel e API), das mais recentes para as mais antigas. Todas as ações de criação, edição, exclusão, cancelamento, reembolso, login e cadastro são registradas automaticamente, com quem fez, a origem e o IP.
GET
/
audit
Listar a trilha de auditoria da loja
curl --request GET \
--url https://v4pay-api.vercel.app/audit \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/audit"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/audit', 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://v4pay-api.vercel.app/audit",
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>"
],
]);
$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://v4pay-api.vercel.app/audit"
req, _ := http.NewRequest("GET", url, nil)
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://v4pay-api.vercel.app/audit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/audit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_email": "maria@empresa.com.br",
"action": "create",
"resource": "product",
"resource_id": "<string>",
"target": "Produto Premium",
"origin": "painel",
"ip": "187.11.42.10",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "Token JWT ou chave de API ausente"
}Authorizations
Token JWT obtido em /auth/login, enviado no cabeçalho Authorization no formato Bearer <token>.
Query Parameters
Filtra por tipo de ação.
Available options:
create, update, delete, cancel, refund, charge, test, login, register Filtra por recurso afetado.
Available options:
charge, customer, coupon, product, subscription, payment_link, withdrawal, api_key, webhook_endpoint, member, itau_webhook, profile, auth Filtra pela origem da ação.
Available options:
painel, api Filtra pelo id do usuário que fez a ação.
Máximo de registros retornados.
Required range:
x <= 500Response
Registros de auditoria.
Show child attributes
Show child attributes