curl --request POST \
--url https://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{}'import requests
url = "https://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund"
payload = {}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.sandbox.rails.wayex.com/v1/transfers/{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.rails.wayex.com/v1/transfers/{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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.rails.wayex.com/v1/transfers/{id}/refund"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"counterpartyId": "<string>",
"customerId": "<string>",
"status": "created",
"sourceDepositInstructions": {
"kind": "crypto",
"address": "<string>",
"currency": "USDC",
"network": "ethereum",
"amount": "<string>"
},
"references": {
"payoutHoldReason": "<string>",
"quoteId": "<string>",
"providerQuoteId": "<string>",
"liquidationAddress": "<string>",
"vaultId": "<string>",
"disbursementVaultId": "<string>",
"depositReference": "<string>",
"depositTxHash": "<string>",
"depositSourceAddress": "<string>",
"payinReference": "<string>",
"tradeId": "<string>",
"sweepTxId": "<string>",
"sweepTxHash": "<string>",
"failedSweepTxIds": [
"<string>"
],
"onforwardTxId": "<string>",
"failedOnforwardTxIds": [
"<string>"
],
"onforwardToAddress": "<string>",
"onforwardTxHash": "<string>",
"onforwardDepositId": "<string>",
"fiatWithdrawalId": "<string>",
"rejectedFiatWithdrawals": [
"<string>"
],
"stablecoinWithdrawalId": "<string>",
"fxFundingPayoutId": "<string>",
"sendTxId": "<string>",
"sendTxHash": "<string>",
"failedSendTxIds": [
"<string>"
],
"payoutId": "<string>",
"ledgerEntryRefs": [
"<string>"
],
"lastCaseReason": "<string>",
"lastCaseAt": "<string>"
},
"timeline": [
{
"status": "created",
"at": "2023-11-07T05:31:56Z",
"providerRef": "<string>",
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "offramp",
"source": {
"currency": "USDC",
"network": "ethereum",
"amount": "<string>"
},
"destination": {
"account_holder_name": "<string>",
"bsb_code": "<string>",
"account_number": "<string>",
"bank_country": "<string>",
"currency": "AUD"
},
"destinationAmount": "<string>",
"destinationCurrency": "AUD",
"routeId": "<string>",
"quoteId": "<string>",
"metadata": {},
"developerFee": {
"amount": "<string>",
"currency": "AUD"
},
"exchangeRate": "<string>"
}Refund a waiting transfer
Returns the full AUD amount of an on-ramp transfer waiting at awaiting_client_action to the account that paid it. Nothing is converted.
curl --request POST \
--url https://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{}'import requests
url = "https://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund"
payload = {}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.sandbox.rails.wayex.com/v1/transfers/{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.rails.wayex.com/v1/transfers/{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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.rails.wayex.com/v1/transfers/{id}/refund"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.rails.wayex.com/v1/transfers/{id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"counterpartyId": "<string>",
"customerId": "<string>",
"status": "created",
"sourceDepositInstructions": {
"kind": "crypto",
"address": "<string>",
"currency": "USDC",
"network": "ethereum",
"amount": "<string>"
},
"references": {
"payoutHoldReason": "<string>",
"quoteId": "<string>",
"providerQuoteId": "<string>",
"liquidationAddress": "<string>",
"vaultId": "<string>",
"disbursementVaultId": "<string>",
"depositReference": "<string>",
"depositTxHash": "<string>",
"depositSourceAddress": "<string>",
"payinReference": "<string>",
"tradeId": "<string>",
"sweepTxId": "<string>",
"sweepTxHash": "<string>",
"failedSweepTxIds": [
"<string>"
],
"onforwardTxId": "<string>",
"failedOnforwardTxIds": [
"<string>"
],
"onforwardToAddress": "<string>",
"onforwardTxHash": "<string>",
"onforwardDepositId": "<string>",
"fiatWithdrawalId": "<string>",
"rejectedFiatWithdrawals": [
"<string>"
],
"stablecoinWithdrawalId": "<string>",
"fxFundingPayoutId": "<string>",
"sendTxId": "<string>",
"sendTxHash": "<string>",
"failedSendTxIds": [
"<string>"
],
"payoutId": "<string>",
"ledgerEntryRefs": [
"<string>"
],
"lastCaseReason": "<string>",
"lastCaseAt": "<string>"
},
"timeline": [
{
"status": "created",
"at": "2023-11-07T05:31:56Z",
"providerRef": "<string>",
"description": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "offramp",
"source": {
"currency": "USDC",
"network": "ethereum",
"amount": "<string>"
},
"destination": {
"account_holder_name": "<string>",
"bsb_code": "<string>",
"account_number": "<string>",
"bank_country": "<string>",
"currency": "AUD"
},
"destinationAmount": "<string>",
"destinationCurrency": "AUD",
"routeId": "<string>",
"quoteId": "<string>",
"metadata": {},
"developerFee": {
"amount": "<string>",
"currency": "AUD"
},
"exchangeRate": "<string>"
}What this endpoint does
Returns the full AUD amount of an on-ramp transfer waiting atawaiting_client_action to the account that paid it. Nothing is converted.
When to use it
Call it when you do not want to accept a payment that arrived on a route withclientGate enabled. Send an empty body.
Before you call
Use a secret API key with transfer write access and pass a transfer owned by this tenant account. A request made from a console session also needs a recent second-factor confirmation.Money and balance effect
Returns the full landed AUD to the payer; the Wayex transfer fee applies to the refunded amount and appears on your monthly invoice. Partial refunds are not supported.States and completion
The transfer moves torefunding, then returned, reversing, and reversed once the refund executes. A payment can only be refunded five minutes after it arrived, so refunding can take several minutes. If the refund cannot be completed, the transfer returns to awaiting_client_action with references.lastCaseReason set to refund_rejected; you can then progress it or request the refund again. 409 refund_not_available means the payment can no longer be refunded — progress it instead.
Safe retries
Send a uniqueIdempotency-Key. A repeat call after the refund was requested returns 200 with the current state and never sends a second refund. 409 client_gate_busy means another action on the transfer is in progress — retry shortly.
Read Activity and history for the complete workflow.Authorizations
Send the same Wayex API key as Authorization: Bearer <key>.
Headers
A unique key for this logical action. Reuse the same key and identical payload when retrying after an unknown response.
8 - 255Path Parameters
Body
The body is of type object.
Response
The transfer after the decision (usually refunding).
- Option 1
- Option 2
Unique identifier for this transfer.
1The client account (counterparty) this transfer belongs to. For API callers this is always your own account id.
1The customer this transfer is for.
1Current lifecycle status. State advances asynchronously, so treat this as the source of truth.
created, validated, screening, fx_executed, completed, awaiting_deposit, deposit_detected, deposit_confirming, deposit_cleared, sweeping, onforwarding, payout_instructed, payout_held, payout_settled, awaiting_payin, payin_cleared, disbursing, sending, send_confirming, pooled, awaiting_client_action, refunding, on_hold, frozen, failed, cancelled, returned, expired, reversing, reversed - Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Ordered history of the states this transfer passed through, with timestamps.
Show child attributes
Show child attributes
When the transfer was created (ISO 8601).
When the transfer was last updated (ISO 8601).
offramp Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Net AUD the customer receives as a decimal string; set once the conversion executes ("0" before).
^\d+(\.\d+)?$AUD The payment route whose funding spawned this transfer.
1Reference to the live price struck at funding; absent until the conversion executes.
1Show child attributes
Show child attributes
Your developer fee withheld from this conversion (AUD). Present once the conversion executes; omitted on a returned, reversing or reversed transfer.
Show child attributes
Show child attributes
Destination units per one source unit the conversion executed at, excluding your developer fee. Present once the conversion executes.
^\d+(\.\d+)?$
