cURL
curl --request POST \
--url https://sandbox-api.superpagamentos.com/payments/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactionId": "<string>"
}
'import requests
url = "https://sandbox-api.superpagamentos.com/payments/refund"
payload = { "transactionId": "<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({transactionId: '<string>'})
};
fetch('https://sandbox-api.superpagamentos.com/payments/refund', 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://sandbox-api.superpagamentos.com/payments/refund",
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([
'transactionId' => '<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://sandbox-api.superpagamentos.com/payments/refund"
payload := strings.NewReader("{\n \"transactionId\": \"<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://sandbox-api.superpagamentos.com/payments/refund")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.superpagamentos.com/payments/refund")
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 \"transactionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "0b64746e-d77b-4ff4-8b9d-272b7e5cbbb3",
"status": "REFUNDED",
"paymentMethod": "card",
"currency": "BRL",
"amount": 10000,
"postbackUrl": "",
"installments": 10,
"buyerDetails": {
"firstName": "Cliente",
"lastName": "Teste",
"email": "clienteteste@superpagamentos.com",
"document": "21671880056",
"phone": null,
"street": "Rua B",
"streetNumber": 200,
"neighborhood": "Jardins",
"complement": "Casa 10",
"reference": "Ao lado da padaria",
"city": "São Paulo",
"state": "SP"
},
"cardDetails": {
"brand": "Visa",
"first4Digits": "4716",
"last4Digits": "2104",
"expirationMonth": "10",
"expirationYear": "2031"
},
"splits": [],
"createdAt": "2025-06-09T20:59:45.597Z",
"updatedAt": "2025-06-09T20:59:45.597Z"
},
"message": "Reembolso realizado com sucesso"
}Transações
Estornar transação
Realiza o estorno de uma transação. É importante notar que:
- Apenas transações realizadas com cartão de crédito podem ser estornadas
- É necessário possuir saldo disponível para realizar o estorno
- O estorno não é possível se a transação já foi recebida em D+30, antecipada ou se alguma parcela foi paga (em caso de parcelamentos) e não possuir saldo disponível na conta!
POST
/
payments
/
refund
cURL
curl --request POST \
--url https://sandbox-api.superpagamentos.com/payments/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactionId": "<string>"
}
'import requests
url = "https://sandbox-api.superpagamentos.com/payments/refund"
payload = { "transactionId": "<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({transactionId: '<string>'})
};
fetch('https://sandbox-api.superpagamentos.com/payments/refund', 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://sandbox-api.superpagamentos.com/payments/refund",
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([
'transactionId' => '<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://sandbox-api.superpagamentos.com/payments/refund"
payload := strings.NewReader("{\n \"transactionId\": \"<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://sandbox-api.superpagamentos.com/payments/refund")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.superpagamentos.com/payments/refund")
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 \"transactionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "0b64746e-d77b-4ff4-8b9d-272b7e5cbbb3",
"status": "REFUNDED",
"paymentMethod": "card",
"currency": "BRL",
"amount": 10000,
"postbackUrl": "",
"installments": 10,
"buyerDetails": {
"firstName": "Cliente",
"lastName": "Teste",
"email": "clienteteste@superpagamentos.com",
"document": "21671880056",
"phone": null,
"street": "Rua B",
"streetNumber": 200,
"neighborhood": "Jardins",
"complement": "Casa 10",
"reference": "Ao lado da padaria",
"city": "São Paulo",
"state": "SP"
},
"cardDetails": {
"brand": "Visa",
"first4Digits": "4716",
"last4Digits": "2104",
"expirationMonth": "10",
"expirationYear": "2031"
},
"splits": [],
"createdAt": "2025-06-09T20:59:45.597Z",
"updatedAt": "2025-06-09T20:59:45.597Z"
},
"message": "Reembolso realizado com sucesso"
}Authorizations
Token JWT gerado na rota de autenticação (/auth). Deve ser enviado no formato: Bearer
Path Parameters
ID da transação que será reembolsada
Body
application/json
Dados necessários para realizar o reembolso
ID da transação que será reembolsada
⌘I