The withdraws API provides functionality for initiating cryptocurrency withdrawals and managing withdrawal requests.
Interactive Testing
Test the API in real time! Enter your API key and click "Test" buttons to send requests to https://cp-merch-dev.wsdemo.online/api
.
The withdraws API allows you to:
Initiates a cryptocurrency withdrawal to a specified address.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
network | string | Да | Network slug (e.g., bitcoin, ethereum, tron) |
coin | string | Да | Coin slug (e.g., btc, eth, usdt) |
address | string | Да | Destination address |
amount | string | Да | Amount to withdraw |
Withdrawal initiated successfully
Returns list of pending withdrawal requests. Admin access only.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
page | number | Нет | Page number for pagination |
limit | number | Нет | Number of items per page |
Withdrawal requests retrieved
curl -X POST "https://cp-merch-dev.wsdemo.online/api/v1/withdraws" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"network": "ethereum",
"coin": "usdt",
"address": "0x742d35Cc6634C0532925a3b8D4C9db96590c6C87",
"amount": "100.00"
}'
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]string{
"network": "ethereum",
"coin": "usdt",
"address": "0x742d35Cc6634C0532925a3b8D4C9db96590c6C87",
"amount": "100.00",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://cp-merch-dev.wsdemo.online/api/v1/withdraws", bytes.NewBuffer(jsonData))
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Printf("Response: %s\n", body)
}
const initiateWithdrawal = async () => {
const response = await fetch('https://cp-merch-dev.wsdemo.online/api/v1/withdraws', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
network: 'ethereum',
coin: 'usdt',
address: '0x742d35Cc6634C0532925a3b8D4C9db96590c6C87',
amount: '100.00'
})
});
const withdrawal = await response.json();
console.log('Withdrawal initiated:', withdrawal);
};
initiateWithdrawal();
import requests
import json
headers = {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
payload = {
'network': 'ethereum',
'coin': 'usdt',
'address': '0x742d35Cc6634C0532925a3b8D4C9db96590c6C87',
'amount': '100.00'
}
response = requests.post('https://cp-merch-dev.wsdemo.online/api/v1/withdraws',
headers=headers,
json=payload)
if response.status_code == 201:
withdrawal = response.json()
print(f"Withdrawal initiated: {withdrawal['id']}")
else:
print(f"Error: {response.status_code}")
<?php
$apiKey = 'YOUR_API_KEY';
$payload = json_encode([
'network' => 'ethereum',
'coin' => 'usdt',
'address' => '0x742d35Cc6634C0532925a3b8D4C9db96590c6C87',
'amount' => '100.00'
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://cp-merch-dev.wsdemo.online/api/v1/withdraws');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-Api-Key: ' . $apiKey,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 201) {
$withdrawal = json_decode($response, true);
echo "Withdrawal initiated: " . $withdrawal['id'] . "\n";
}
?>