Create Offramp Order
curl --request POST \
--url https://api.sandbox.sardine.ai/v1/offramp \
--header 'Content-Type: application/json' \
--data '
{
"userId": "abc123",
"fromCurrency": "ETH",
"toCurrency": "USD",
"amount": 0.05,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"withdrawalAddress": "0xabc123def456ghi789jkl000mno111pqrs222tuv"
}
'import requests
url = "https://api.sandbox.sardine.ai/v1/offramp"
payload = {
"userId": "abc123",
"fromCurrency": "ETH",
"toCurrency": "USD",
"amount": 0.05,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"withdrawalAddress": "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: 'ETH',
toCurrency: 'USD',
amount: 0.05,
chain: 'ethereum',
paymentMethodId: 'pay-987654321',
withdrawalAddress: '0xabc123def456ghi789jkl000mno111pqrs222tuv'
})
};
fetch('https://api.sandbox.sardine.ai/v1/offramp', 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/offramp",
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' => 'ETH',
'toCurrency' => 'USD',
'amount' => 0.05,
'chain' => 'ethereum',
'paymentMethodId' => 'pay-987654321',
'withdrawalAddress' => '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/offramp"
payload := strings.NewReader("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"ETH\",\n \"toCurrency\": \"USD\",\n \"amount\": 0.05,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"withdrawalAddress\": \"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/offramp")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"ETH\",\n \"toCurrency\": \"USD\",\n \"amount\": 0.05,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"withdrawalAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sardine.ai/v1/offramp")
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\": \"ETH\",\n \"toCurrency\": \"USD\",\n \"amount\": 0.05,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"withdrawalAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "OFF-20250417-001",
"status": "pending",
"estimatedPayout": "2025-04-17T18:00:00Z"
}Order Execution
Create Offramp Order
This endpoint is used to initiate an offramp transaction, converting crypto to fiat and transferring funds to the user’s connected payment method.
POST
/
offramp
Create Offramp Order
curl --request POST \
--url https://api.sandbox.sardine.ai/v1/offramp \
--header 'Content-Type: application/json' \
--data '
{
"userId": "abc123",
"fromCurrency": "ETH",
"toCurrency": "USD",
"amount": 0.05,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"withdrawalAddress": "0xabc123def456ghi789jkl000mno111pqrs222tuv"
}
'import requests
url = "https://api.sandbox.sardine.ai/v1/offramp"
payload = {
"userId": "abc123",
"fromCurrency": "ETH",
"toCurrency": "USD",
"amount": 0.05,
"chain": "ethereum",
"paymentMethodId": "pay-987654321",
"withdrawalAddress": "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: 'ETH',
toCurrency: 'USD',
amount: 0.05,
chain: 'ethereum',
paymentMethodId: 'pay-987654321',
withdrawalAddress: '0xabc123def456ghi789jkl000mno111pqrs222tuv'
})
};
fetch('https://api.sandbox.sardine.ai/v1/offramp', 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/offramp",
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' => 'ETH',
'toCurrency' => 'USD',
'amount' => 0.05,
'chain' => 'ethereum',
'paymentMethodId' => 'pay-987654321',
'withdrawalAddress' => '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/offramp"
payload := strings.NewReader("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"ETH\",\n \"toCurrency\": \"USD\",\n \"amount\": 0.05,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"withdrawalAddress\": \"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/offramp")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"abc123\",\n \"fromCurrency\": \"ETH\",\n \"toCurrency\": \"USD\",\n \"amount\": 0.05,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"withdrawalAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.sardine.ai/v1/offramp")
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\": \"ETH\",\n \"toCurrency\": \"USD\",\n \"amount\": 0.05,\n \"chain\": \"ethereum\",\n \"paymentMethodId\": \"pay-987654321\",\n \"withdrawalAddress\": \"0xabc123def456ghi789jkl000mno111pqrs222tuv\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "OFF-20250417-001",
"status": "pending",
"estimatedPayout": "2025-04-17T18:00:00Z"
}Body
application/json
ID of the user placing the offramp order
The cryptocurrency being sold (e.g., ETH)
The fiat currency to be received (e.g., USD)
Amount of crypto to convert
Blockchain network of the crypto (e.g., ethereum, polygon)
ID of the user’s fiat withdrawal method (e.g., bank or card)
Wallet address from which the crypto will be sent
⌘I