Skip to content

На этой странице

Withdraws API ​

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.

Overview ​

The withdraws API allows you to:

  • Initiate cryptocurrency withdrawals
  • Manage withdrawal requests (admin only)
  • Handle multisig withdrawal operations
POST

Initiate Withdrawal

POST /v1/withdraws

Initiates a cryptocurrency withdrawal to a specified address.

Параметры

ПараметрТипОбязательныйОписание
networkstringДаNetwork slug (e.g., bitcoin, ethereum, tron)
coinstringДаCoin slug (e.g., btc, eth, usdt)
addressstringДаDestination address
amountstringДаAmount to withdraw

Ответы

201 Created

Withdrawal initiated successfully

GET

Get Withdrawal Requests

GET /v1/withdraws/requests

Returns list of pending withdrawal requests. Admin access only.

Параметры

ПараметрТипОбязательныйОписание
pagenumberНетPage number for pagination
limitnumberНетNumber of items per page

Ответы

200 OK

Withdrawal requests retrieved

API Configuration

Initiate Withdrawal ​

bash
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"
  }'

Go HTTP Client ​

go
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)
}

JavaScript Fetch ​

javascript
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();

Python Requests ​

python
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 cURL ​

php
<?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";
}
?>

Released under the MIT License.