Hercle
WebSocket

Create Transfer

Initiates a transfer of funds to a payee address.

Create a new transfer transaction from an internal address to a payee address.

Auth:API Key
Tags:
Banking
Transfers
Command Name
TransferFunds

Command Arguments

ClientId
Required
Type:
string
Description:

Custom client ID for tracking (max 36 characters)

Example: "my-client-123"
Asset
Required
Type:
string
Description:

Asset to transfer

Example: "BTC"
Amount
Required
Type:
number
Description:

Transfer amount

Example: 0.001
InternalAddressId
Required
Type:
string
Description:

Source internal address ID

Example: "internal_addr_123"
PayeeAddressId
Required
Type:
string
Description:

Destination payee address ID

Example: "payee_addr_456"
Description
Required
Type:
string
Description:

Transfer description (max 250 characters)

Example: "Monthly payment to supplier"

Command Invocation

Command Arguments Example:
[
  "my-client-123",
  "BTC",
  0.001,
  "internal_addr_123",
  "payee_addr_456",
  "Monthly payment to supplier"
]
Invocation Example:
connection.invoke('TransferFunds', 'my-client-123', 'BTC', 0.001, 'internal_addr_123', 'payee_addr_456', 'Monthly payment to supplier')

Response Event

Event Name
executionEvents
Subject
banking.transfer.created
FieldTypeDescription
httpStatusCodenumberStatus code of the request (201: created successfully)
messagestringResponse message
idstringUnique identifier of the initiated transfer
assetstringAsset to transfer (e.g., BTC, ETH)
amountnumberAmount of asset to transfer
internalAddressIdstringSource address ID
payeeAddressIdstringDestination payee address ID
descriptionstringDescription of the transfer

Example Response

{
  "data": {
    "httpStatusCode": 201,
    "message": "Transfer fund request registered successfully",
    "id": "id_123456",
    "asset": "BTC",
    "amount": 0.001,
    "internalAddressId": "internal_addr_123",
    "payeeAddressId": "payee_addr_456",
    "description": "Monthly payment to supplier"
  }
}

Validation Rules

Important Requirements

FieldTypeDescription
DescriptionstringRequired field and must not exceed 250 characters
AssetstringMust exist in the configured networks and be supported for transfers
AmountnumberMust be a positive number greater than zero
Address IDsstringBoth InternalAddressId and PayeeAddressId must be valid and active

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('TransferFunds', "my-client-123", "BTC", 0.001, "internal_addr_123", "payee_addr_456", "Monthly payment to supplier")
      .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

Event Log

No events yet. Connect and invoke a command to see events.