You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docs: orders.md batch_create example crashes under the v2.4 return type #247
Copy-paste from the docs raises TypeError/AttributeError on the first batch-create call. Orders are placed on the wire but the script crashes before the caller can confirm fills, leading to duplicate-order risk if the user retries.
The example still shows the v2.3 list[Order] shape that was replaced in #194 by BatchCreateOrdersResponse whose entries expose .order: Order | None and .error: dict | None.
Location
docs/resources/orders.md:107-117 — broken example
kalshi/resources/orders.py:468-487 — current return type
The resource now returns BatchCreateOrdersResponse, whose only public field is orders: list[BatchCreateOrdersResponseEntry] (model_config={'extra':'allow'}), and each entry exposes .order: Order | None and .error: dict | None — not .order_id or .status on the entry itself.
Recommended fix
Rewrite the example to iterate created.orders and unpack (entry.order, entry.error) with the standard "check error first" pattern, mirroring the existing batch_create_v2 example a few sections later.
Activity
docs(orders): fix batch_create/batch_cancel examples for v2.4 typed r…