Refund Payment
curl --request POST \
--url https://api-sandbox.y.uno/v1/payments/<payment_id>/transactions/<transaction_id>/refund \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'public-api-key: YOUR_PUBLIC_API_KEY' \
--header 'private-secret-key: YOUR_PRIVATE_SECRET_KEY' \
--data '{
"merchant_reference": "refund-20260419-001",
"reason": "REQUESTED_BY_CUSTOMER",
"description": "Customer returned the product",
"amount": { "currency": "BRL", "value": 50.00 }
}'import requests
url = "https://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund"
payload = {
"description": "Duplicate",
"reason": "REQUESTED_BY_CUSTOMER",
"merchant_reference": "AAB01-432245"
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Duplicate',
reason: 'REQUESTED_BY_CUSTOMER',
merchant_reference: 'AAB01-432245'
})
};
fetch('https://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/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://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/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([
'description' => 'Duplicate',
'reason' => 'REQUESTED_BY_CUSTOMER',
'merchant_reference' => 'AAB01-432245'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund"
payload := strings.NewReader("{\n \"description\": \"Duplicate\",\n \"reason\": \"REQUESTED_BY_CUSTOMER\",\n \"merchant_reference\": \"AAB01-432245\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Duplicate\",\n \"reason\": \"REQUESTED_BY_CUSTOMER\",\n \"merchant_reference\": \"AAB01-432245\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Duplicate\",\n \"reason\": \"REQUESTED_BY_CUSTOMER\",\n \"merchant_reference\": \"AAB01-432245\"\n}"
response = http.request(request)
puts response.read_bodyamount to refund the full captured amount. Include amount to issue a partial refund. You can issue multiple partials up to the captured total. For marketplace splits, use split_marketplace to reverse only specific recipients.
OPERATION_IN_PROCESS.X-Idempotency-Key is required. Use a unique UUID per logical refund. Yuno replays the original response on retries with the same key for 24 hours. See Idempotency for the full behavior.Authorizations
Your public API key from the Yuno Dashboard
Your private secret key (server-side only)
Path Parameters
The unique identifier of the payment (UUID, 36 chars).
The unique identifier of the transaction (UUID, 36 chars).
Body
Identification of the payment transaction defined by the merchant (MAX 255; MIN 3).
Description of the refund. (MAX 255; MIN 3).
Indicating the reason for the refund. If set, possible values are DUPLICATE, FRAUDULENT, REQUESTED_BY_CUSTOMER, and REVERSE. Use REVERSE to request an automatic reverse of the recipient funds when a recipient is involved in the transaction.
DUPLICATE, FRAUDULENT, REQUESTED_BY_CUSTOMER, REVERSE Specifies the amount object for refund. Only required for partial refunds.
Show child attributes
Show child attributes
Split marketplace array of objects
Show child attributes
Show child attributes
Determines whether Yuno should automatically attempt to refund a payment after an initial error or decline. When set to true, Yuno will retry the process if the first attempt fails. By default, this is set to false. Access Transaction Retries for more details.
Specifies additional data for required the transaction response
Show child attributes
Show child attributes
Specifies customer object for payments.
Show child attributes
Show child attributes
Specifies payment method object for payments.
Show child attributes
Show child attributes
Response
200
- Full Refund
- Partial Refund
"f2d6884a-f737-4565-ae32-ff60b19089e3"
""
"Duplicate"
"US"
"REFUNDED"
"REFUNDED"
"AAB01-432245"
"2025-04-14T17:51:45.179645Z"
"2025-04-14T17:52:07.908698Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
""
false
curl --request POST \
--url https://api-sandbox.y.uno/v1/payments/<payment_id>/transactions/<transaction_id>/refund \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'public-api-key: YOUR_PUBLIC_API_KEY' \
--header 'private-secret-key: YOUR_PRIVATE_SECRET_KEY' \
--data '{
"merchant_reference": "refund-20260419-001",
"reason": "REQUESTED_BY_CUSTOMER",
"description": "Customer returned the product",
"amount": { "currency": "BRL", "value": 50.00 }
}'import requests
url = "https://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund"
payload = {
"description": "Duplicate",
"reason": "REQUESTED_BY_CUSTOMER",
"merchant_reference": "AAB01-432245"
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Duplicate',
reason: 'REQUESTED_BY_CUSTOMER',
merchant_reference: 'AAB01-432245'
})
};
fetch('https://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/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://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/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([
'description' => 'Duplicate',
'reason' => 'REQUESTED_BY_CUSTOMER',
'merchant_reference' => 'AAB01-432245'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund"
payload := strings.NewReader("{\n \"description\": \"Duplicate\",\n \"reason\": \"REQUESTED_BY_CUSTOMER\",\n \"merchant_reference\": \"AAB01-432245\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Duplicate\",\n \"reason\": \"REQUESTED_BY_CUSTOMER\",\n \"merchant_reference\": \"AAB01-432245\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Duplicate\",\n \"reason\": \"REQUESTED_BY_CUSTOMER\",\n \"merchant_reference\": \"AAB01-432245\"\n}"
response = http.request(request)
puts response.read_body