curl --request GET \
--url https://test.deribit.com/api/v2/private/withdraw \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 6931,
"method": "private/withdraw",
"params": {
"currency": "BTC",
"address": "2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz",
"amount": 0.4,
"priority": "mid"
}
}
'import requests
url = "https://test.deribit.com/api/v2/private/withdraw"
payload = {
"jsonrpc": "2.0",
"id": 6931,
"method": "private/withdraw",
"params": {
"currency": "BTC",
"address": "2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz",
"amount": 0.4,
"priority": "mid"
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 6931,
method: 'private/withdraw',
params: {
currency: 'BTC',
address: '2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz',
amount: 0.4,
priority: 'mid'
}
})
};
fetch('https://test.deribit.com/api/v2/private/withdraw', 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://test.deribit.com/api/v2/private/withdraw",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 6931,
'method' => 'private/withdraw',
'params' => [
'currency' => 'BTC',
'address' => '2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz',
'amount' => 0.4,
'priority' => 'mid'
]
]),
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://test.deribit.com/api/v2/private/withdraw"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 6931,\n \"method\": \"private/withdraw\",\n \"params\": {\n \"currency\": \"BTC\",\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n \"amount\": 0.4,\n \"priority\": \"mid\"\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://test.deribit.com/api/v2/private/withdraw")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 6931,\n \"method\": \"private/withdraw\",\n \"params\": {\n \"currency\": \"BTC\",\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n \"amount\": 0.4,\n \"priority\": \"mid\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/private/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 6931,\n \"method\": \"private/withdraw\",\n \"params\": {\n \"currency\": \"BTC\",\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n \"amount\": 0.4,\n \"priority\": \"mid\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 6931,
"result": {
"address": "2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz",
"amount": 0.4,
"confirmed_timestamp": null,
"created_timestamp": 1550574558607,
"currency": "BTC",
"fee": 0.0001,
"id": 4,
"priority": 1,
"state": "unconfirmed",
"transaction_id": null,
"updated_timestamp": 1550574558607
}
}private/withdraw
Creates a new withdrawal request. This method allows you to withdraw funds from your account to an external address. The withdrawal can be configured with priority settings and must use an address from your address book.
Withdrawal Checks & Balance Updates
Withdrawal funds are checked twice: when a user requests a withdrawal and again when they confirm it via the email link. If available funds decrease between these steps, the withdrawal may be rejected.
A withdrawal may also be rejected if the on-chain fee increases between the request and confirmation.
The withdrawal amount is deducted only after all checks pass and the transaction is scheduled. The web-interface Withdrawal tab displays all withdrawals regardless of their status (pending, cancelled, rejected, or completed).
Coinbase wallet type
For Coinbase wallet type accounts the method supports network selection and CTN (Coinbase Travel Network) counterparties, and behaves differently:
- Required parameters are
currency(any portfolio currency) andamount, plus one ofaddressorid(the address book entry identifier returned byprivate/get_address_book). - When
addressis an on-chain address, passnetwork(andtagwhen applicable) to identify the address book entry. For a CTN withdrawal, pass the CTN counterparty identifier of the entry asaddress. priorityandnonceare not supported. Useprivate/coinbase/estimate_withdrawal_feeto estimate the network fee.- Subaccounts can withdraw only when enabled by the main account via
private/set_coinbase_subaccount_withdrawals_allowed. - The response is a Coinbase withdrawal object instead of the legacy withdrawal object. Its
stateis one ofprepared,awaiting_second_email,unconfirmed,completedorcancelled; withdrawals to an address that is not trusted start aspreparedand require email confirmation, in which casetransfer_idemis absent until the withdrawal is submitted to the custodian. Fields that are not set are omitted from the response.
๐ Related Article: Managing Withdrawals
Scope: wallet:read_write and mainaccount
curl --request GET \
--url https://test.deribit.com/api/v2/private/withdraw \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 6931,
"method": "private/withdraw",
"params": {
"currency": "BTC",
"address": "2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz",
"amount": 0.4,
"priority": "mid"
}
}
'import requests
url = "https://test.deribit.com/api/v2/private/withdraw"
payload = {
"jsonrpc": "2.0",
"id": 6931,
"method": "private/withdraw",
"params": {
"currency": "BTC",
"address": "2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz",
"amount": 0.4,
"priority": "mid"
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 6931,
method: 'private/withdraw',
params: {
currency: 'BTC',
address: '2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz',
amount: 0.4,
priority: 'mid'
}
})
};
fetch('https://test.deribit.com/api/v2/private/withdraw', 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://test.deribit.com/api/v2/private/withdraw",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 6931,
'method' => 'private/withdraw',
'params' => [
'currency' => 'BTC',
'address' => '2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz',
'amount' => 0.4,
'priority' => 'mid'
]
]),
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://test.deribit.com/api/v2/private/withdraw"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 6931,\n \"method\": \"private/withdraw\",\n \"params\": {\n \"currency\": \"BTC\",\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n \"amount\": 0.4,\n \"priority\": \"mid\"\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://test.deribit.com/api/v2/private/withdraw")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 6931,\n \"method\": \"private/withdraw\",\n \"params\": {\n \"currency\": \"BTC\",\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n \"amount\": 0.4,\n \"priority\": \"mid\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/private/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 6931,\n \"method\": \"private/withdraw\",\n \"params\": {\n \"currency\": \"BTC\",\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n \"amount\": 0.4,\n \"priority\": \"mid\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 6931,
"result": {
"address": "2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz",
"amount": 0.4,
"confirmed_timestamp": null,
"created_timestamp": 1550574558607,
"currency": "BTC",
"fee": 0.0001,
"id": 4,
"priority": 1,
"state": "unconfirmed",
"transaction_id": null,
"updated_timestamp": 1550574558607
}
}Query Parameters
The currency symbol.
๐ Related Article: Using the currency Parameter
Currency, i.e "BTC", "ETH", "USDC"
BTC, ETH, USDC, USDT, EURR Address in currency format, it must be in address book. Required for legacy wallet type. Coinbase wallet type: required when id is not provided โ the on-chain address (use network and tag to disambiguate entries sharing the same address) or the CTN counterparty identifier of an existing address book entry.
Address in proper format for currency
"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz"
Amount of funds to be withdrawn
Blockchain network resource name (e.g. networks/ethereum-mainnet), for Coinbase wallet types. Available networks are returned by public/get_currencies in coinbase_networks. Requiredness depends on the operation. When resolving an existing address-book entry, it is optional if the entry resolves uniquely; it disambiguates an address present on multiple networks.
"networks/ethereum-mainnet"
Destination tag / memo for networks that support one. Coinbase wallet type only. Used together with address and network; also serves to disambiguate address book entries that share the same address.
Unique identifier (UUID7) of the address book entry, as returned in the id field of private/get_address_book results. Coinbase wallet type only. Can be used instead of address (with network and tag) to identify the entry.
"0190a1b2-7c3d-7e5f-8a9b-0c1d2e3f4a5b"
Withdrawal priority, default: high. Note: fee priority levels are only configured for BTC; other currencies default to standard ratio 1.0.
insane, extreme_high, very_high, high, normal, mid, low, very_low Optional idempotency nonce. If provided, subsequent requests with the same nonce will return the previously created transaction instead of creating a new one. Must be 8-128 characters. The nonce is persisted on the resulting transaction and returned in the response. Nonce
"bF1_gfgcsd"
Response
Success response
The JSON-RPC version (2.0)
2.0 - Option 1
- Option 2
Hide child attributes
Hide child attributes
Address in proper format for currency
"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
Amount of funds in given currency
1
Currency, i.e "BTC", "ETH", "USDC"
BTC, ETH, USDC, USDT, EURR Withdrawal state, allowed values : unconfirmed, confirmed, cancelled, completed, interrupted, rejected
unconfirmed, confirmed, cancelled, completed, interrupted, rejected Transaction id in proper format for currency, null if id is not available
"1b1fb5568515e2b79503501e3d3680b2d0838d5dfc2d15a04eb8cd9fbbe0b572"
The timestamp (milliseconds since the Unix epoch)
1536569522277
The timestamp (milliseconds since the Unix epoch) of withdrawal confirmation, null when not confirmed
1536569522277
The timestamp (milliseconds since the Unix epoch)
1536569522277
Fee in currency
0.000023
Withdrawal id in Deribit system
1
Id of priority level
1
Optional idempotency nonce if provided in the request
Withdrawal note.
Number of completed withdrawals to this address.
Execution timestamp in milliseconds since the Unix epoch; present only when set and state is confirmed.
Clearance state indicating the current status of the transaction clearance process. Allowed values:
in_progress: clearance process is in progresspending_admin_decision: transaction is under manual review by Deribit adminpending_user_input: user should provide additional information regarding the transactionsuccess: clearance process completed successfullyfailed: clearance process failed, transaction is rejectedcancelled: transaction is cancelled (currently used only for withdrawals, meaning the withdrawal is cancelled)refund_initiated: clearance process failed, transaction refund is initiated, funds are removed from Deribit balance (valid for deposits only)refunded: clearance process failed, deposit amount is refunded back to the client (valid for deposits only)in_progress, pending_admin_decision, pending_user_input, success, failed, cancelled, refund_initiated, refunded The id that was sent in the request
Was this page helpful?