curl --request POST \
--url https://api.chainrails.io/api/v1/ramp/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "on-ramp",
"provider": "YELLOW_CARD",
"fiatCurrency": "NGN",
"cryptoAmount": 10,
"destinationChain": "BASE_MAINNET",
"sourceChain": "BASE_MAINNET",
"amountSymbol": "USDC",
"recipientAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"senderAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"countryCode": "NG",
"userEmail": "[email protected]",
"fields": {
"phoneNumber": "+2348012345678"
}
}
'import requests
url = "https://api.chainrails.io/api/v1/ramp/orders"
payload = {
"type": "on-ramp",
"provider": "YELLOW_CARD",
"fiatCurrency": "NGN",
"cryptoAmount": 10,
"destinationChain": "BASE_MAINNET",
"sourceChain": "BASE_MAINNET",
"amountSymbol": "USDC",
"recipientAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"senderAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"countryCode": "NG",
"userEmail": "[email protected]",
"fields": { "phoneNumber": "+2348012345678" }
}
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({
type: 'on-ramp',
provider: 'YELLOW_CARD',
fiatCurrency: 'NGN',
cryptoAmount: 10,
destinationChain: 'BASE_MAINNET',
sourceChain: 'BASE_MAINNET',
amountSymbol: 'USDC',
recipientAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
senderAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
countryCode: 'NG',
userEmail: '[email protected]',
fields: {phoneNumber: '+2348012345678'}
})
};
fetch('https://api.chainrails.io/api/v1/ramp/orders', 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/ramp/orders",
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([
'type' => 'on-ramp',
'provider' => 'YELLOW_CARD',
'fiatCurrency' => 'NGN',
'cryptoAmount' => 10,
'destinationChain' => 'BASE_MAINNET',
'sourceChain' => 'BASE_MAINNET',
'amountSymbol' => 'USDC',
'recipientAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'senderAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'countryCode' => 'NG',
'userEmail' => '[email protected]',
'fields' => [
'phoneNumber' => '+2348012345678'
]
]),
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/ramp/orders"
payload := strings.NewReader("{\n \"type\": \"on-ramp\",\n \"provider\": \"YELLOW_CARD\",\n \"fiatCurrency\": \"NGN\",\n \"cryptoAmount\": 10,\n \"destinationChain\": \"BASE_MAINNET\",\n \"sourceChain\": \"BASE_MAINNET\",\n \"amountSymbol\": \"USDC\",\n \"recipientAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"senderAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"countryCode\": \"NG\",\n \"userEmail\": \"[email protected]\",\n \"fields\": {\n \"phoneNumber\": \"+2348012345678\"\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/ramp/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"on-ramp\",\n \"provider\": \"YELLOW_CARD\",\n \"fiatCurrency\": \"NGN\",\n \"cryptoAmount\": 10,\n \"destinationChain\": \"BASE_MAINNET\",\n \"sourceChain\": \"BASE_MAINNET\",\n \"amountSymbol\": \"USDC\",\n \"recipientAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"senderAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"countryCode\": \"NG\",\n \"userEmail\": \"[email protected]\",\n \"fields\": {\n \"phoneNumber\": \"+2348012345678\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainrails.io/api/v1/ramp/orders")
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 \"type\": \"on-ramp\",\n \"provider\": \"YELLOW_CARD\",\n \"fiatCurrency\": \"NGN\",\n \"cryptoAmount\": 10,\n \"destinationChain\": \"BASE_MAINNET\",\n \"sourceChain\": \"BASE_MAINNET\",\n \"amountSymbol\": \"USDC\",\n \"recipientAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"senderAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"countryCode\": \"NG\",\n \"userEmail\": \"[email protected]\",\n \"fields\": {\n \"phoneNumber\": \"+2348012345678\"\n }\n}"
response = http.request(request)
puts response.read_bodyCreate a ramp order
Creates an on-ramp or off-ramp order with the selected provider.
curl --request POST \
--url https://api.chainrails.io/api/v1/ramp/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "on-ramp",
"provider": "YELLOW_CARD",
"fiatCurrency": "NGN",
"cryptoAmount": 10,
"destinationChain": "BASE_MAINNET",
"sourceChain": "BASE_MAINNET",
"amountSymbol": "USDC",
"recipientAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"senderAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"countryCode": "NG",
"userEmail": "[email protected]",
"fields": {
"phoneNumber": "+2348012345678"
}
}
'import requests
url = "https://api.chainrails.io/api/v1/ramp/orders"
payload = {
"type": "on-ramp",
"provider": "YELLOW_CARD",
"fiatCurrency": "NGN",
"cryptoAmount": 10,
"destinationChain": "BASE_MAINNET",
"sourceChain": "BASE_MAINNET",
"amountSymbol": "USDC",
"recipientAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"senderAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"countryCode": "NG",
"userEmail": "[email protected]",
"fields": { "phoneNumber": "+2348012345678" }
}
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({
type: 'on-ramp',
provider: 'YELLOW_CARD',
fiatCurrency: 'NGN',
cryptoAmount: 10,
destinationChain: 'BASE_MAINNET',
sourceChain: 'BASE_MAINNET',
amountSymbol: 'USDC',
recipientAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
senderAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
countryCode: 'NG',
userEmail: '[email protected]',
fields: {phoneNumber: '+2348012345678'}
})
};
fetch('https://api.chainrails.io/api/v1/ramp/orders', 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/ramp/orders",
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([
'type' => 'on-ramp',
'provider' => 'YELLOW_CARD',
'fiatCurrency' => 'NGN',
'cryptoAmount' => 10,
'destinationChain' => 'BASE_MAINNET',
'sourceChain' => 'BASE_MAINNET',
'amountSymbol' => 'USDC',
'recipientAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'senderAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'countryCode' => 'NG',
'userEmail' => '[email protected]',
'fields' => [
'phoneNumber' => '+2348012345678'
]
]),
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/ramp/orders"
payload := strings.NewReader("{\n \"type\": \"on-ramp\",\n \"provider\": \"YELLOW_CARD\",\n \"fiatCurrency\": \"NGN\",\n \"cryptoAmount\": 10,\n \"destinationChain\": \"BASE_MAINNET\",\n \"sourceChain\": \"BASE_MAINNET\",\n \"amountSymbol\": \"USDC\",\n \"recipientAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"senderAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"countryCode\": \"NG\",\n \"userEmail\": \"[email protected]\",\n \"fields\": {\n \"phoneNumber\": \"+2348012345678\"\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/ramp/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"on-ramp\",\n \"provider\": \"YELLOW_CARD\",\n \"fiatCurrency\": \"NGN\",\n \"cryptoAmount\": 10,\n \"destinationChain\": \"BASE_MAINNET\",\n \"sourceChain\": \"BASE_MAINNET\",\n \"amountSymbol\": \"USDC\",\n \"recipientAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"senderAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"countryCode\": \"NG\",\n \"userEmail\": \"[email protected]\",\n \"fields\": {\n \"phoneNumber\": \"+2348012345678\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainrails.io/api/v1/ramp/orders")
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 \"type\": \"on-ramp\",\n \"provider\": \"YELLOW_CARD\",\n \"fiatCurrency\": \"NGN\",\n \"cryptoAmount\": 10,\n \"destinationChain\": \"BASE_MAINNET\",\n \"sourceChain\": \"BASE_MAINNET\",\n \"amountSymbol\": \"USDC\",\n \"recipientAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"senderAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"countryCode\": \"NG\",\n \"userEmail\": \"[email protected]\",\n \"fields\": {\n \"phoneNumber\": \"+2348012345678\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Enter your Chainrails API key as a Bearer token
Body
Type of ramp order to create
on-ramp, off-ramp "on-ramp"
Ramp provider to use for this order
FONBNK, ONRAMP_MONEY, GUARDARIAN, YELLOW_CARD "YELLOW_CARD"
ISO 4217 fiat currency code
"NGN"
Amount of crypto the user wants to receive (on-ramp) or sell (off-ramp). For off-ramp this is the amount of the selected source token.
10
Destination blockchain where user wants their funds (required for on-ramp)
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 "BASE_MAINNET"
Source blockchain where user will send crypto from (required for off-ramp)
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 "BASE_MAINNET"
Token symbol for cryptoAmount (defaults to USDC)
USDC, USDT, DAI, BUSD, EURC, ETH, WETH, STRK, BNB, LORDS, USDS, USDG, USDT0, WBTC, LINK, SOL, EKUBO, AAVE, UNI, CURVE, cbBTC, VIRTUAL, stETH, wstETH, SKY, AUSD, WMON, LVMON, OP, WLD, ARB, sAVAX, WAVAX, anyBTC, WBNB, TRON, AVAX, POL, MON "USDC"
Recipient wallet address on the destination chain (required for on-ramp)
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
User's crypto wallet address / sender (required for off-ramp)
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
ISO 3166-1 alpha-2 country code of the user. Required for multi-country currencies (e.g., XOF — pass "BJ" for Benin, "SN" for Senegal). Falls back to the currency's default country if omitted.
"NG"
End-user's email address. Required for direct orders.
Provider-specific fields required by the payment channel (e.g., phone number, bank code)
{ "phoneNumber": "+2348012345678" }
Response
Ramp order created successfully
Was this page helpful?

