WebSocket
Create Instant Withdrawal
Sends an instant withdrawal request.
Auth:API Key
Tags:
Funding
Withdrawals
Command Name
WithdrawInstantFundsCommand Arguments
| Field | Type | Required | Description |
|---|---|---|---|
ClientId | string | Required | Custom client ID for tracking (max 36 characters) Example: "my-client-123" |
Asset | string | Required | Asset of the address (e.g.: "BTC" or "EUR") Example: "USDT" |
Amount | number | Required | Quantity of asset to be withdrawn Example: 100 |
DestinationAddress | string | Required | Destination address, must be whitelisted Example: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" |
Network | string | Required | Network of the address Example: "Ethereum" |
ClientIdRequired
Type:
string
Description:
Custom client ID for tracking (max 36 characters)
Example:
"my-client-123"AssetRequired
Type:
string
Description:
Asset of the address (e.g.: "BTC" or "EUR")
Example:
"USDT"AmountRequired
Type:
number
Description:
Quantity of asset to be withdrawn
Example:
100DestinationAddressRequired
Type:
string
Description:
Destination address, must be whitelisted
Example:
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"NetworkRequired
Type:
string
Description:
Network of the address
Example:
"Ethereum"Command Invocation
Command Arguments Example:
[
"my-client-123",
"USDT",
100,
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"Ethereum"
]Invocation Example:
connection.invoke('WithdrawInstantFunds', 'my-client-123', 'USDT', 100.0, '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', 'Ethereum')Response Event
Event Name
executionEventsSubject
account.withdraw.createdInstant withdrawal request created successfully
| Field | Type | Description |
|---|---|---|
id | string | Withdraw ID |
clientId | string | Client ID |
userId | string | User ID |
name | string | User first name |
surname | string | User last name |
company | string | Company name |
description | string | Description |
destination | string | Destination address |
destinationParams | object | Destination parameters |
network | string | Destination address network |
amount | number | Amount to be withdrawn |
asset | string | Asset name |
fee | number | Fee |
status | string | Withdrawal status CREATED→ CreatedCONFIRMING→ ConfirmingCONFIRMED→ Confirmed |
refId | string | Cro or Trx Id added after network submission |
isInstant | boolean | Option for instant withdraw (always true for this command) |
timestamp | string | Timestamp of the withdraw |
Example Response
{
"data": {
"id": "xxxx",
"clientId": "68925acb-4f03-48ab-98a9-16b845f21017",
"userId": "yyyy",
"name": "Marco",
"surname": "Rossi",
"company": "",
"description": "xyz",
"destination": "xyzwallet",
"destinationParams": {},
"network": "ethereum",
"amount": 1,
"asset": "USDT",
"fee": 5,
"status": "CONFIRMING",
"refId": "ab1234",
"isInstant": true,
"timestamp": "2024-03-27T16:03:12.456Z"
}
}Code Examples
const signalR = require('@microsoft/signalr');
const apiKey = 'YOUR_API_KEY_HERE';
const connection = new signalR.HubConnectionBuilder()
.withUrl('https://publicapi.sandbox.hercle.financial/ExecutionLiveServer/v1', {
accessTokenFactory: () => apiKey,
})
.build();
connection.start()
.then(() => {
console.log('Connected to WebSocket');
// Invoke command
connection.invoke('WithdrawInstantFunds', "my-client-123", "USDT", 100, "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "Ethereum")
.then(() => {
console.log('Command sent successfully');
})
.catch(err => {
console.error('Command failed:', err);
});
})
.catch(err => {
console.error('Connection failed:', err);
});
// Listen for events
connection.on('executionEvents', (data) => {
console.log('Received event:', data);
});SignalR API Tester
Test this command in the sandbox environment
Disconnected
Your API key is only used locally and never stored