Skip to main content
GET
/
v1
/
quote-requests
/
{id}
/
stream
curl -N https://api.totalis.trade/v1/quote-requests/1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40/stream \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: text/event-stream"
event: best_quote
data: {"book_seq":1,"version":1,"request_hash":"sha256:9f86d08...","best_quote":{"id":"b2c3d4e5-6789-0abc-def1-234567890abc","payout_odds":4.25,"user_cost":25,"total_payout":106.25,"mm_cost":81.25,"valid_until":"2026-06-01T18:45:45.000Z","market_maker_id":"mm-uuid-1234"}}

event: best_quote
data: {"book_seq":2,"version":1,"request_hash":"sha256:9f86d08...","best_quote":{"id":"e5f6a7b8-9012-cdef-3456-7890abcdef12","payout_odds":4.50,"user_cost":25,"total_payout":112.50,"mm_cost":87.50,"valid_until":"2026-06-01T18:45:50.000Z","market_maker_id":"mm-uuid-5678"}}

event: status
data: {"status":"committed","committed_rfq_id":"c3d4e5f6-7890-abcd-ef12-34567890abcd"}

event: committed
data: {"quote_request_id":"1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40","rfq_id":"c3d4e5f6-7890-abcd-ef12-34567890abcd"}
Open a Server-Sent Events (SSE) stream to receive real-time best-quote updates for a specific quote request. As market makers submit, update, and withdraw quotes, you receive the current best offer automatically.

Authentication

Bearer token required. Pass your JWT in the Authorization header.
Authorization: Bearer <jwt>

Path Parameters

id
string
required
The quote request ID (UUID).

SSE Event Types

best_quote

Sent whenever the quote book changes (new quote submitted, quote updated, quote withdrawn, or quote expired). The book_seq increments monotonically so you can detect missed updates.
{
  "book_seq": 5,
  "version": 3,
  "request_hash": "sha256:9f86d08...",
  "best_quote": {
    "id": "b2c3d4e5-6789-0abc-def1-234567890abc",
    "payout_odds": 4.25,
    "user_cost": 25,
    "total_payout": 106.25,
    "mm_cost": 81.25,
    "valid_until": "2026-06-01T18:45:45.000Z",
    "market_maker_id": "mm-uuid-1234"
  }
}
When no quotes are active, best_quote is null:
{
  "book_seq": 6,
  "version": 3,
  "request_hash": "sha256:9f86d08...",
  "best_quote": null
}

status

Sent when the quote request transitions out of the active state (committed, cancelled, or expired). The stream closes after this event. committed_rfq_id is the created RFQ id when status is committed, and null otherwise.
{
  "status": "committed",
  "committed_rfq_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd"
}
Immediately after status, the stream also emits one terminal event matching the outcome, then closes. Listen for either the generic status event or the specific one below.

committed

The quote request was committed into a real RFQ. Use rfq_id to follow the trade through confirmation and settlement on the WebSocket rfq:{rfq_id} channel.
{
  "quote_request_id": "1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40",
  "rfq_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd"
}

cancelled

The quote request was cancelled (by you, via Cancel).
{
  "quote_request_id": "1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40"
}

expired

The quote request reached its expires_at without being committed.
{
  "quote_request_id": "1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40"
}

Integration Guide

  1. Open the SSE stream after creating or updating a quote request.
  2. On each best_quote event, update your displayed payout odds and store the book_seq and best quote id.
  3. When the user is ready to commit, pass expected_version, displayed_quote_id, displayed_quote_book_seq, and min_payout_odds_seen to the Commit endpoint.
  4. On a terminal event, close the stream and handle the outcome. When the request commits, read the new RFQ id from committed_rfq_id (on the status event) or rfq_id (on the committed event), then follow the trade on the WebSocket rfq:{rfq_id} channel.

Errors

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid JWT.
403FORBIDDENYou do not own this quote request.
404NOT_FOUNDQuote request not found.
curl -N https://api.totalis.trade/v1/quote-requests/1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40/stream \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: text/event-stream"
event: best_quote
data: {"book_seq":1,"version":1,"request_hash":"sha256:9f86d08...","best_quote":{"id":"b2c3d4e5-6789-0abc-def1-234567890abc","payout_odds":4.25,"user_cost":25,"total_payout":106.25,"mm_cost":81.25,"valid_until":"2026-06-01T18:45:45.000Z","market_maker_id":"mm-uuid-1234"}}

event: best_quote
data: {"book_seq":2,"version":1,"request_hash":"sha256:9f86d08...","best_quote":{"id":"e5f6a7b8-9012-cdef-3456-7890abcdef12","payout_odds":4.50,"user_cost":25,"total_payout":112.50,"mm_cost":87.50,"valid_until":"2026-06-01T18:45:50.000Z","market_maker_id":"mm-uuid-5678"}}

event: status
data: {"status":"committed","committed_rfq_id":"c3d4e5f6-7890-abcd-ef12-34567890abcd"}

event: committed
data: {"quote_request_id":"1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40","rfq_id":"c3d4e5f6-7890-abcd-ef12-34567890abcd"}