Reserve funds and return a signed withdrawal authorization bundle
POST
/
withdrawals
Reserve funds and return a signed withdrawal authorization bundle
curl --request POST \
--url https://joyride.exchange/api/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"account_id": 1,
"destination_token_account": "<string>",
"amount": "100.00000000"
}
'import requests
url = "https://joyride.exchange/api/withdrawals"
payload = {
"account_id": 1,
"destination_token_account": "<string>",
"amount": "100.00000000"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({account_id: 1, destination_token_account: '<string>', amount: '100.00000000'})
};
fetch('https://joyride.exchange/api/withdrawals', 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://joyride.exchange/api/withdrawals",
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([
'account_id' => 1,
'destination_token_account' => '<string>',
'amount' => '100.00000000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://joyride.exchange/api/withdrawals"
payload := strings.NewReader("{\n \"account_id\": 1,\n \"destination_token_account\": \"<string>\",\n \"amount\": \"100.00000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://joyride.exchange/api/withdrawals")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": 1,\n \"destination_token_account\": \"<string>\",\n \"amount\": \"100.00000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://joyride.exchange/api/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": 1,\n \"destination_token_account\": \"<string>\",\n \"amount\": \"100.00000000\"\n}"
response = http.request(request)
puts response.read_body{
"withdrawal_id": "<string>",
"account_id": 123,
"raw_amount": "<string>",
"amount": "100.00000000",
"user_wallet": "<string>",
"destination_token_account": "<string>",
"mint": "<string>",
"issued_at_unix_timestamp": 123,
"expiry_unix_timestamp": 123,
"authorization_message_b64": "<string>",
"authorization_signature_b64": "<string>",
"withdraw_authority": "<string>",
"kms_key_id": "<string>"
}{
"ok": false,
"error": "<string>"
}{
"ok": false,
"error": "<string>"
}{
"ok": false,
"error": "<string>"
}{
"ok": false,
"error": "<string>"
}Authorizations
SIWS-issued JWT. Admin commands require the admin role, admin:*, or the exact admin:<type> scope; admin reads use their documented read scope.
Headers
Body
application/json
Response
Signed authorization bundle
Pattern:
^-?[0-9]+(\.[0-9]{1,8})?$Example:
"100.00000000"
Reserve funds and return a signed withdrawal authorization bundle
curl --request POST \
--url https://joyride.exchange/api/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"account_id": 1,
"destination_token_account": "<string>",
"amount": "100.00000000"
}
'import requests
url = "https://joyride.exchange/api/withdrawals"
payload = {
"account_id": 1,
"destination_token_account": "<string>",
"amount": "100.00000000"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({account_id: 1, destination_token_account: '<string>', amount: '100.00000000'})
};
fetch('https://joyride.exchange/api/withdrawals', 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://joyride.exchange/api/withdrawals",
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([
'account_id' => 1,
'destination_token_account' => '<string>',
'amount' => '100.00000000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://joyride.exchange/api/withdrawals"
payload := strings.NewReader("{\n \"account_id\": 1,\n \"destination_token_account\": \"<string>\",\n \"amount\": \"100.00000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://joyride.exchange/api/withdrawals")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": 1,\n \"destination_token_account\": \"<string>\",\n \"amount\": \"100.00000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://joyride.exchange/api/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": 1,\n \"destination_token_account\": \"<string>\",\n \"amount\": \"100.00000000\"\n}"
response = http.request(request)
puts response.read_body{
"withdrawal_id": "<string>",
"account_id": 123,
"raw_amount": "<string>",
"amount": "100.00000000",
"user_wallet": "<string>",
"destination_token_account": "<string>",
"mint": "<string>",
"issued_at_unix_timestamp": 123,
"expiry_unix_timestamp": 123,
"authorization_message_b64": "<string>",
"authorization_signature_b64": "<string>",
"withdraw_authority": "<string>",
"kms_key_id": "<string>"
}{
"ok": false,
"error": "<string>"
}{
"ok": false,
"error": "<string>"
}{
"ok": false,
"error": "<string>"
}{
"ok": false,
"error": "<string>"
}