# Order Feed

Use this stream for authenticated order status events from the history service.

### Endpoint

```
wss://history-service.outpoll.com/order/ws
```

### Authentication

Send this message right after connect.

```json
{
  "t": "AUTH",
  "d": {
    "apiKey": "<API_KEY>",
    "signature": "<SIGNATURE>",
    "timestamp": "<UNIX_EPOCH_SECONDS>"
  }
}
```

Build `signature` from `timestamp + "GET" + "/order/ws"`.

Success response:

```json
{
  "t": "SUCCESS",
  "d": {
    "message": "AUTH successful"
  },
  "r": null
}
```

### Notes

* Use this stream for live order status events.
* Message payloads can vary by event type.
* Re-authenticate after reconnect.

### Python example

{% code title="order\_feed.py" %}

```python
import asyncio, json, websockets

def auth_message(api_key, signature, timestamp):
    return {
        "t": "AUTH",
        "d": {
            "apiKey": api_key,
            "signature": signature,
            "timestamp": timestamp,
        },
    }

async def order_feed(api_key, signature, timestamp):
    uri = "wss://history-service.outpoll.com/order/ws"
    async with websockets.connect(uri) as ws:
        await ws.send(json.dumps(auth_message(api_key, signature, timestamp)))

        async for msg in ws:
            print(json.loads(msg))
```

{% endcode %}
