Create a ramp order
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_bodyRamp
Create a ramp order
Creates an on-ramp or off-ramp order with the selected provider.
POST
/
ramp
/
orders
Create a ramp order
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_bodyBody
application/json
Destination blockchain where user wants their funds (required for on-ramp)
Available options:
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 Example:
"BASE_MAINNET"
Source blockchain where user will send crypto from (required for off-ramp)
Available options:
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 Example:
"BASE_MAINNET"
Token symbol for cryptoAmount (defaults to USDC)
Available options:
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 Example:
"USDC"
End-user's email address. Required for direct orders.
Example:
Response
Ramp order created successfully
Was this page helpful?

