private/transfer_spot_external
Submits a signed transfer of a single spot asset to a subaccount belonging to a different owner. Alongside the standard transfer fields (asset, sub_id, amount, nonce, signer, signature, expiry, max USD fee) you give the recipient’s wallet address and either an existing destination subaccount or 0 to create a new one under new_subaccount_manager; the max fee must cover both the transfer and any subaccount-creation cost. Requires a session key permitted to transfer to a different owner and returns the operation id and uuid.
curl --request POST \
--url https://api.derive.xyz/v3/private/transfer_spot_external \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"asset_name": "<string>",
"max_fee_usd": "<string>",
"new_subaccount_manager": 1,
"nonce": "<string>",
"recipient_address": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"sub_id": 1,
"subaccount_id": 1,
"to_subaccount_id": 1
}
'import requests
url = "https://api.derive.xyz/v3/private/transfer_spot_external"
payload = {
"amount": "<string>",
"asset_name": "<string>",
"max_fee_usd": "<string>",
"new_subaccount_manager": 1,
"nonce": "<string>",
"recipient_address": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"sub_id": 1,
"subaccount_id": 1,
"to_subaccount_id": 1
}
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({
amount: '<string>',
asset_name: '<string>',
max_fee_usd: '<string>',
new_subaccount_manager: 1,
nonce: '<string>',
recipient_address: '<string>',
signature: '<string>',
signature_expiry_sec: 1,
signer: '<string>',
sub_id: 1,
subaccount_id: 1,
to_subaccount_id: 1
})
};
fetch('https://api.derive.xyz/v3/private/transfer_spot_external', 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.derive.xyz/v3/private/transfer_spot_external",
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([
'amount' => '<string>',
'asset_name' => '<string>',
'max_fee_usd' => '<string>',
'new_subaccount_manager' => 1,
'nonce' => '<string>',
'recipient_address' => '<string>',
'signature' => '<string>',
'signature_expiry_sec' => 1,
'signer' => '<string>',
'sub_id' => 1,
'subaccount_id' => 1,
'to_subaccount_id' => 1
]),
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.derive.xyz/v3/private/transfer_spot_external"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"asset_name\": \"<string>\",\n \"max_fee_usd\": \"<string>\",\n \"new_subaccount_manager\": 1,\n \"nonce\": \"<string>\",\n \"recipient_address\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"sub_id\": 1,\n \"subaccount_id\": 1,\n \"to_subaccount_id\": 1\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.derive.xyz/v3/private/transfer_spot_external")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"asset_name\": \"<string>\",\n \"max_fee_usd\": \"<string>\",\n \"new_subaccount_manager\": 1,\n \"nonce\": \"<string>\",\n \"recipient_address\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"sub_id\": 1,\n \"subaccount_id\": 1,\n \"to_subaccount_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/transfer_spot_external")
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 \"amount\": \"<string>\",\n \"asset_name\": \"<string>\",\n \"max_fee_usd\": \"<string>\",\n \"new_subaccount_manager\": 1,\n \"nonce\": \"<string>\",\n \"recipient_address\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"sub_id\": 1,\n \"subaccount_id\": 1,\n \"to_subaccount_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"op_uuid": "<string>",
"operation_id": 1
}Body
Transfer amount in units of the asset, as a decimal string (e.g. "1.5") or JSON number.
Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. "1.5") or a JSON number. Must cover both the transfer fee and any subaccount-creation fee.
Manager id for the new subaccount when to_subaccount_id == 0.
x >= 0Owner of the destination account/subaccount.
x >= 0x >= 0x >= 0Recipient's existing destination subaccount. 0 → create a new subaccount for recipient_address under new_subaccount_manager.
x >= 0curl --request POST \
--url https://api.derive.xyz/v3/private/transfer_spot_external \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"asset_name": "<string>",
"max_fee_usd": "<string>",
"new_subaccount_manager": 1,
"nonce": "<string>",
"recipient_address": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"sub_id": 1,
"subaccount_id": 1,
"to_subaccount_id": 1
}
'import requests
url = "https://api.derive.xyz/v3/private/transfer_spot_external"
payload = {
"amount": "<string>",
"asset_name": "<string>",
"max_fee_usd": "<string>",
"new_subaccount_manager": 1,
"nonce": "<string>",
"recipient_address": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"sub_id": 1,
"subaccount_id": 1,
"to_subaccount_id": 1
}
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({
amount: '<string>',
asset_name: '<string>',
max_fee_usd: '<string>',
new_subaccount_manager: 1,
nonce: '<string>',
recipient_address: '<string>',
signature: '<string>',
signature_expiry_sec: 1,
signer: '<string>',
sub_id: 1,
subaccount_id: 1,
to_subaccount_id: 1
})
};
fetch('https://api.derive.xyz/v3/private/transfer_spot_external', 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.derive.xyz/v3/private/transfer_spot_external",
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([
'amount' => '<string>',
'asset_name' => '<string>',
'max_fee_usd' => '<string>',
'new_subaccount_manager' => 1,
'nonce' => '<string>',
'recipient_address' => '<string>',
'signature' => '<string>',
'signature_expiry_sec' => 1,
'signer' => '<string>',
'sub_id' => 1,
'subaccount_id' => 1,
'to_subaccount_id' => 1
]),
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.derive.xyz/v3/private/transfer_spot_external"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"asset_name\": \"<string>\",\n \"max_fee_usd\": \"<string>\",\n \"new_subaccount_manager\": 1,\n \"nonce\": \"<string>\",\n \"recipient_address\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"sub_id\": 1,\n \"subaccount_id\": 1,\n \"to_subaccount_id\": 1\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.derive.xyz/v3/private/transfer_spot_external")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"asset_name\": \"<string>\",\n \"max_fee_usd\": \"<string>\",\n \"new_subaccount_manager\": 1,\n \"nonce\": \"<string>\",\n \"recipient_address\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"sub_id\": 1,\n \"subaccount_id\": 1,\n \"to_subaccount_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/transfer_spot_external")
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 \"amount\": \"<string>\",\n \"asset_name\": \"<string>\",\n \"max_fee_usd\": \"<string>\",\n \"new_subaccount_manager\": 1,\n \"nonce\": \"<string>\",\n \"recipient_address\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"sub_id\": 1,\n \"subaccount_id\": 1,\n \"to_subaccount_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"op_uuid": "<string>",
"operation_id": 1
}