Execute an exchange withdrawal
curl --request POST \
--url https://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw \
--header 'Content-Type: application/json' \
--header 'x-calm-publishable-key: <api-key>' \
--data '
{
"quote_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wallet": "<string>",
"twofa": "<string>"
}
'import requests
url = "https://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw"
payload = {
"quote_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wallet": "<string>",
"twofa": "<string>"
}
headers = {
"x-calm-publishable-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-calm-publishable-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quote_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
wallet: '<string>',
twofa: '<string>'
})
};
fetch('https://api.calmtreasury.xyz/v1/exchange/{exchange}/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://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw",
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([
'quote_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'wallet' => '<string>',
'twofa' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-calm-publishable-key: <api-key>"
],
]);
$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.calmtreasury.xyz/v1/exchange/{exchange}/withdraw"
payload := strings.NewReader("{\n \"quote_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"wallet\": \"<string>\",\n \"twofa\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-calm-publishable-key", "<api-key>")
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.calmtreasury.xyz/v1/exchange/{exchange}/withdraw")
.header("x-calm-publishable-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quote_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"wallet\": \"<string>\",\n \"twofa\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-calm-publishable-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quote_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"wallet\": \"<string>\",\n \"twofa\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"error_code": "<string>",
"error_message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"amount": "<string>",
"network": "<string>",
"token": "<string>"
},
"status": "quoted",
"transaction_hash": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Exchange
Execute an exchange withdrawal
Execute a quoted withdrawal.
POST
/
v1
/
exchange
/
{exchange}
/
withdraw
Execute an exchange withdrawal
curl --request POST \
--url https://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw \
--header 'Content-Type: application/json' \
--header 'x-calm-publishable-key: <api-key>' \
--data '
{
"quote_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wallet": "<string>",
"twofa": "<string>"
}
'import requests
url = "https://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw"
payload = {
"quote_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wallet": "<string>",
"twofa": "<string>"
}
headers = {
"x-calm-publishable-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-calm-publishable-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quote_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
wallet: '<string>',
twofa: '<string>'
})
};
fetch('https://api.calmtreasury.xyz/v1/exchange/{exchange}/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://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw",
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([
'quote_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'wallet' => '<string>',
'twofa' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-calm-publishable-key: <api-key>"
],
]);
$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.calmtreasury.xyz/v1/exchange/{exchange}/withdraw"
payload := strings.NewReader("{\n \"quote_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"wallet\": \"<string>\",\n \"twofa\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-calm-publishable-key", "<api-key>")
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.calmtreasury.xyz/v1/exchange/{exchange}/withdraw")
.header("x-calm-publishable-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quote_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"wallet\": \"<string>\",\n \"twofa\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.calmtreasury.xyz/v1/exchange/{exchange}/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-calm-publishable-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quote_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"wallet\": \"<string>\",\n \"twofa\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"error_code": "<string>",
"error_message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"amount": "<string>",
"network": "<string>",
"token": "<string>"
},
"status": "quoted",
"transaction_hash": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Executes a quoted withdrawal. A
{ requires_2fa: true } response is not an
error — collect the code from the user and re-submit the same quote with
twofa.Authorizations
Publishable key identifying the calling app.
Path Parameters
Available options:
coinbase Body
application/json
Response
The withdrawal, or a 2FA challenge.
- Option 1
- Option 2
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Show child attributes
Show child attributes
Available options:
quoted, pending, broadcasted, failed, delayed