---
title: "Preview a guarded prediction-market order"
method: POST
path: "/trading/preview"
tags: ["Trading"]
---

# Preview a guarded prediction-market order

`POST /trading/preview`

## Request

- Base URL: `https://foresea.ink` (the document declares no server; this is the origin it was published from)
- URL: `https://foresea.ink/trading/preview`
- Auth: none declared

Validate and normalize a Kalshi/Polymarket order without placing it.

## Request body

- TradeOrderRequest: A guarded prediction-market order request. `/trading/preview` validates this without execution. `/trading/orders` only submits when `execute=true`, the confirmation phrase is exact, and server live-trading env flags are enabled.
  - `platform` string, required: `kalshi` or `polymarket`.
  - `action` string: `buy` or `sell`.
  - `outcome` string: Outcome side: `yes` or `no`.
  - `order_type` string: `limit` or `market`.
  - `price` number, nullable: Limit price, or worst acceptable price for market/IOC-style orders.
  - `quantity` number, required: Contracts/shares. For Polymarket market-buy, max_cost may define spend.
  - `max_cost` number, nullable: Polymarket market-buy spend cap in USD.
  - `ticker` string, nullable: Kalshi market ticker.
  - `token_id` string, nullable: Polymarket CLOB outcome token id.
  - `slug` string, nullable: Polymarket market slug for token resolution.
  - `market_id` string, nullable: Polymarket market id for token resolution.
  - `time_in_force` string, nullable: Venue-specific TIF, e.g. GTC/FOK or good_till_canceled.
  - `post_only` boolean: Reject rather than cross the book when supported.
  - `reduce_only` boolean: Kalshi reduce-only flag.
  - `tick_size` string, nullable: Polymarket tick size override.
  - `neg_risk` boolean, nullable: Polymarket negative-risk market flag.
  - `client_order_id` string, nullable: Caller-provided idempotency/order id.
  - `cancel_order_on_pause` boolean: Kalshi cancel-on-pause flag.
  - `subaccount` integer, nullable: Kalshi subaccount number.
  - `exchange_index` integer: Kalshi exchange shard index; currently 0.
  - `execute` boolean: Must be true on `/trading/orders` for live execution.
  - `confirmation` string, nullable: Must equal the server confirmation phrase.
  - `venue_credentials` VenueCredentials: Credentials received only by the authenticated connection endpoint. These values are accepted once over TLS, encrypted server-side, and never returned to the browser. They are intentionally rejected on order-preview and order-submission requests so the public UI cannot fall back to a browser-held secret flow.
    - `kalshi_api_key_id` string, nullable
    - `kalshi_private_key` string, nullable: RSA private key PEM.
    - `kalshi_base_url` string, nullable
    - `polymarket_private_key` string, nullable: Wallet private key.
    - `polymarket_api_key` string, nullable
    - `polymarket_api_secret` string, nullable
    - `polymarket_api_passphrase` string, nullable
    - `polymarket_clob_host` string, nullable
    - `polymarket_chain_id` integer, nullable
    - `polymarket_signature_type` integer, nullable
    - `polymarket_funder_address` string, nullable

## Response `200`

Successful Response

- TradeOrderPreviewResponse
  - `ok` boolean, required
  - `platform` string, required
  - `would_execute` boolean, required
  - `requires_confirmation` boolean, required
  - `confirmation_phrase` string, required
  - `trading_enabled` boolean, required
  - `max_order_notional` number, required
  - `estimated_notional` number, required
  - `warnings` string[]
  - `normalized_order` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/foresea/apis/foresea-intelligence-api.md) · [All operations](https://skmtc.dev/foresea/apis/foresea-intelligence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/foresea/apis/foresea-intelligence-api/revisions/b03e49f4385d?raw)
