Create a transfer
curl --request POST \
--url https://api-dev.rain.xyz/v1/transfers \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refundAddress": "<string>",
"transferMessage": "<string>"
}
'import requests
url = "https://api-dev.rain.xyz/v1/transfers"
payload = {
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refundAddress": "<string>",
"transferMessage": "<string>"
}
headers = {
"idempotency-key": "<idempotency-key>",
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quoteId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
refundAddress: '<string>',
transferMessage: '<string>'
})
};
fetch('https://api-dev.rain.xyz/v1/transfers', 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-dev.rain.xyz/v1/transfers",
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([
'quoteId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'refundAddress' => '<string>',
'transferMessage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"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-dev.rain.xyz/v1/transfers"
payload := strings.NewReader("{\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refundAddress\": \"<string>\",\n \"transferMessage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Api-Key", "<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-dev.rain.xyz/v1/transfers")
.header("idempotency-key", "<idempotency-key>")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refundAddress\": \"<string>\",\n \"transferMessage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/transfers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refundAddress\": \"<string>\",\n \"transferMessage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "transfer",
"transfer": {
"source": {
"currency": "usdc",
"rail": "ethereum",
"amount": "<string>"
},
"destination": {
"currency": "usdc",
"rail": "ethereum",
"amount": "<string>",
"address": {
"type": "onchain",
"address": "<string>"
}
},
"exchangeRate": 123,
"fees": {
"rain": {
"currency": "<string>",
"amount": "<string>",
"amountUSD": "<string>"
},
"sender": {
"currency": "<string>",
"amount": "<string>",
"amountUSD": "<string>"
},
"developer": {
"currency": "<string>",
"amount": "<string>",
"amountUSD": "<string>"
}
},
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"depositAddress": {
"type": "onchain",
"address": "<string>"
},
"transferMessage": "<string>"
}
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}Transfers
Create a transfer
Creates a transfer from a quote. The response includes a deposit address where the user should send crypto. The transfer expires if funds are not deposited before the expiration time.
POST
/
transfers
Create a transfer
curl --request POST \
--url https://api-dev.rain.xyz/v1/transfers \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refundAddress": "<string>",
"transferMessage": "<string>"
}
'import requests
url = "https://api-dev.rain.xyz/v1/transfers"
payload = {
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refundAddress": "<string>",
"transferMessage": "<string>"
}
headers = {
"idempotency-key": "<idempotency-key>",
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quoteId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
refundAddress: '<string>',
transferMessage: '<string>'
})
};
fetch('https://api-dev.rain.xyz/v1/transfers', 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-dev.rain.xyz/v1/transfers",
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([
'quoteId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'refundAddress' => '<string>',
'transferMessage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"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-dev.rain.xyz/v1/transfers"
payload := strings.NewReader("{\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refundAddress\": \"<string>\",\n \"transferMessage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Api-Key", "<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-dev.rain.xyz/v1/transfers")
.header("idempotency-key", "<idempotency-key>")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refundAddress\": \"<string>\",\n \"transferMessage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/transfers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refundAddress\": \"<string>\",\n \"transferMessage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "transfer",
"transfer": {
"source": {
"currency": "usdc",
"rail": "ethereum",
"amount": "<string>"
},
"destination": {
"currency": "usdc",
"rail": "ethereum",
"amount": "<string>",
"address": {
"type": "onchain",
"address": "<string>"
}
},
"exchangeRate": 123,
"fees": {
"rain": {
"currency": "<string>",
"amount": "<string>",
"amountUSD": "<string>"
},
"sender": {
"currency": "<string>",
"amount": "<string>",
"amountUSD": "<string>"
},
"developer": {
"currency": "<string>",
"amount": "<string>",
"amountUSD": "<string>"
}
},
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"depositAddress": {
"type": "onchain",
"address": "<string>"
},
"transferMessage": "<string>"
}
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}Authorizations
Headers
Required client-supplied key (1โ64 characters) that prevents duplicate transfers on retry. Reusing the same key for the same transfer intent returns the existing transfer instead of creating a new one; reusing it for a different intent returns a 409 conflict.
Required string length:
1 - 64Body
application/json
Transfer request with a quote ID
Request body to create a transfer from a quote
The quote ID to execute. This acts as the Idempotency Key for the transfer.
The on-chain address to return funds to if the transfer fails or is refunded. Required on every transfer request.
Optional message for the transfer