Cancel an open order
tossinvest_cancel_orderCancel an open or partially filled order by order ID to withdraw the unfilled remainder and protect against unintended trades. Confirm the real order cancellation first.
Instructions
Cancel a working order. This cancels a REAL order — confirm with the user first.
Args:
order_id (string): the order to cancel. Get it from tossinvest_list_orders with status='OPEN'.
account_seq (number, optional): resolved automatically for single-account credentials.
response_format ('markdown' | 'json'): default 'markdown'.
Returns { accountSeq, orderId, operation: 'canceled' }.
A partially filled order can still be cancelled — the unfilled remainder is withdrawn and the filled part stands. Read execution.filledQuantity on the order afterwards to see what actually traded.
Errors: 409 already-filled (nothing left to cancel), 409 already-canceled, 409 already-processing, 422 cancel-restricted, 404 order-not-found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Identifier of the working order to cancel. | |
| 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. | |
| response_format | No | Output format: 'markdown' for a compact human-readable summary, 'json' for the complete raw payload. | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| orderId | Yes | Identifier of the resulting order | |
| operation | Yes | created, modified or canceled | |
| accountSeq | Yes |