Solicitar Estorno de Carnê
curl --request POST \
--url https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"reason": "<string>"
}
'import requests
url = "https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests"
payload = {
"amount": 123,
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, reason: '<string>'})
};
fetch('https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests', 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/installment-plans/{uuid}/refund-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests"
payload := strings.NewReader("{\n \"amount\": 123,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyBoleto Parcelado (Carnê)
Solicitar Estorno de Carnê
Abre um pedido de estorno — a Garu não move esse dinheiro
POST
/
api
/
v1
/
installment-plans
/
{uuid}
/
refund-requests
Solicitar Estorno de Carnê
curl --request POST \
--url https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"reason": "<string>"
}
'import requests
url = "https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests"
payload = {
"amount": 123,
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, reason: '<string>'})
};
fetch('https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests', 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/installment-plans/{uuid}/refund-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests"
payload := strings.NewReader("{\n \"amount\": 123,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/installment-plans/{uuid}/refund-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyVisão Geral
A Garu não devolve esse dinheiro por você. Um boleto não tem estorno e o valor já foi liquidado para a sua conta — a devolução é uma transferência bancária que só você pode fazer. Esta chamada registra o pedido e avisa o seu time.
Exemplo
curl -X POST https://garu.com.br/api/v1/installment-plans/e5d0d8fe-0000-4000-8000-000000000001/refund-requests \
-H "Authorization: Bearer sk_live_sua_chave" \
-H "Content-Type: application/json" \
-d '{ "reason": "Produto não entregue" }'
const pedido = await garu.installmentPlans.requestRefund(uuid, {
reason: 'Produto não entregue'
});
console.log(pedido.status); // 'pending' — nada se moveu ainda
Parâmetros
number
Valor em BRL decimal. Padrão: tudo o que o carnê realmente arrecadou — que não é o mesmo que o total agendado.
string
Motivo do pedido.
Idempotência
EnvieX-Idempotency-Key para reenviar a chamada com segurança sem abrir um segundo pedido. A API já recusa um segundo pedido pendente para o mesmo carnê, então o header é uma proteção extra para a janela de rede entre o pedido ser aberto e a resposta chegar.
Próximo passo
Depois de devolver o dinheiro, feche o pedido com Confirmar Estorno.Was this page helpful?
⌘I