Consultar Cobrança
curl --request GET \
--url https://garu.com.br/api/v1/charges/{uuid} \
--header 'Authorization: <authorization>'import requests
url = "https://garu.com.br/api/v1/charges/{uuid}"
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/{uuid}', 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/{uuid}",
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/{uuid}"
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/{uuid}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/charges/{uuid}")
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
Consultar Cobrança
Recupere uma cobrança pelo uuid, incluindo status e dados de pagamento
GET
/
api
/
v1
/
charges
/
{uuid}
Consultar Cobrança
curl --request GET \
--url https://garu.com.br/api/v1/charges/{uuid} \
--header 'Authorization: <authorization>'import requests
url = "https://garu.com.br/api/v1/charges/{uuid}"
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/{uuid}', 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/{uuid}",
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/{uuid}"
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/{uuid}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/charges/{uuid}")
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
Retorna uma cobrança da sua conta pelouuid. Use para acompanhar o status de um pagamento — especialmente num checkout transparente, enquanto o cliente ainda não pagou o PIX ou o boleto.
Para saber de um pagamento assim que ele acontece, prefira webhooks em vez de ficar consultando este endpoint em loop.
Headers
string
required
Sua chave de API (
Bearer sk_live_...)Path Parameters
string
required
UUID da cobrança, devolvido na criação
Exemplo de Requisição
curl https://garu.com.br/api/v1/charges/6f1c9b2e-4a7d-4f0b-9a3e-1d2c3b4a5e6f \
-H "Authorization: Bearer sk_live_sua_chave_api"
const response = await fetch(
`https://garu.com.br/api/v1/charges/${chargeUuid}`,
{ headers: { Authorization: `Bearer ${process.env.GARU_API_KEY}` } }
);
const charge = await response.json();
console.log(charge.status);
import os
import requests
response = requests.get(
f"https://garu.com.br/api/v1/charges/{charge_uuid}",
headers={"Authorization": f"Bearer {os.environ['GARU_API_KEY']}"},
)
print(response.json()["status"])
Resposta de Sucesso (200 OK)
{
"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
}
Bandeira e últimos 4 dígitos do cartão só vêm na resposta da criação. Numa consulta posterior o bloco
card volta com os campos nulos.Status possíveis
Ostatus é um valor estável e amigável — o mesmo para PIX, boleto e cartão. Você pode ramificar com segurança nele (if (charge.status === 'paid')); ele não muda se trocarmos de adquirente por trás.
| Status | Descrição | Pago? |
|---|---|---|
pending | Aguardando o pagamento do cliente (PIX ou boleto em aberto) | Não |
authorized | Cartão autorizado, valor ainda não capturado | Não |
paid | Pagamento confirmado — pode liberar o produto | Sim |
failed | Pagamento negado ou indisponível | Não |
expired | Boleto venceu sem pagamento | Não |
canceled | Cobrança cancelada antes do pagamento | Não |
refund_pending | Estorno de PIX solicitado, aguardando a devolução liquidar | Não |
refunded | Valor devolvido ao cliente | Não |
chargeback | Estorno forçado (contestação junto à bandeira) | Não |
Aja em
paid. É o único status que garante que o dinheiro entrou. authorized (cartão) ainda não é captura, e refund_pending significa que a devolução foi pedida mas ainda não caiu na conta do cliente.Erros
| Código | Quando acontece |
|---|---|
401 | Chave de API ausente ou inválida |
404 | A cobrança não existe ou não pertence à conta da chave usada |
Was this page helpful?
⌘I