curl --request POST \
--url https://api.chainrails.io/api/v1/intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sender": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": "1000000",
"amountSymbol": "USDC",
"tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"source_chain": "ETHEREUM_MAINNET",
"destination_chain": "STARKNET_MAINNET",
"recipient": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"refund_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"metadata": {
"orderId": "12345"
}
}
'import requests
url = "https://api.chainrails.io/api/v1/intents"
payload = {
"sender": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": "1000000",
"amountSymbol": "USDC",
"tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"source_chain": "ETHEREUM_MAINNET",
"destination_chain": "STARKNET_MAINNET",
"recipient": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"refund_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"metadata": { "orderId": "12345" }
}
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({
sender: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
amount: '1000000',
amountSymbol: 'USDC',
tokenIn: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
source_chain: 'ETHEREUM_MAINNET',
destination_chain: 'STARKNET_MAINNET',
recipient: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
refund_address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
metadata: {orderId: '12345'}
})
};
fetch('https://api.chainrails.io/api/v1/intents', 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.chainrails.io/api/v1/intents",
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([
'sender' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'amount' => '1000000',
'amountSymbol' => 'USDC',
'tokenIn' => '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'source_chain' => 'ETHEREUM_MAINNET',
'destination_chain' => 'STARKNET_MAINNET',
'recipient' => '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
'refund_address' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'metadata' => [
'orderId' => '12345'
]
]),
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://api.chainrails.io/api/v1/intents"
payload := strings.NewReader("{\n \"sender\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": \"1000000\",\n \"amountSymbol\": \"USDC\",\n \"tokenIn\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"source_chain\": \"ETHEREUM_MAINNET\",\n \"destination_chain\": \"STARKNET_MAINNET\",\n \"recipient\": \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n \"refund_address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"metadata\": {\n \"orderId\": \"12345\"\n }\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://api.chainrails.io/api/v1/intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sender\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": \"1000000\",\n \"amountSymbol\": \"USDC\",\n \"tokenIn\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"source_chain\": \"ETHEREUM_MAINNET\",\n \"destination_chain\": \"STARKNET_MAINNET\",\n \"recipient\": \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n \"refund_address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"metadata\": {\n \"orderId\": \"12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainrails.io/api/v1/intents")
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 \"sender\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": \"1000000\",\n \"amountSymbol\": \"USDC\",\n \"tokenIn\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"source_chain\": \"ETHEREUM_MAINNET\",\n \"destination_chain\": \"STARKNET_MAINNET\",\n \"recipient\": \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n \"refund_address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"metadata\": {\n \"orderId\": \"12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"client_id": "e1ee3675-cb26-4a76-8206-a84f86e85862",
"sender": "0xdA3ECb2E5362295E2b802669dD47127A61d9Ce54",
"initialAmount": "1000000",
"fees_in_usd": "500",
"app_fee_in_usd": "1000",
"total_amount_in_usd": "1010500",
"total_amount_in_asset_token": "1000500",
"fees_in_asset_token": "500",
"app_fee_in_asset_token": "0",
"asset_token_symbol": "USDC",
"asset_token_decimals": 6,
"slippage": "0.5",
"tokenIn": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"tokenOut": "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
"intent_address": "0x4E60e01263E750eD9D087157e19D2480Fd86A900",
"source_chain": "BASE_TESTNET",
"destination_chain": "ARBITRUM_TESTNET",
"recipient": "0xb79541Be080a59fdcE6C0b43219ba56c725eC65e",
"refund_address": "0xb79541Be080a59fdcE6C0b43219ba56c725eC65e",
"relayer": "",
"coordinator": "0x989f47053F188778575113DcF39dB8960Fc450e2",
"bridger": "0xa1c943058a631D5506eb7d96036eAbF6968e2338",
"bridgeExtraData": "0x00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000300000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d",
"intent_nonce": 4267684716645197,
"intent_status": "PENDING",
"tx_hash": null,
"needs_relay": false,
"expires_at": "2025-11-11T02:31:23.000Z",
"metadata": {
"priority": "normal",
"description": "Cross-chain USDC transfer"
},
"created_at": "2025-11-11T01:31:23.390Z",
"updated_at": "2025-11-11T01:31:23.390Z"
}Create new intent
Creates a new payment intent with cross-chain transfer parameters
curl --request POST \
--url https://api.chainrails.io/api/v1/intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sender": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": "1000000",
"amountSymbol": "USDC",
"tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"source_chain": "ETHEREUM_MAINNET",
"destination_chain": "STARKNET_MAINNET",
"recipient": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"refund_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"metadata": {
"orderId": "12345"
}
}
'import requests
url = "https://api.chainrails.io/api/v1/intents"
payload = {
"sender": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": "1000000",
"amountSymbol": "USDC",
"tokenIn": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"source_chain": "ETHEREUM_MAINNET",
"destination_chain": "STARKNET_MAINNET",
"recipient": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"refund_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"metadata": { "orderId": "12345" }
}
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({
sender: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
amount: '1000000',
amountSymbol: 'USDC',
tokenIn: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
source_chain: 'ETHEREUM_MAINNET',
destination_chain: 'STARKNET_MAINNET',
recipient: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
refund_address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
metadata: {orderId: '12345'}
})
};
fetch('https://api.chainrails.io/api/v1/intents', 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.chainrails.io/api/v1/intents",
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([
'sender' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'amount' => '1000000',
'amountSymbol' => 'USDC',
'tokenIn' => '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'source_chain' => 'ETHEREUM_MAINNET',
'destination_chain' => 'STARKNET_MAINNET',
'recipient' => '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
'refund_address' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'metadata' => [
'orderId' => '12345'
]
]),
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://api.chainrails.io/api/v1/intents"
payload := strings.NewReader("{\n \"sender\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": \"1000000\",\n \"amountSymbol\": \"USDC\",\n \"tokenIn\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"source_chain\": \"ETHEREUM_MAINNET\",\n \"destination_chain\": \"STARKNET_MAINNET\",\n \"recipient\": \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n \"refund_address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"metadata\": {\n \"orderId\": \"12345\"\n }\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://api.chainrails.io/api/v1/intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sender\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": \"1000000\",\n \"amountSymbol\": \"USDC\",\n \"tokenIn\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"source_chain\": \"ETHEREUM_MAINNET\",\n \"destination_chain\": \"STARKNET_MAINNET\",\n \"recipient\": \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n \"refund_address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"metadata\": {\n \"orderId\": \"12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainrails.io/api/v1/intents")
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 \"sender\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": \"1000000\",\n \"amountSymbol\": \"USDC\",\n \"tokenIn\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"source_chain\": \"ETHEREUM_MAINNET\",\n \"destination_chain\": \"STARKNET_MAINNET\",\n \"recipient\": \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\",\n \"refund_address\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"metadata\": {\n \"orderId\": \"12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"client_id": "e1ee3675-cb26-4a76-8206-a84f86e85862",
"sender": "0xdA3ECb2E5362295E2b802669dD47127A61d9Ce54",
"initialAmount": "1000000",
"fees_in_usd": "500",
"app_fee_in_usd": "1000",
"total_amount_in_usd": "1010500",
"total_amount_in_asset_token": "1000500",
"fees_in_asset_token": "500",
"app_fee_in_asset_token": "0",
"asset_token_symbol": "USDC",
"asset_token_decimals": 6,
"slippage": "0.5",
"tokenIn": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"tokenOut": "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
"intent_address": "0x4E60e01263E750eD9D087157e19D2480Fd86A900",
"source_chain": "BASE_TESTNET",
"destination_chain": "ARBITRUM_TESTNET",
"recipient": "0xb79541Be080a59fdcE6C0b43219ba56c725eC65e",
"refund_address": "0xb79541Be080a59fdcE6C0b43219ba56c725eC65e",
"relayer": "",
"coordinator": "0x989f47053F188778575113DcF39dB8960Fc450e2",
"bridger": "0xa1c943058a631D5506eb7d96036eAbF6968e2338",
"bridgeExtraData": "0x00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000300000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d",
"intent_nonce": 4267684716645197,
"intent_status": "PENDING",
"tx_hash": null,
"needs_relay": false,
"expires_at": "2025-11-11T02:31:23.000Z",
"metadata": {
"priority": "normal",
"description": "Cross-chain USDC transfer"
},
"created_at": "2025-11-11T01:31:23.390Z",
"updated_at": "2025-11-11T01:31:23.390Z"
}Authorizations
Enter your Chainrails API key as a Bearer token
Body
Intent creation parameters
Amount to transfer in smallest unit (e.g., wei for ETH).
"1000000000000000000"
Token symbol for amount denomination (e.g., USDC, USDT, ETH)
"USDC"
Token address on the source chain
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
Source blockchain network
ARBITRUM_MAINNET, ARBITRUM_TESTNET, AVALANCHE_MAINNET, AVALANCHE_TESTNET, BASE_MAINNET, BASE_TESTNET, STARKNET_MAINNET, STARKNET_TESTNET, BSC_MAINNET, ETHEREUM_MAINNET, ETHEREUM_TESTNET, OPTIMISM_MAINNET, OPTIMISM_TESTNET, MONAD_MAINNET, MONAD_TESTNET, POLYGON_MAINNET, HYPEREVM_MAINNET, LISK_MAINNET, SOLANA_MAINNET, SOLANA_TESTNET, TRON_MAINNET "ETHEREUM_MAINNET"
Destination blockchain network
ARBITRUM_MAINNET, ARBITRUM_TESTNET, AVALANCHE_MAINNET, AVALANCHE_TESTNET, BASE_MAINNET, BASE_TESTNET, STARKNET_MAINNET, STARKNET_TESTNET, BSC_MAINNET, ETHEREUM_MAINNET, ETHEREUM_TESTNET, OPTIMISM_MAINNET, OPTIMISM_TESTNET, MONAD_MAINNET, MONAD_TESTNET, POLYGON_MAINNET, HYPEREVM_MAINNET, LISK_MAINNET, SOLANA_MAINNET, SOLANA_TESTNET, TRON_MAINNET "STARKNET_MAINNET"
Recipient wallet address on the destination chain
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
Sender wallet address on the source chain
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
Payment link ID associated with the intent
"pl_xw1nw5rpaj"
Refund address on the source chain if intent fails
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
Additional metadata for the intent
{ "orderId": "12345", "userId": "user-abc" }
Response
Intent successfully created
2
"e1ee3675-cb26-4a76-8206-a84f86e85862"
"0xdA3ECb2E5362295E2b802669dD47127A61d9Ce54"
"1000000"
"500"
"1000"
"1010500"
"1000500"
"500"
"0"
"USDC"
6
"0.5"
"0x036CbD53842c5426634e7929541eC2318f3dCF7e"
"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"
Solana: intent PDA — show to users for QR/Send; transfer tokenIn here (wallet derives deposit ATA). EVM/Starknet: contract address.
"0x4E60e01263E750eD9D087157e19D2480Fd86A900"
"BASE_TESTNET"
"ARBITRUM_TESTNET"
"0xb79541Be080a59fdcE6C0b43219ba56c725eC65e"
"0xb79541Be080a59fdcE6C0b43219ba56c725eC65e"
""
"0x989f47053F188778575113DcF39dB8960Fc450e2"
"0xa1c943058a631D5506eb7d96036eAbF6968e2338"
"0x00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000300000000000000000000000075faf114eafb1bdbe2f0316df893fd58ce46aa4d"
4267684716645197
PENDING, PROCESSING, COMPLETED, FAILED "PENDING"
null
false
"2025-11-11T02:31:23.000Z"
{ "priority": "normal", "description": "Cross-chain USDC transfer" }
"2025-11-11T01:31:23.390Z"
"2025-11-11T01:31:23.390Z"
Was this page helpful?

