WebSocket
Get Orders Paginated
Retrieves a paginated list of orders within a 7 days range.
Auth:API Key
Tags:
Trading
Command Name
GetOrdersPaginatedCommand Arguments
| Field | Type | Required | Description |
|---|---|---|---|
ClientId | string | Required | Custom client ID for tracking (max 36 characters) Example: "my-order-123" |
StartDate | string | Required | Start date for the orders retrieval (ISO 8601 format) Example: "2024-04-20T00:00:00Z" |
EndDate | string | Required | End date for the orders retrieval (ISO 8601 format) Example: "2024-04-27T00:00:00Z" |
Page | number | Required | Page number for pagination (starting from 0)0 |
PageSize | number | Required | Number of orders per page for pagination (min: 5, max: 50) Example: 5 |
ClientIdRequired
Type:
string
Description:
Custom client ID for tracking (max 36 characters)
Example:
"my-order-123"StartDateRequired
Type:
string
Description:
Start date for the orders retrieval (ISO 8601 format)
Example:
"2024-04-20T00:00:00Z"EndDateRequired
Type:
string
Description:
End date for the orders retrieval (ISO 8601 format)
Example:
"2024-04-27T00:00:00Z"PageRequired
Type:
number
Description:
Page number for pagination (starting from 0)
0PageSizeRequired
Type:
number
Description:
Number of orders per page for pagination (min: 5, max: 50)
Example:
5Command Invocation
Command Arguments Example:
[
"my-client-123",
"2024-04-20T00:00:00Z",
"2024-04-27T00:00:00Z",
0,
5
]Invocation Example:
connection.invoke('GetOrdersPaginated', 'my-client-123', '2024-04-20T00:00:00Z', '2024-04-27T00:00:00Z', 0, 5)Response Event
Event Name
executionEventsSubject
account.orders.snapshotSnapshot of orders within the specified date range
| Field | Type | Description |
|---|---|---|
orderId | string | Unique order identifier |
clientId | string | Custom client ID provided during order placement |
userId | string | Unique user identifier |
instrument | string | Trading pair (e.g., BTCUSDT) |
base | string | Base asset of the trading pair |
quote | string | Quote asset of the trading pair |
side | string | Order side buy→ Buysell→ Sell |
orderType | number | Type of order 0→ Market1→ Fill or Kill |
price | number | Order price |
executedPrice | number | Executed price of the order |
executedTimestamp | string | Timestamp when the order was executed |
quantity | number | Total quantity of the order |
quantityFilled | number | Quantity that has been filled |
orderStatus | number | Order status 0→ Created1→ Executed2→ Cancelled3→ Pending |
cancellationReason | string | Reason for order cancellation, if applicable |
slippage | number | Slippage incurred during order execution |
timestamp | string | Timestamp of the event |
Example Response
{
"data": [
{
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"clientId": "986fgh34-5678-90ab-cdef-123456ghijkl",
"userId": "qu7890ab-cdef-1234-5678-90abcdef1234",
"instrument": "BTCUSDT",
"base": "BTC",
"quote": "USDT",
"side": "buy",
"orderType": 0,
"price": 30000,
"executedPrice": 29950,
"executedTimestamp": "2024-04-21T10:15:30Z",
"quantity": 0.5,
"quantityFilled": 0.5,
"orderStatus": 1,
"cancellationReason": "",
"slippage": 0.1,
"timestamp": "2024-04-21T10:15:31Z"
}
]
}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('GetOrdersPaginated', "my-client-123", "2024-04-20T00:00:00Z", "2024-04-27T00:00:00Z", 0, 5)
.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