Create Spot transfer
curl --request POST \
--url https://api.ondoperps.xyz/v1/spot/transfers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"id": "<string>"
},
"to": {
"id": "<string>"
},
"symbol": "<string>",
"amount": "<string>"
}
'import requests
url = "https://api.ondoperps.xyz/v1/spot/transfers"
payload = {
"from": { "id": "<string>" },
"to": { "id": "<string>" },
"symbol": "<string>",
"amount": "<string>"
}
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({
from: {id: '<string>'},
to: {id: '<string>'},
symbol: '<string>',
amount: '<string>'
})
};
fetch('https://api.ondoperps.xyz/v1/spot/transfers', 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.ondoperps.xyz/v1/spot/transfers",
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([
'from' => [
'id' => '<string>'
],
'to' => [
'id' => '<string>'
],
'symbol' => '<string>',
'amount' => '<string>'
]),
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.ondoperps.xyz/v1/spot/transfers"
payload := strings.NewReader("{\n \"from\": {\n \"id\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\"\n },\n \"symbol\": \"<string>\",\n \"amount\": \"<string>\"\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.ondoperps.xyz/v1/spot/transfers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"id\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\"\n },\n \"symbol\": \"<string>\",\n \"amount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/spot/transfers")
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 \"from\": {\n \"id\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\"\n },\n \"symbol\": \"<string>\",\n \"amount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"from": {
"wallet": "main",
"id": "<string>"
},
"to": {
"wallet": "main",
"id": "<string>"
},
"symbol": "<string>",
"amount": "<string>",
"id": "<string>",
"time": "2023-11-07T05:31:56Z",
"type": 123
}
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}Spot balances and transfers
Create Spot transfer
Move funds on the same account between main and spot or margin and spot. Margin moves require collateral eligibility and sufficient withdrawable margin. The returned record is the destination-crediting leg; from.wallet may be main for a margin/spot move. No client idempotency key is supported. Reconcile balances and history after an uncertain result before retrying.
See the Spot API guide. Requires authentication; API-key scope: transfer.
POST
/
v1
/
spot
/
transfers
Create Spot transfer
curl --request POST \
--url https://api.ondoperps.xyz/v1/spot/transfers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"id": "<string>"
},
"to": {
"id": "<string>"
},
"symbol": "<string>",
"amount": "<string>"
}
'import requests
url = "https://api.ondoperps.xyz/v1/spot/transfers"
payload = {
"from": { "id": "<string>" },
"to": { "id": "<string>" },
"symbol": "<string>",
"amount": "<string>"
}
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({
from: {id: '<string>'},
to: {id: '<string>'},
symbol: '<string>',
amount: '<string>'
})
};
fetch('https://api.ondoperps.xyz/v1/spot/transfers', 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.ondoperps.xyz/v1/spot/transfers",
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([
'from' => [
'id' => '<string>'
],
'to' => [
'id' => '<string>'
],
'symbol' => '<string>',
'amount' => '<string>'
]),
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.ondoperps.xyz/v1/spot/transfers"
payload := strings.NewReader("{\n \"from\": {\n \"id\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\"\n },\n \"symbol\": \"<string>\",\n \"amount\": \"<string>\"\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.ondoperps.xyz/v1/spot/transfers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"id\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\"\n },\n \"symbol\": \"<string>\",\n \"amount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/spot/transfers")
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 \"from\": {\n \"id\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\"\n },\n \"symbol\": \"<string>\",\n \"amount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"from": {
"wallet": "main",
"id": "<string>"
},
"to": {
"wallet": "main",
"id": "<string>"
},
"symbol": "<string>",
"amount": "<string>",
"id": "<string>",
"time": "2023-11-07T05:31:56Z",
"type": 123
}
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json