cancel_and_replace_order
Atomically cancel an existing order and replace it with updated parameters for stocks, options, or crypto. Adjust quantity, price, or type in one operation.
Instructions
Atomically cancel an existing order and replace it with new parameters.
⚠️ This modifies an existing order.
Supported for equity, option, and crypto quantity orders.
Args: order_id: UUID of the existing order to cancel and replace. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT for the replacement. time_in_force: DAY or GTD. Default is DAY. quantity: New quantity for the replacement order. Mutually exclusive with amount. amount: New notional dollar amount for the replacement order. Mutually exclusive with quantity. limit_price: New limit price (for LIMIT/STOP_LIMIT orders). stop_price: New stop price (for STOP/STOP_LIMIT orders). expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | ||
| order_id | Yes | ||
| quantity | No | ||
| account_id | No | ||
| order_type | Yes | ||
| stop_price | No | ||
| limit_price | No | ||
| time_in_force | No | DAY | |
| expiration_time | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |