curl --request POST \
--url https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refundAddress": "0x2f318C334780961FB129D2a6c30D0763d9a5C970"
}
'import requests
url = "https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/"
payload = { "refundAddress": "0x2f318C334780961FB129D2a6c30D0763d9a5C970" }
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({refundAddress: '0x2f318C334780961FB129D2a6c30D0763d9a5C970'})
};
fetch('https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/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://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/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([
'refundAddress' => '0x2f318C334780961FB129D2a6c30D0763d9a5C970'
]),
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://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/"
payload := strings.NewReader("{\n \"refundAddress\": \"0x2f318C334780961FB129D2a6c30D0763d9a5C970\"\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://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refundAddress\": \"0x2f318C334780961FB129D2a6c30D0763d9a5C970\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/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 \"refundAddress\": \"0x2f318C334780961FB129D2a6c30D0763d9a5C970\"\n}"
response = http.request(request)
puts response.read_body{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": 20074,
"type": "CryptoRefundAddressNotAllowedException",
"detail": {
"message": "A refund address is not allowed for this account: crypto refunds are sent to the on-chain origin address."
},
"status": 400
}{
"code": 40001,
"type": "NotAuthenticated",
"detail": {
"message": "Authentication credentials were not provided.",
"code": "not_authenticated"
},
"status": 401
}{
"code": 20072,
"type": "CryptoRefundNotEnabledException",
"detail": {
"message": "Crypto refunds are not enabled for this account."
},
"status": 403
}{
"code": 40004,
"type": "NotFound",
"detail": {
"message": "Not found.",
"code": "not_found"
},
"status": 404
}{
"code": 20077,
"type": "CryptoRefundDepositPendingMatchException",
"detail": {
"message": "Crypto refund not allowed for deposit 3c9f6a15-52ec-4d8b-9a71-8f0c4d2e6b19: it may still match an order"
},
"status": 409
}Refund a Crypto Deposit
Requests the return of a crypto deposit that arrived at one of your customers’ deposit addresses and matched no off-ramp order — the ones listed by GET /customers/{customerId}/refundableCryptoDeposits/.
Whether the request must name a destination is given by refundDestinationRequired on the listed deposit: true means refundAddress is required — unlike the order-rooted endpoint there is no order that could already carry one — and false means the crypto returns to the on-chain origin address and refundAddress is rejected with 20074.
The request only registers the refund: Ripio reviews it before anything is sent on-chain, so 202 means “queued for review”, not “sent”. It is idempotent: 202 when the refund is registered, 200 when one already owns the deposit.
The response names the refund, not an order: keep the refundId and follow it through latestRefund on the deposit. Registering, approving and rejecting are all silent; only a completed refund emits an event, OFF-RAMP.DEPOSIT.REFUNDED (see Off-Ramp Events). Its payload carries the hash of the crypto that came in — read refundedTxnHash on the deposit for the hash of what went back.
Deposits whose order was cancelled are refunded through the order instead, with POST /customers/{customerId}/transactions/offramp/{orderId}/refund/.
See Refunds for the full model.
curl --request POST \
--url https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refundAddress": "0x2f318C334780961FB129D2a6c30D0763d9a5C970"
}
'import requests
url = "https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/"
payload = { "refundAddress": "0x2f318C334780961FB129D2a6c30D0763d9a5C970" }
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({refundAddress: '0x2f318C334780961FB129D2a6c30D0763d9a5C970'})
};
fetch('https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/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://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/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([
'refundAddress' => '0x2f318C334780961FB129D2a6c30D0763d9a5C970'
]),
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://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/"
payload := strings.NewReader("{\n \"refundAddress\": \"0x2f318C334780961FB129D2a6c30D0763d9a5C970\"\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://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/refund/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refundAddress\": \"0x2f318C334780961FB129D2a6c30D0763d9a5C970\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableCryptoDeposits/{depositId}/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 \"refundAddress\": \"0x2f318C334780961FB129D2a6c30D0763d9a5C970\"\n}"
response = http.request(request)
puts response.read_body{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": 20074,
"type": "CryptoRefundAddressNotAllowedException",
"detail": {
"message": "A refund address is not allowed for this account: crypto refunds are sent to the on-chain origin address."
},
"status": 400
}{
"code": 40001,
"type": "NotAuthenticated",
"detail": {
"message": "Authentication credentials were not provided.",
"code": "not_authenticated"
},
"status": 401
}{
"code": 20072,
"type": "CryptoRefundNotEnabledException",
"detail": {
"message": "Crypto refunds are not enabled for this account."
},
"status": 403
}{
"code": 40004,
"type": "NotFound",
"detail": {
"message": "Not found.",
"code": "not_found"
},
"status": 404
}{
"code": 20077,
"type": "CryptoRefundDepositPendingMatchException",
"detail": {
"message": "Crypto refund not allowed for deposit 3c9f6a15-52ec-4d8b-9a71-8f0c4d2e6b19: it may still match an order"
},
"status": 409
}403 Forbidden with the error code 20072 (CryptoRefundNotEnabledException).Authorizations
Access token obtained via /oauth2/token/. Use as Authorization: Bearer <access_token>.
Headers
Optional. The public IP address of the end user's device (IPv4 or IPv6), captured on your frontend and forwarded by your backend — never your server's own address. Used for traceability and fraud prevention. An address that is not a valid IPv4 or IPv6 discards the end-user context of the request, without failing it. See Forwarding end-user context.
45Optional. The User-Agent of the end user's browser or app, not your backend's HTTP client. Longer values are truncated to 500 characters. See Forwarding end-user context.
500Optional. A stable identifier of the end user's device, as your app or frontend defines it. Longer values are truncated to 200 characters. See Forwarding end-user context.
200Path Parameters
Body
Body of a refund request for a crypto deposit with no order. Send refundAddress when the deposit's refundDestinationRequired is true; omit it when it is false.
On-chain address the crypto is returned to. Required when refundDestinationRequired is true: there is no order that could already carry an address. Rejected when the account is configured to refund to the deposit's origin address.
10 - 255"0x2f318C334780961FB129D2a6c30D0763d9a5C970"
Response
A refund already owns this deposit; nothing new was created.
Acknowledgement of the refund request for a crypto deposit with no order. Shaped differently from the order-rooted CryptoRefundResponse: there is no order to name, and you need the refundId to follow the refund through latestRefund on the deposit.
Was this page helpful?