curl --request POST \
--url https://api.example.com/v1/public/deposits/{uuid}/refund \
--header 'Content-Type: application/json' \
--header 'X-Signature: <api-key>' \
--data '
{
"toAddress": "TXYZ…",
"toMemo": "<string>",
"amount": "95.5",
"reason": "client cancelled the order"
}
'import requests
url = "https://api.example.com/v1/public/deposits/{uuid}/refund"
payload = {
"toAddress": "TXYZ…",
"toMemo": "<string>",
"amount": "95.5",
"reason": "client cancelled the order"
}
headers = {
"X-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
toAddress: 'TXYZ…',
toMemo: '<string>',
amount: '95.5',
reason: 'client cancelled the order'
})
};
fetch('https://api.example.com/v1/public/deposits/{uuid}/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.example.com/v1/public/deposits/{uuid}/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([
'toAddress' => 'TXYZ…',
'toMemo' => '<string>',
'amount' => '95.5',
'reason' => 'client cancelled the order'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Signature: <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.example.com/v1/public/deposits/{uuid}/refund"
payload := strings.NewReader("{\n \"toAddress\": \"TXYZ…\",\n \"toMemo\": \"<string>\",\n \"amount\": \"95.5\",\n \"reason\": \"client cancelled the order\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Signature", "<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.example.com/v1/public/deposits/{uuid}/refund")
.header("X-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"toAddress\": \"TXYZ…\",\n \"toMemo\": \"<string>\",\n \"amount\": \"95.5\",\n \"reason\": \"client cancelled the order\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/public/deposits/{uuid}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"toAddress\": \"TXYZ…\",\n \"toMemo\": \"<string>\",\n \"amount\": \"95.5\",\n \"reason\": \"client cancelled the order\"\n}"
response = http.request(request)
puts response.read_body{
"payout": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderId": "payout_77",
"status": "queued",
"assetCode": "USDT_TRC20",
"destinationAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"destinationMemo": null,
"amount": "50.000000",
"requiresApproval": false,
"txHash": "a1b2c3...e9f0",
"confirmations": 12,
"requiredConfirmations": 19,
"networkStatus": "confirmed",
"explorerTxUrl": "https://tronscan.org/#/transaction/a1b2c3",
"failReason": "<string>",
"approvedAt": "2023-11-07T05:31:56Z",
"broadcastedAt": "2023-11-07T05:31:56Z",
"confirmedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"network": "TRON",
"isFinal": false,
"priority": "recommended",
"amountUsd": "50.00",
"rateUsd": "1.00",
"commission": "<string>",
"networkFee": "<string>"
},
"deposit": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderId": "ORD-1001",
"status": "refund_process"
}
}Refund deposit to sender (1.4.0)
Создаёт выплату-возврат (source=refund) на адрес отправителя входящей транзакции (или на toAddress). Депозит переходит в refund_process; по исходу выплаты — refund_paid (webhook deposit.refunded) или refund_fail (deposit.refund_failed). Разрешено из статусов paid / paid_over / wrong_amount / refund_fail. По настройке платформы выплата-возврат ждёт одобрения оператора (pending_approval). Повторный вызов при живой выплате-возврате → 409 REFUND_IN_PROGRESS. Требует scope deposit_and_payout.
curl --request POST \
--url https://api.example.com/v1/public/deposits/{uuid}/refund \
--header 'Content-Type: application/json' \
--header 'X-Signature: <api-key>' \
--data '
{
"toAddress": "TXYZ…",
"toMemo": "<string>",
"amount": "95.5",
"reason": "client cancelled the order"
}
'import requests
url = "https://api.example.com/v1/public/deposits/{uuid}/refund"
payload = {
"toAddress": "TXYZ…",
"toMemo": "<string>",
"amount": "95.5",
"reason": "client cancelled the order"
}
headers = {
"X-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
toAddress: 'TXYZ…',
toMemo: '<string>',
amount: '95.5',
reason: 'client cancelled the order'
})
};
fetch('https://api.example.com/v1/public/deposits/{uuid}/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.example.com/v1/public/deposits/{uuid}/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([
'toAddress' => 'TXYZ…',
'toMemo' => '<string>',
'amount' => '95.5',
'reason' => 'client cancelled the order'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Signature: <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.example.com/v1/public/deposits/{uuid}/refund"
payload := strings.NewReader("{\n \"toAddress\": \"TXYZ…\",\n \"toMemo\": \"<string>\",\n \"amount\": \"95.5\",\n \"reason\": \"client cancelled the order\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Signature", "<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.example.com/v1/public/deposits/{uuid}/refund")
.header("X-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"toAddress\": \"TXYZ…\",\n \"toMemo\": \"<string>\",\n \"amount\": \"95.5\",\n \"reason\": \"client cancelled the order\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/public/deposits/{uuid}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"toAddress\": \"TXYZ…\",\n \"toMemo\": \"<string>\",\n \"amount\": \"95.5\",\n \"reason\": \"client cancelled the order\"\n}"
response = http.request(request)
puts response.read_body{
"payout": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderId": "payout_77",
"status": "queued",
"assetCode": "USDT_TRC20",
"destinationAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"destinationMemo": null,
"amount": "50.000000",
"requiresApproval": false,
"txHash": "a1b2c3...e9f0",
"confirmations": 12,
"requiredConfirmations": 19,
"networkStatus": "confirmed",
"explorerTxUrl": "https://tronscan.org/#/transaction/a1b2c3",
"failReason": "<string>",
"approvedAt": "2023-11-07T05:31:56Z",
"broadcastedAt": "2023-11-07T05:31:56Z",
"confirmedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"network": "TRON",
"isFinal": false,
"priority": "recommended",
"amountUsd": "50.00",
"rateUsd": "1.00",
"commission": "<string>",
"networkFee": "<string>"
},
"deposit": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderId": "ORD-1001",
"status": "refund_process"
}
}Authorizations
HMAC-SHA256-Hex(timestamp + "." + raw_body, api_secret)
Path Parameters
Body
Адрес получателя возврата. По умолчанию — адрес отправителя входящей транзакции (transaction.fromAddress).
255"TXYZ…"
Memo/tag получателя (memo-based сети: TON, XRP, XLM…).
255Сумма возврата (string decimal). По умолчанию — вся полученная сумма. Не больше полученной; сетевая комиссия удерживается с hot-кошелька по правилам выплат.
"95.5"
Причина возврата (в аудит).
500"client cancelled the order"