Order Update WebSocket
Receive real-time order execution events — fills, rejections, modifications, and status changes.
Connection
ruby
client = DhanHQ::Client.new(
client_id: ENV["DHAN_CLIENT_ID"],
access_token: ENV["DHAN_ACCESS_TOKEN"]
)
client.order_updates.startListen for Updates
ruby
client.order_updates.on_update do |order|
puts "#{order.status} #{order.average_traded_price} #{order.filled_quantity}"
endSubscription
ruby
client.order_updates.subscribeSee the Live Order Updates guide for full documentation.