Place a stock order
tossinvest_create_orderPlace real buy or sell orders for Korean or US stocks by specifying symbol, side, order type, and quantity or dollar amount, with idempotency keys to prevent duplicate orders.
Instructions
Place a REAL buy or sell order for a Korean or US stock. This spends or liquidates actual money — confirm the symbol, side, quantity and price with the user before calling.
Args:
symbol (string): KRX 6 digits or US ticker.
side ('BUY' | 'SELL').
order_type ('LIMIT' | 'MARKET').
quantity (string, optional): number of shares as a decimal string. Whole numbers only, except US market sells, which allow up to 6 decimal places.
order_amount (string, optional): US MARKET orders only — spend this many dollars and let the filled quantity float. Regular US session hours only.
price (string, optional): REQUIRED for LIMIT, forbidden for MARKET. KR: whole won, and it must land on the tick size for the price band. US: up to 4 decimals below $1, 2 decimals at or above $1.
time_in_force ('DAY' | 'CLS'): default DAY. CLS (at-the-close, i.e. LOC when combined with LIMIT) currently works only for US LIMIT orders.
client_order_id (string, optional): idempotency key, max 36 chars of [A-Za-z0-9_-]. Re-sending the same value within 10 minutes returns the original order rather than creating a second one. Strongly recommended.
confirm_high_value_order (boolean): default false. Required true for orders of ₩100,000,000 or more.
account_seq (number, optional): resolved automatically for single-account credentials.
response_format ('markdown' | 'json'): default 'markdown'.
Supply exactly one of quantity or order_amount.
Returns { accountSeq, orderId, operation: 'created' }. The response confirms acceptance, NOT execution — call tossinvest_get_order with the returned orderId to see the fill.
Before ordering it is worth checking tossinvest_get_buying_power (buys), tossinvest_get_sellable_quantity (sells) and tossinvest_get_price_limits (limit prices).
Errors: 422 insufficient-buying-power, 422 order-hours-closed, 422 price-out-of-range, 422 opposite-pending-order-exists, 400 confirm-high-value-required, 400 invalid-request with the correct tick size in 'data'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Order direction. | |
| price | No | Limit price. Required for LIMIT, forbidden for MARKET. KR must match the band's tick size; US allows 4 decimals under $1, 2 decimals at or above. | |
| symbol | Yes | Stock symbol. KRX: 6 digits (e.g. '005930' for Samsung Electronics). US: ticker (e.g. 'AAPL'). | |
| quantity | No | Share count as a decimal string. Whole numbers only, except US market sells (up to 6 decimals). Mutually exclusive with order_amount. | |
| order_type | Yes | 'LIMIT' needs `price`; 'MARKET' must omit it. | |
| account_seq | No | accountSeq of the account to act on (the `X-Tossinvest-Account` header). Optional: falls back to TOSSINVEST_ACCOUNT_SEQ, then to the sole account on the credentials. Get valid values from tossinvest_list_accounts. | |
| order_amount | No | US MARKET orders only: dollar amount to trade, with quantity floating. Regular session hours only. Mutually exclusive with quantity. | |
| time_in_force | No | 'DAY' expires at the close. 'CLS' is at-the-close, US LIMIT orders only. | DAY |
| client_order_id | No | Idempotency key, max 36 chars. Re-sending the same value within 10 minutes returns the original order instead of creating a second one. Strongly recommended so a retry never double-fills. | |
| response_format | No | Output format: 'markdown' for a compact human-readable summary, 'json' for the complete raw payload. | markdown |
| confirm_high_value_order | No | Set true to acknowledge an order of ₩100,000,000 or more; such orders are rejected with `confirm-high-value-required` otherwise. Only set this after the user has confirmed the amount. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| orderId | Yes | Identifier of the resulting order | |
| operation | Yes | created, modified or canceled | |
| accountSeq | Yes |