Skip to Content
BlitzPulse docs are live. Looking for the app? Visit https://app.blitzglobalcapital.com.
Api ReferenceOrders API

Orders API

Auto-generated from openapi-snapshot.json. Do not edit by hand — changes are overwritten by scripts/docs/generate_api_reference.py.

7 endpoints in this group.

GET /api/orders/

List Orders

List orders, newest first. Optional status / symbol filters.

Parameters

NameInTypeRequiredDescription
tenant_idqueryintegeroptional
statusqueryoptional
symbolqueryoptional
limitqueryintegeroptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/orders/blotter

List Orders Blotter

Blotter view with keyset cursor pagination (created_at DESC, id DESC).

Designed for mobile infinite-scroll:

  • Stable under concurrent inserts (keyset > offset).
  • next_cursor is opaque base64 of (created_at, id).
  • Filters stack as AND.

Parameters

NameInTypeRequiredDescription
tenant_idqueryintegeroptional
limitqueryintegeroptionalPage size. Defaults to 50, hard cap 200 for mobile blotter scroll.
cursorqueryoptionalOpaque cursor from a previous page’s next_cursor.
statusqueryoptional
symbolqueryoptional
account_idqueryoptional
sidequeryoptionalBUY or SELL
fromqueryoptionalISO-8601 lower bound on created_at (inclusive).
toqueryoptionalISO-8601 upper bound on created_at (exclusive).

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/orders/place

Place Order

Validate then submit to Schwab.

  • On REJECTED: persists row with status=‘REJECTED’, does NOT call Schwab.
  • On approved + paper_trading: persists row with status=‘PAPER_FILLED’.
  • On approved + live: calls schwab_client.execute_order, persists with status=‘SUBMITTED’ (or ‘SUBMIT_FAILED’ on broker error).

P0-5: requires Idempotency-Key header. Replays return the exact cached response. Every INSERT/UPDATE here is audited via trigger on orders (see migration 0057_audit_log) attributed to user_id.

Parameters

NameInTypeRequiredDescription
tenant_idqueryintegeroptional
Idempotency-KeyheaderoptionalClient-generated unique id for this request.

Request body: application/json

Responses

CodeDescription
201Successful Response
422Validation Error

POST /api/orders/preview

Preview Order

Run validate_trade() without submitting. Safe dry-run for UI.

P1-8: attaches any non-blocking wash-sale warnings. The warning is informational only and does not affect decision.

Parameters

NameInTypeRequiredDescription
tenant_idqueryintegeroptional

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/orders/{order_id}

Get Order

Parameters

NameInTypeRequiredDescription
order_idpathintegerrequired
tenant_idqueryintegeroptional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/orders/{order_id}/cancel

Cancel Order

Cancel an open order. Mutation audited via mutations_audit_log trigger on orders (see migration 0057_audit_log).

Parameters

NameInTypeRequiredDescription
order_idpathintegerrequired
tenant_idqueryintegeroptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/orders/{order_id}/status

Refresh Order Status

Pull latest status from Schwab and persist.

Parameters

NameInTypeRequiredDescription
order_idpathintegerrequired
tenant_idqueryintegeroptional

Responses

CodeDescription
200Successful Response
422Validation Error