update whenever an order changes or a new one is placed. Scope the subscription to a single funder, or omit funderAddress to stream every funder in your org over one connection. Use it instead of polling GET /orders or GET /orders/{orderId} when you need live order state.
Endpoint: wss://flash.definitive.fi/v1/ws
Connection handling (authentication, multiplexing, heartbeats, reconnecting, connection limits, and connection-level errors) is covered in Connection. This page documents the orders channel.
Working with the orders channel
funderAddressis optional. Omit it and one connection streams every funder in your org; pass it to filter the stream to that funder.- A connection holds one scope. To switch between funders, or between one funder and all of them,
unsubscribefirst or open a new connection. - Every order frame carries
funderAddress, so you can route updates to the right funder when streaming all of them. - Also subscribe to
heartbeatsso you can tell a healthy-but-quiet connection from a dead one when order updates are sparse. - Every subscribe returns a fresh snapshot, so re-subscribing after a reconnect fully reseeds your state.
- If the stream is unavailable (
STREAMING_UNAVAILABLE), fall back to pollingGET /orders.
Orders channel
Subscribe
Stream every funder in your org:ack listing your active channels:
Snapshot
Once, right after you subscribe, you receive the current open orders in your subscription’s scope:Update
When an order changes, or a new order is placed, you receive anupdate carrying just that order:
Applying updates
- Seed your local state from the
snapshot, keyed byorderId. - Each
updateis the order’s full current state. Replace your stored copy byorderId, or add it if you have not seen the order yet (a newly placed order arrives this way). - An
updatealso fires when an order reaches a terminal status. Treat any status other thanORDER_STATUS_PENDING,ORDER_STATUS_ACCEPTED, orORDER_STATUS_PARTIALLY_FILLEDas terminal, and drop it from an open-orders list.
Order fields
snapshot and update carry the same FlashOrderUpdate shape:
Looking for a field that is not listed here? Fetch the full order from
GET /orders/{orderId}.
Unsubscribing
Stop the channel with anunsubscribe message. The server re-acks your remaining channels.
Example integration
A framework-agnostic reference in about 40 lines:Errors
Errors arrive as a frame you can act on:
Transient errors (
SUBSCRIBE_FAILED, SNAPSHOT_FAILED, STREAM_ERROR) mean the server hit a temporary issue; reconnect and re-subscribe. Connection-level codes like UNAUTHORIZED and CONNECTION_LIMIT are covered in Connection.
Order statuses
The order statuses the stream emits, and which are terminal.
List orders (REST)
Poll open orders when the stream is unavailable.