Modify a conditional order
tossinvest_modify_conditional_orderRevise an existing conditional order by updating its type, quantity, expiry, and trigger conditions. The order is cancelled and recreated, so use the returned new conditional order ID afterwards.
Instructions
Replace an existing conditional order's settings. This changes a REAL standing order — confirm with the user first.
IMPORTANT: modification works by cancelling and recreating, so a NEW conditionalOrderId is issued and the old one stops working. Use the id from this response for every later read, modify or cancel.
The whole conditional order is re-specified, so pass every leg you want to keep — anything omitted is dropped. The symbol cannot change (it is fixed by the id), and switching type (e.g. SINGLE to OCO) is allowed.
Args:
conditional_order_id (string): the conditional order to replace.
type ('SINGLE' | 'OCO' | 'OTO'): the resulting type.
quantity (string): share count, shared by every leg.
order_type ('LIMIT' | 'MARKET'): shared by every leg. OCO/OTO accept LIMIT only.
expire_date (string): YYYY-MM-DD. Required here even though it is optional in some clients.
first (object): { order_side, trigger_price, order_price? }.
second (object, optional): omit for SINGLE, required for OCO and OTO.
confirm_high_value_order (boolean): default false.
account_seq (number, optional): resolved automatically for single-account credentials.
response_format ('markdown' | 'json'): default 'markdown'.
Returns { accountSeq, conditionalOrderId, operation: 'modified' } — with the NEW id.
Errors: 404 conditional-order-not-found, 422 condition-already-met.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Resulting type. Switching type is allowed. | |
| first | Yes | First watched condition. | |
| second | No | Second condition. Omit for SINGLE; required for OCO and OTO. | |
| quantity | Yes | Share count, shared by every leg of the group. | |
| order_type | Yes | Shared by every leg. OCO and OTO accept 'LIMIT' only. | |
| 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. | |
| expire_date | Yes | Expiry date (YYYY-MM-DD). Required when modifying. | |
| response_format | No | Output format: 'markdown' for a compact human-readable summary, 'json' for the complete raw payload. | markdown |
| conditional_order_id | Yes | Identifier of the conditional order to replace. | |
| 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 | ||
| operation | Yes | created, modified or canceled | |
| accountSeq | Yes | ||
| clientOrderId | No | ||
| conditionalOrderId | Yes | Identifier to use from now on — a modify issues a NEW id and invalidates the old one |