curl --request POST \
--url https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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{
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"transactionId": "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": 20054,
"type": "CryptoRefundNotAllowedRequestException",
"detail": {
"message": "This order cannot be refunded."
},
"status": 409
}Request a Customer's Crypto Refund
Requests the return of the crypto deposited for an off-ramp order that could not be completed (for example, because the trade could not be executed).
Check refundable on the order before calling: it tells you whether a refund can be requested right now. Whether the request must name a destination is given by refundDestinationRequired — true means refundAddress is required (unless the order already carries one from its creation), false means the crypto returns to the on-chain origin address and refundAddress is rejected.
The request is idempotent: 202 when the refund is registered, 200 when one already exists for the deposit.
Registering the refund, its approval and a rejection are all silent; only a completed refund emits an event, OFF-RAMP.ORDER.REFUNDED (see Off-Ramp Events). Follow progress — and learn of a rejection — through the latestRefund block on the order.
See Refunds for the full model.
Same operation as POST /offramp/{orderId}/refund/, scoped to the customer that owns the order — use it when your integration is organised per end customer.
curl --request POST \
--url https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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}/transactions/offramp/{orderId}/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{
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"transactionId": "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": 20054,
"type": "CryptoRefundNotAllowedRequestException",
"detail": {
"message": "This order cannot be refunded."
},
"status": 409
}Authorizations
Access token obtained via /oauth2/token/. Use as Authorization: Bearer <access_token>.
Path Parameters
Unique identifier for the customer.
Unique identifier for the order.
Body
Body of a crypto refund request. Send refundAddress only when refundDestinationRequired is true and the order does not already carry one.
On-chain address the crypto is returned to. Rejected when the account is configured to refund to the deposit's origin address.
10 - 255"0x2f318C334780961FB129D2a6c30D0763d9a5C970"
Response
A refund already exists for this deposit; nothing new was created.
Acknowledgement of a crypto refund request. Follow its progress through the latestRefund block on the order.
Identifier of the off-ramp order being refunded.
Was this page helpful?