curl --request POST \
--url https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/refund/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiatAccountId": "3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f"
}
'import requests
url = "https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/refund/"
payload = { "fiatAccountId": "3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f" }
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({fiatAccountId: '3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f'})
};
fetch('https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/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}/refundableDeposits/{depositUuid}/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([
'fiatAccountId' => '3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f'
]),
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}/refundableDeposits/{depositUuid}/refund/"
payload := strings.NewReader("{\n \"fiatAccountId\": \"3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f\"\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}/refundableDeposits/{depositUuid}/refund/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiatAccountId\": \"3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/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 \"fiatAccountId\": \"3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f\"\n}"
response = http.request(request)
puts response.read_body{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"initiatedBy": "PARTNER"
}{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"initiatedBy": "PARTNER"
}{
"code": 20067,
"type": "FiatAccountRequiredForRefundException",
"detail": {
"message": "fiatAccountId is required to refund a deposit for this provider."
},
"status": 400
}{
"code": 40001,
"type": "NotAuthenticated",
"detail": {
"message": "Authentication credentials were not provided.",
"code": "not_authenticated"
},
"status": 401
}{
"code": 20056,
"type": "FiatRefundNotEnabledException",
"detail": {
"message": "Fiat refunds are not enabled for this account."
},
"status": 403
}{
"code": 40004,
"type": "NotFound",
"detail": {
"message": "Not found.",
"code": "not_found"
},
"status": 404
}{
"code": 20057,
"type": "FiatRefundAlreadyExistsException",
"detail": {
"message": "A refund already exists for this deposit."
},
"status": 409
}Refund a Deposit
Requests the return of a fiat deposit that was received but never matched to an on-ramp order — the ones listed by GET /customers/{customerId}/refundableDeposits/.
Whether the request must name a destination account is given by refundDestinationRequired on the listed deposit: true means fiatAccountId is required (Colombia), false means the money returns to the account the customer paid from and fiatAccountId is rejected.
The request is idempotent: 202 when the refund is registered, 200 when one already exists for the deposit. Once the refund settles you also receive the ON-RAMP.DEPOSIT.REFUNDED webhook event.
Deposits whose order was cancelled are refunded through the order instead, with POST /customers/{customerId}/transactions/onramp/{orderId}/refund/.
curl --request POST \
--url https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/refund/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiatAccountId": "3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f"
}
'import requests
url = "https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/refund/"
payload = { "fiatAccountId": "3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f" }
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({fiatAccountId: '3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f'})
};
fetch('https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/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}/refundableDeposits/{depositUuid}/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([
'fiatAccountId' => '3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f'
]),
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}/refundableDeposits/{depositUuid}/refund/"
payload := strings.NewReader("{\n \"fiatAccountId\": \"3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f\"\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}/refundableDeposits/{depositUuid}/refund/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiatAccountId\": \"3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://skala-sandbox.ripio.com/api/v1/customers/{customerId}/refundableDeposits/{depositUuid}/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 \"fiatAccountId\": \"3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f\"\n}"
response = http.request(request)
puts response.read_body{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"initiatedBy": "PARTNER"
}{
"refundId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"depositUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"initiatedBy": "PARTNER"
}{
"code": 20067,
"type": "FiatAccountRequiredForRefundException",
"detail": {
"message": "fiatAccountId is required to refund a deposit for this provider."
},
"status": 400
}{
"code": 40001,
"type": "NotAuthenticated",
"detail": {
"message": "Authentication credentials were not provided.",
"code": "not_authenticated"
},
"status": 401
}{
"code": 20056,
"type": "FiatRefundNotEnabledException",
"detail": {
"message": "Fiat refunds are not enabled for this account."
},
"status": 403
}{
"code": 40004,
"type": "NotFound",
"detail": {
"message": "Not found.",
"code": "not_found"
},
"status": 404
}{
"code": 20057,
"type": "FiatRefundAlreadyExistsException",
"detail": {
"message": "A refund already exists for this deposit."
},
"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 deposit.
Body
Body of a fiat refund request. Send fiatAccountId only when refundDestinationRequired is true.
Identifier of an ENABLED fiat account of the same customer, where the money is returned. Rejected by providers that refund to the account the customer paid from.
"3c9f1f0e-6a2d-4a7c-9f1e-2b8d4c5a6e7f"
Response
A refund already exists for this deposit; nothing new was created.
Acknowledgement of a fiat refund request. The request is idempotent, so a 200 returns whatever refund already existed for the deposit — read initiatedBy before presenting it as the customer's own request.
Unique identifier of the refund.
Current state of the refund: PENDING (registered, not yet sent to the provider), PROCESSING (sent, awaiting confirmation), COMPLETED (the money reached its destination), REJECTED (the request was declined — see rejectionReason — and nothing was sent) or FAILED / CANCELLED (the attempt did not go through; contact Ripio support).
PENDING, PROCESSING, COMPLETED, REJECTED, FAILED, CANCELLED Identifier of the deposit being refunded.
Who originated the refund this response is about: PARTNER (your API call), WIDGET (the end user, from the widget), SYSTEM (returned automatically by Ripio) or OPS (registered by Ripio's support team on the customer's behalf).
PARTNER, WIDGET, SYSTEM, OPS Was this page helpful?