Create Onramp Order
curl --request POST \
--url https://api.sandbox.sardine.ai/v1/onramp \
--header 'Content-Type: application/json' \
--data '
{
"userId": "abc123",
"fromCurrency": "USD",
"toCurrency": "ETH",
"amount": 100,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"depositAddress": "0xabc123def456ghi789jkl000mno111pqrs222tuv"
}
'import requests
url = "https://api.sandbox.sardine.ai/v1/onramp"
payload = {
"userId": "abc123",
"fromCurrency": "USD",
"toCurrency": "ETH",
"amount": 100,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"depositAddress": "0xabc123def456ghi789jkl000mno111pqrs222tuv"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 'abc123',
fromCurrency: 'USD',
toCurrency: 'ETH',
amount: 100,
chain: 'ethereum',
paymentMethodId: 'pay-987654321',
depositAddress: '0xabc123def456ghi789jkl000mno111pqrs222tuv'
})
};
fetch('https://api.sandbox.sardine.ai/v1/onramp', 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.sandbox.sardine.ai/v1/onramp",
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' => 'abc123',
'fromCurrency' => 'USD',
'toCurrency' => 'ETH',
'amount' => 100,
'chain' => 'ethereum',
'paymentMethodId' => 'pay-987654321',
'depositAddress' => '0xabc123def456ghi789jkl000mno111pqrs222tuv'
]),
CURLOPT_HTTPHEADER => [
"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.sandbox.sardine.ai/v1/onramp"
payload := strings.NewReader("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"USD\",\n \"toCurrency\": \"ETH\",\n \"amount\": 100,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"depositAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.sandbox.sardine.ai/v1/onramp")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"USD\",\n \"toCurrency\": \"ETH\",\n \"amount\": 100,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"depositAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sardine.ai/v1/onramp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"USD\",\n \"toCurrency\": \"ETH\",\n \"amount\": 100,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"depositAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "ONR-20250417-001",
"status": "pending",
"estimatedDelivery": "2025-04-17T15:45:00Z"
}Order Execution
Create Onramp Order
This endpoint is used to initiate an onramp transaction, converting fiat to crypto and delivering the crypto to a destination wallet.
POST
/
onramp
Create Onramp Order
curl --request POST \
--url https://api.sandbox.sardine.ai/v1/onramp \
--header 'Content-Type: application/json' \
--data '
{
"userId": "abc123",
"fromCurrency": "USD",
"toCurrency": "ETH",
"amount": 100,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"depositAddress": "0xabc123def456ghi789jkl000mno111pqrs222tuv"
}
'import requests
url = "https://api.sandbox.sardine.ai/v1/onramp"
payload = {
"userId": "abc123",
"fromCurrency": "USD",
"toCurrency": "ETH",
"amount": 100,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"depositAddress": "0xabc123def456ghi789jkl000mno111pqrs222tuv"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 'abc123',
fromCurrency: 'USD',
toCurrency: 'ETH',
amount: 100,
chain: 'ethereum',
paymentMethodId: 'pay-987654321',
depositAddress: '0xabc123def456ghi789jkl000mno111pqrs222tuv'
})
};
fetch('https://api.sandbox.sardine.ai/v1/onramp', 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.sandbox.sardine.ai/v1/onramp",
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' => 'abc123',
'fromCurrency' => 'USD',
'toCurrency' => 'ETH',
'amount' => 100,
'chain' => 'ethereum',
'paymentMethodId' => 'pay-987654321',
'depositAddress' => '0xabc123def456ghi789jkl000mno111pqrs222tuv'
]),
CURLOPT_HTTPHEADER => [
"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.sandbox.sardine.ai/v1/onramp"
payload := strings.NewReader("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"USD\",\n \"toCurrency\": \"ETH\",\n \"amount\": 100,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"depositAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.sandbox.sardine.ai/v1/onramp")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"USD\",\n \"toCurrency\": \"ETH\",\n \"amount\": 100,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"depositAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sardine.ai/v1/onramp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"USD\",\n \"toCurrency\": \"ETH\",\n \"amount\": 100,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"depositAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "ONR-20250417-001",
"status": "pending",
"estimatedDelivery": "2025-04-17T15:45:00Z"
}Body
application/json