Orders

Real-time streaming updates to your open orders

Receive real-time streaming updates regarding open orders in your account through the WebSocket API.

Subscription Instructions

Feed Name

private.user.open-orders

Order Status Values

ValueDescription

Started

The order is open on the marketplace waiting for fills

Cancel Pending

The order is in the process of being cancelled

Canceled

The order was successfully canceled

Filled

The order was partially filled

Done

The order was completed successfully

Example Code & Order Message

Message payload will contain a list of one or more order objects that contain the latest information on the order.

const WebSocket = require('ws')

const ws = new WebSocket('wss://ws.sfox.com/ws')

ws.on('open', function() {
  const authMessage = {
   type: 'authenticate',
   apiKey: '<API_KEY>',
  }
  
  ws.send(JSON.stringify(authMessage))
})

// After successful authentication, subscribe to open orders feed
const subscribeMsg = {
  type: 'subscribe',
  feeds: ['private.user.open-orders']
}

ws.send(JSON.stringify(subscribeMsg))

Last updated