curl --request POST \
--url https://api-dev.rain.xyz/v1/payment-routes \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "11111111-1111-1111-1111-111111111111",
"source": {
"currency": "usd",
"rail": "ach"
},
"destination": {
"currency": "usdc",
"rail": "base",
"address": {
"type": "onchain",
"address": "0x1234567890abcdef1234567890abcdef12345678"
}
}
}
'import requests
url = "https://api-dev.rain.xyz/v1/payment-routes"
payload = {
"userId": "11111111-1111-1111-1111-111111111111",
"source": {
"currency": "usd",
"rail": "ach"
},
"destination": {
"currency": "usdc",
"rail": "base",
"address": {
"type": "onchain",
"address": "0x1234567890abcdef1234567890abcdef12345678"
}
}
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '11111111-1111-1111-1111-111111111111',
source: {currency: 'usd', rail: 'ach'},
destination: {
currency: 'usdc',
rail: 'base',
address: {type: 'onchain', address: '0x1234567890abcdef1234567890abcdef12345678'}
}
})
};
fetch('https://api-dev.rain.xyz/v1/payment-routes', 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/payment-routes",
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([
'userId' => '11111111-1111-1111-1111-111111111111',
'source' => [
'currency' => 'usd',
'rail' => 'ach'
],
'destination' => [
'currency' => 'usdc',
'rail' => 'base',
'address' => [
'type' => 'onchain',
'address' => '0x1234567890abcdef1234567890abcdef12345678'
]
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"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://api-dev.rain.xyz/v1/payment-routes"
payload := strings.NewReader("{\n \"userId\": \"11111111-1111-1111-1111-111111111111\",\n \"source\": {\n \"currency\": \"usd\",\n \"rail\": \"ach\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"rail\": \"base\",\n \"address\": {\n \"type\": \"onchain\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/payment-routes")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"11111111-1111-1111-1111-111111111111\",\n \"source\": {\n \"currency\": \"usd\",\n \"rail\": \"ach\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"rail\": \"base\",\n \"address\": {\n \"type\": \"onchain\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/payment-routes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"11111111-1111-1111-1111-111111111111\",\n \"source\": {\n \"currency\": \"usd\",\n \"rail\": \"ach\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"rail\": \"base\",\n \"address\": {\n \"type\": \"onchain\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"userId": "11111111-1111-1111-1111-111111111111",
"status": "active",
"source": {
"currency": "usd",
"rail": "ach"
},
"destination": {
"currency": "usdc",
"rail": "base",
"address": {
"type": "onchain",
"address": "0x1234567890abcdef1234567890abcdef12345678"
}
},
"depositAddress": {
"type": "fiat",
"beneficiaryName": "RAIN PAYMENTS INC",
"beneficiaryAddress": "123 Finance St, New York, NY 10001, US",
"beneficiaryBankName": "Partner Bank, N.A.",
"beneficiaryBankAddress": "456 Bank Ave, New York, NY 10002, US",
"accountNumber": "9876543210",
"routingNumber": "021000021",
"transferMessage": "REF-A1B2C3D4"
},
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:00:00Z"
}{
"statusCode": 400,
"error": "BadRequestError",
"message": "Invalid request - duplicate automation or invalid source/destination"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid or missing API key"
}{
"statusCode": 403,
"error": "ForbiddenError",
"message": "Team has not completed KYC verification"
}{
"statusCode": 404,
"error": "NotFoundError",
"message": "Bad Request"
}{
"statusCode": 422,
"error": "UnprocessableEntityError",
"message": "User is missing required name information"
}{
"statusCode": 500,
"error": "InternalServerError",
"message": "Internal server error"
}{
"statusCode": 503,
"error": "ServiceUnavailableError",
"message": "Unable to verify compliance status"
}Create a payment route
Creates a payment route that automatically processes incoming funds. Payment routes can route funds from fiat to on-chain or from on-chain to fiat.
Deprecation Notice: This endpoint was previously named
/v1/automations. The old path remains available as a deprecated alias. Update your integrations to use/v1/payment-routes.
curl --request POST \
--url https://api-dev.rain.xyz/v1/payment-routes \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "11111111-1111-1111-1111-111111111111",
"source": {
"currency": "usd",
"rail": "ach"
},
"destination": {
"currency": "usdc",
"rail": "base",
"address": {
"type": "onchain",
"address": "0x1234567890abcdef1234567890abcdef12345678"
}
}
}
'import requests
url = "https://api-dev.rain.xyz/v1/payment-routes"
payload = {
"userId": "11111111-1111-1111-1111-111111111111",
"source": {
"currency": "usd",
"rail": "ach"
},
"destination": {
"currency": "usdc",
"rail": "base",
"address": {
"type": "onchain",
"address": "0x1234567890abcdef1234567890abcdef12345678"
}
}
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '11111111-1111-1111-1111-111111111111',
source: {currency: 'usd', rail: 'ach'},
destination: {
currency: 'usdc',
rail: 'base',
address: {type: 'onchain', address: '0x1234567890abcdef1234567890abcdef12345678'}
}
})
};
fetch('https://api-dev.rain.xyz/v1/payment-routes', 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/payment-routes",
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([
'userId' => '11111111-1111-1111-1111-111111111111',
'source' => [
'currency' => 'usd',
'rail' => 'ach'
],
'destination' => [
'currency' => 'usdc',
'rail' => 'base',
'address' => [
'type' => 'onchain',
'address' => '0x1234567890abcdef1234567890abcdef12345678'
]
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"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://api-dev.rain.xyz/v1/payment-routes"
payload := strings.NewReader("{\n \"userId\": \"11111111-1111-1111-1111-111111111111\",\n \"source\": {\n \"currency\": \"usd\",\n \"rail\": \"ach\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"rail\": \"base\",\n \"address\": {\n \"type\": \"onchain\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/payment-routes")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"11111111-1111-1111-1111-111111111111\",\n \"source\": {\n \"currency\": \"usd\",\n \"rail\": \"ach\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"rail\": \"base\",\n \"address\": {\n \"type\": \"onchain\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.rain.xyz/v1/payment-routes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"11111111-1111-1111-1111-111111111111\",\n \"source\": {\n \"currency\": \"usd\",\n \"rail\": \"ach\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"rail\": \"base\",\n \"address\": {\n \"type\": \"onchain\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"userId": "11111111-1111-1111-1111-111111111111",
"status": "active",
"source": {
"currency": "usd",
"rail": "ach"
},
"destination": {
"currency": "usdc",
"rail": "base",
"address": {
"type": "onchain",
"address": "0x1234567890abcdef1234567890abcdef12345678"
}
},
"depositAddress": {
"type": "fiat",
"beneficiaryName": "RAIN PAYMENTS INC",
"beneficiaryAddress": "123 Finance St, New York, NY 10001, US",
"beneficiaryBankName": "Partner Bank, N.A.",
"beneficiaryBankAddress": "456 Bank Ave, New York, NY 10002, US",
"accountNumber": "9876543210",
"routingNumber": "021000021",
"transferMessage": "REF-A1B2C3D4"
},
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:00:00Z"
}{
"statusCode": 400,
"error": "BadRequestError",
"message": "Invalid request - duplicate automation or invalid source/destination"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid or missing API key"
}{
"statusCode": 403,
"error": "ForbiddenError",
"message": "Team has not completed KYC verification"
}{
"statusCode": 404,
"error": "NotFoundError",
"message": "Bad Request"
}{
"statusCode": 422,
"error": "UnprocessableEntityError",
"message": "User is missing required name information"
}{
"statusCode": 500,
"error": "InternalServerError",
"message": "Internal server error"
}{
"statusCode": 503,
"error": "ServiceUnavailableError",
"message": "Unable to verify compliance status"
}Authorizations
Body
Payment route configuration
Crypto source configuration
- Crypto Source
- Fiat Source
Show child attributes
Show child attributes
Onchain destination with direct address
- Onchain Destination
- Fiat Destination
Show child attributes
Show child attributes
User ID (for individual teams; provide either userId or companyId)
Company ID (for company teams; provide either userId or companyId)
The address to refund funds to. Required when source is a crypto rail.
^(0x[a-fA-F0-9]{40}|T[1-9A-HJ-NP-Za-km-z]{31,43}|[1-9A-HJ-NP-Za-km-z]{32,44}|[GC][A-Z2-7]{55}|M[A-Z2-7]{68})$Optional array of sender fee configurations. Each fee is applied to transfers processed by this automation. Requires sender fees to be enabled for your account.
Show child attributes
Show child attributes
Deprecated: use senderFees instead. Still accepted for backward compatibility. If both are provided, senderFees takes precedence.
Show child attributes
Show child attributes
Response
Successful operation
The unique identifier of the payment route
Status of the payment route
active, frozen, deleted Crypto source configuration
- Crypto Source
- Fiat Source
Show child attributes
Show child attributes
Onchain destination with direct address
- Onchain Destination
- Fiat Destination
Show child attributes
Show child attributes
The deposit address for funds to be sent to this payment route
- Fiat Deposit Address
- Onchain Deposit Address
Show child attributes
Show child attributes
When the payment route was created
When the payment route was last updated
User ID (present for individual teams; omit for company teams)
Company ID (present for company teams; omit for individual teams)
The onchain address where funds are returned if a transaction cannot be completed. Present when the source is a crypto rail.
Array of sender fee configurations for this payment route. Present when sender fees are configured.
Show child attributes
Show child attributes
Deprecated: use senderFees instead. Returns the same values as senderFees for backward compatibility.
Show child attributes
Show child attributes