Listar Cobranças
curl --request GET \
--url https://garu.com.br/api/v1/charges \
--header 'Authorization: <authorization>'import requests
url = "https://garu.com.br/api/v1/charges"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://garu.com.br/api/v1/charges', 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://garu.com.br/api/v1/charges",
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: <authorization>"
],
]);
$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://garu.com.br/api/v1/charges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://garu.com.br/api/v1/charges")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyCobranças
Listar Cobranças
Liste as cobranças da sua conta com filtros de status, método, produto, período e cliente
GET
/
api
/
v1
/
charges
Listar Cobranças
curl --request GET \
--url https://garu.com.br/api/v1/charges \
--header 'Authorization: <authorization>'import requests
url = "https://garu.com.br/api/v1/charges"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://garu.com.br/api/v1/charges', 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://garu.com.br/api/v1/charges",
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: <authorization>"
],
]);
$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://garu.com.br/api/v1/charges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://garu.com.br/api/v1/charges")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyVisão Geral
Lista as cobranças da conta autenticada, da mais recente para a mais antiga por padrão. Útil para telas de conciliação e relatórios dentro do seu sistema.A lista inclui todas as cobranças da conta, inclusive as de pedidos de produto físico — nessas, o campo
product vem null, porque o pedido pode conter mais de um produto.Headers
string
required
Sua chave de API (
Bearer sk_live_...)Query Parameters
integer
default:"1"
Página desejada
integer
default:"20"
Itens por página, máximo 100
string
Filtra pelo status amigável:
pending, authorized, paid, failed, expired, canceled, refund_pending, refunded, chargebackstring
Filtra por método:
pix, boleto ou creditCardstring
Filtra pelo UUID do produto
string
Cobranças criadas a partir desta data (ISO-8601)
string
Cobranças criadas até esta data (ISO-8601)
string
Busca por nome, e-mail ou documento do cliente
string
default:"-createdAt"
Ordenação:
createdAt, -createdAt, amount ou -amount. O prefixo - indica ordem decrescente.Exemplo de Requisição
curl -G https://garu.com.br/api/v1/charges \
-H "Authorization: Bearer sk_live_sua_chave_api" \
-d status=paid \
-d createdAfter=2026-07-01T00:00:00Z \
-d limit=50
const params = new URLSearchParams({
status: 'paid',
createdAfter: '2026-07-01T00:00:00Z',
limit: '50'
});
const response = await fetch(`https://garu.com.br/api/v1/charges?${params}`, {
headers: { Authorization: `Bearer ${process.env.GARU_API_KEY}` }
});
const { data, totalCount } = await response.json();
console.log(`${data.length} de ${totalCount} cobranças`);
import os
import requests
response = requests.get(
"https://garu.com.br/api/v1/charges",
headers={"Authorization": f"Bearer {os.environ['GARU_API_KEY']}"},
params={
"status": "paid",
"createdAfter": "2026-07-01T00:00:00Z",
"limit": 50,
},
)
body = response.json()
print(f"{len(body['data'])} de {body['totalCount']} cobranças")
Resposta de Sucesso (200 OK)
{
"data": [
{
"uuid": "6f1c9b2e-4a7d-4f0b-9a3e-1d2c3b4a5e6f",
"status": "paid",
"paymentMethod": "pix",
"amount": 349.00,
"chargedTotal": 349.00,
"installments": 1,
"product": {
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Curso de Marketing Digital"
},
"customer": {
"name": "Maria Silva",
"email": "maria@exemplo.com.br",
"document": "***456789**"
},
"pix": { "code": "00020101021226840014br.gov.bcb.pix..." },
"boleto": null,
"card": null,
"refund": null,
"createdAt": "2026-07-22T14:03:11.000Z",
"expiresAt": null
}
],
"count": 1,
"totalCount": 137,
"totalPages": 7
}
| Campo | Significado |
|---|---|
count | Itens nesta página |
totalCount | Total de cobranças que casam com os filtros |
totalPages | Número de páginas com o limit informado |
Erros
| Código | Quando acontece |
|---|---|
400 | paymentMethod, sort ou uma das datas em formato inválido |
401 | Chave de API ausente ou inválida |
Was this page helpful?