The coins API provides functionality for managing cryptocurrency coins and tokens across different blockchain networks.
Interactive Testing
On this page you can test the API in real time! Enter your API key in the field below and click the "Test" buttons to send requests to the server https://cp-merch-dev.wsdemo.online/api
.
If you encounter CORS errors:
The coins API allows you to:
Creates a new coin or token. Admin access only.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
coin | string | Нет | Unique coin identifier (auto-generated if not provided) |
name | string | Нет | Coin or token name (auto-detected from contract if not provided) |
contractAddress | string | Нет | Token contract address (for tokens only) |
network | string | Да | Network slug (e.g., ethereum, bitcoin, tron) |
useUsdLimits | boolean | Нет | Use USD limits for settlements and transactions |
collectThreshold | number | Нет | Minimum amount for transfer to service wallet |
collectServiceToColdThreshold | number | Нет | Minimum amount for transfer from service to cold wallet |
collectPercentageHot | number | Нет | Percentage of coins collected on hot wallet |
approveThreshold | number | Нет | Confidence volume for transfers to service wallet |
minValue | number | Нет | Minimum possible amount for one-time withdrawal |
maxValue | number | Нет | Maximum possible amount for one-time withdrawal |
maxValueDaily | number | Нет | Maximum possible withdrawal in 24 hours |
minDepositAmount | number | Нет | Minimum amount for deposit |
Coin created successfully
Invalid parameters
Precreates a token by analyzing its contract address. Admin access only.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
contractAddress | string | Да | Token contract address |
network | string | Да | Network slug (e.g., ethereum, bsc, polygon) |
Token precreated successfully
Invalid contract address or network
Edits coin or token settings and status. Can be used to activate/deactivate coins. Admin access only.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
coin | string | Да | Unique coin identifier |
name | string | Нет | Coin or token name |
status | string | Нет | Coin status (ACTIVE, INACTIVE) |
useUsdLimits | boolean | Нет | Use USD limits for settlements and transactions |
collectThreshold | number | Нет | Minimum amount for transfer to service wallet |
collectServiceToColdThreshold | number | Нет | Minimum amount for transfer from service to cold wallet |
collectPercentageHot | number | Нет | Percentage of coins collected on hot wallet |
approveThreshold | number | Нет | Confidence volume for transfers to service wallet |
minValue | number | Нет | Minimum possible amount for one-time withdrawal |
maxValue | number | Нет | Maximum possible amount for one-time withdrawal |
maxValueDaily | number | Нет | Maximum possible withdrawal in 24 hours |
minDepositAmount | number | Нет | Minimum amount for deposit |
Coin updated successfully
Invalid parameters
Returns list of all available coins and tokens.
Coins list retrieved
Returns information about a specific coin or token.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
coin | string | Да | Coin slug (e.g., btc, eth, usdt) |
Coin information retrieved
Invalid coin slug
curl -X POST "https://cp-merch-dev.wsdemo.online/api/v1/coins" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"network": "ethereum",
"name": "My Token",
"contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"collectThreshold": 0.001,
"minValue": 0.0001,
"maxValue": 1000
}'
Response:
{
"message": "Coin created successfully"
}
curl -X PUT "https://cp-merch-dev.wsdemo.online/api/v1/coins/precreate-token" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"network": "ethereum"
}'
Response:
{
"coin": "usdt_erc20",
"symbol": "USDT",
"name": "Tether USD",
"decimals": 6
}
curl -X GET "https://cp-merch-dev.wsdemo.online/api/v1/coins" \
-H "X-Api-Key: YOUR_API_KEY"
Response:
[
{
"coin": "btc",
"name": "Bitcoin",
"type": "NATIVE",
"decimals": 8,
"contractAddress": null,
"status": "ACTIVE",
"settings": {
"useUsdLimits": true,
"collectThreshold": 0.001,
"collectServiceToColdThreshold": 1,
"collectPercentageHot": 10,
"approveThreshold": 1000000,
"minValue": 0.0001,
"maxValue": 10,
"maxValueDaily": 100,
"minDepositAmount": 0.0001
},
"network": {
"network": "bitcoin"
}
},
{
"coin": "eth",
"name": "Ethereum",
"type": "NATIVE",
"decimals": 18,
"contractAddress": null,
"status": "ACTIVE",
"settings": {
"useUsdLimits": false,
"collectThreshold": 0.01,
"collectServiceToColdThreshold": 10,
"collectPercentageHot": 15,
"approveThreshold": 1000000,
"minValue": 0.001,
"maxValue": 100,
"maxValueDaily": 1000,
"minDepositAmount": 0.001
},
"network": {
"network": "ethereum"
}
}
]
curl -X GET "https://cp-merch-dev.wsdemo.online/api/v1/coins/btc" \
-H "X-Api-Key: YOUR_API_KEY"
Response:
{
"coin": "btc",
"name": "Bitcoin",
"type": "NATIVE",
"decimals": 8,
"contractAddress": null,
"status": "ACTIVE",
"settings": {
"useUsdLimits": true,
"collectThreshold": 0.001,
"collectServiceToColdThreshold": 1,
"collectPercentageHot": 10,
"approveThreshold": 1000000,
"minValue": 0.0001,
"maxValue": 10,
"maxValueDaily": 100,
"minDepositAmount": 0.0001,
"collectThresholdUSD": 50,
"collectServiceToColdThresholdUSD": 50000,
"approveThresholdUSD": 1000000,
"minValueUSD": 5,
"maxValueUSD": 500000,
"maxValueDailyUSD": 5000000,
"minDepositAmountUSD": 5
},
"network": {
"network": "bitcoin"
}
}
curl -X PUT "https://cp-merch-dev.wsdemo.online/api/v1/coins" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"coin": "btc",
"status": "ACTIVE",
"minValue": 0.0001,
"maxValue": 10,
"collectThreshold": 0.001
}'
Response:
{
"message": "Coin updated successfully"
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
// Create coin
payload := map[string]interface{}{
"network": "ethereum",
"name": "My Token",
"contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"collectThreshold": 0.001,
"minValue": 0.0001,
"maxValue": 1000,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://cp-merch-dev.wsdemo.online/api/v1/coins", 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)
// Get coins list
req2, _ := http.NewRequest("GET", "https://cp-merch-dev.wsdemo.online/api/v1/coins", nil)
req2.Header.Set("X-Api-Key", "YOUR_API_KEY")
resp2, err := client.Do(req2)
if err != nil {
panic(err)
}
defer resp2.Body.Close()
body2, _ := io.ReadAll(resp2.Body)
fmt.Printf("Coins list: %s\n", body2)
}
// Create coin
const createCoin = async () => {
const response = await fetch('https://cp-merch-dev.wsdemo.online/api/v1/coins', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
network: 'ethereum',
name: 'My Token',
contractAddress: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
collectThreshold: 0.001,
minValue: 0.0001,
maxValue: 1000
})
});
const result = await response.json();
console.log('Created coin:', result);
// Get coins list
const coinsResponse = await fetch('https://cp-merch-dev.wsdemo.online/api/v1/coins', {
headers: {
'X-Api-Key': 'YOUR_API_KEY'
}
});
const coins = await coinsResponse.json();
console.log('Coins list:', coins);
// Get specific coin
const coinResponse = await fetch('https://cp-merch-dev.wsdemo.online/api/v1/coins/btc', {
headers: {
'X-Api-Key': 'YOUR_API_KEY'
}
});
const coin = await coinResponse.json();
console.log('Bitcoin info:', coin);
// Edit coin
const editResponse = await fetch('https://cp-merch-dev.wsdemo.online/api/v1/coins', {
method: 'PUT',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
coin: 'btc',
status: 'ACTIVE',
minValue: 0.0001
})
});
const editResult = await editResponse.json();
console.log('Edit result:', editResult);
};
createCoin();
import requests
import json
# API configuration
API_BASE = 'https://cp-merch-dev.wsdemo.online/api/v1'
headers = {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
# Create coin
payload = {
'network': 'ethereum',
'name': 'My Token',
'contractAddress': '0xdAC17F958D2ee523a2206206994597C13D831ec7',
'collectThreshold': 0.001,
'minValue': 0.0001,
'maxValue': 1000
}
response = requests.post(f'{API_BASE}/coins',
headers=headers,
json=payload)
if response.status_code == 201:
result = response.json()
print(f"Created coin: {result['message']}")
# Get coins list
coins_response = requests.get(f'{API_BASE}/coins', headers=headers)
if coins_response.status_code == 200:
coins = coins_response.json()
print(f"Found {len(coins)} coins")
# Get specific coin
coin_response = requests.get(f'{API_BASE}/coins/btc', headers=headers)
if coin_response.status_code == 200:
coin = coin_response.json()
print(f"Bitcoin: {coin['name']}, Status: {coin['status']}")
# Edit coin
edit_payload = {
'coin': 'btc',
'status': 'ACTIVE',
'minValue': 0.0001
}
edit_response = requests.put(f'{API_BASE}/coins',
headers=headers,
json=edit_payload)
if edit_response.status_code == 200:
edit_result = edit_response.json()
print(f"Edit result: {edit_result['message']}")
else:
print(f"Error: {response.status_code}")
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://cp-merch-dev.wsdemo.online/api/v1';
// Create coin
$payload = json_encode([
'network' => 'ethereum',
'name' => 'My Token',
'contractAddress' => '0xdAC17F958D2ee523a2206206994597C13D831ec7',
'collectThreshold' => 0.001,
'minValue' => 0.0001,
'maxValue' => 1000
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $baseUrl . '/coins');
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) {
$result = json_decode($response, true);
echo "Created coin: " . $result['message'] . "\n";
// Get coins list
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, $baseUrl . '/coins');
curl_setopt($ch2, CURLOPT_HTTPHEADER, [
'X-Api-Key: ' . $apiKey
]);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
$coinsResponse = curl_exec($ch2);
$coinsHttpCode = curl_getinfo($ch2, CURLINFO_HTTP_CODE);
curl_close($ch2);
if ($coinsHttpCode === 200) {
$coins = json_decode($coinsResponse, true);
echo "Found " . count($coins) . " coins\n";
// Get specific coin
$ch3 = curl_init();
curl_setopt($ch3, CURLOPT_URL, $baseUrl . '/coins/btc');
curl_setopt($ch3, CURLOPT_HTTPHEADER, [
'X-Api-Key: ' . $apiKey
]);
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, true);
$coinResponse = curl_exec($ch3);
$coinHttpCode = curl_getinfo($ch3, CURLINFO_HTTP_CODE);
curl_close($ch3);
if ($coinHttpCode === 200) {
$coin = json_decode($coinResponse, true);
echo "Bitcoin: " . $coin['name'] . ", Status: " . $coin['status'] . "\n";
}
}
} else {
echo "Error: " . $httpCode . "\n";
}
?>