This API is available only to Order Routing customers on the allow list. For public market data access or DMA (Direct Market Access) to itBit, use the public WebSocket API.
Connection
Endpoints
Production:wss://ws.paxos.com/
Sandbox:
wss://ws.sandbox.paxos.com/
Authentication
Authentication is performed during the WebSocket handshake. You must provide valid OAuth2 credentials in the Authorization Bearer header.You must include theexchange:read_aggregated_marketdata_stream
scope. Without this scope, the WebSocket route responds with403 Forbidden
.
➊ Get OAuth2 Credentials
Request an access token using your client credentials:Sandbox
Production
Response
➋ Establish WebSocket Connection
Use the access token as the Bearer token when establishing the WebSocket connection:Connection Lifecycle
- Client establishes WebSocket connection with authentication
- Server maintains connection with automatic ping/pong heartbeat
- Client subscribes/unsubscribes to data channels (e.g., BTCUSD market data)
- Server streams data to subscribed channels
- Connection closes on client disconnect or server shutdown
Quick Start Example
Here’s a minimal example to get you started:Operations & Message Formats
Subscribe Operation
Subscribe to one or more data channels for real-time updates. Request:Unsubscribe Operation
Stop receiving updates from specific channels. Request:List Subscriptions Operation
Get all active subscriptions for your connection. Request:Data Channels
The Order Routing WebSocket API supports two types of streaming data channels:Market Data Channel
Provides real-time order book updates with initial snapshots and incremental changes.- Channel type:
market_data
- Initial message: Full order book snapshot
- Subsequent messages: Incremental updates
- View detailed documentation →
Execution Data Channel
Provides real-time trade execution notifications.- Channel type:
execution_data
- Message frequency: On each trade execution
- View detailed documentation →
Error Handling
The API uses standardized error codes:Error Code | Description |
---|---|
UNKNOWN_ACTION | The requested action type is not recognized |
INTERNAL_SERVER_ERROR | An unexpected server error occurred |
MALFORMED_REQUEST | The request JSON is invalid or cannot be parsed |
NO_EFFECT_ACTION | The action would have no effect (e.g., duplicate subscription) |
UNKNOWN_CHANNEL | The requested channel type is not recognized |
UNKNOWN_CHANNEL_PARAMS_CONFIGURATION | Invalid or missing channel parameters |
Questions? Contact Support.