Skip to main content

Modify Order(v2)

Interface description

  • Function description: Modify equity orders, including simple orders. Support modify orderType, quantity, price, timeInForce.

  • Request URL: /openapi/account/orders/replace?account_id={account_id}

  • Request method: POST

  • Frequency limit: The calling frequency of each AppId is limited to 1 time per second.

Parameters

ParameterTypeRequiredDescriptionValues/Example
account_idStringRequiredAccount IDCASH_10004248
modify_orders[]order_itemRequiredOrder Details

order_item:

ParameterTypeRequiredDescriptionValues/Example
client_order_idStringRequiredUser-defined order ID.0KGOHL4PR2SLC0DKIND4TI0002
time_in_forceStringOptionalTime In ForceDAY
stop_priceStringOptionalStop Price for Stop or StopLimit order.
When the market price is greater than or equal to 1, the precision is 2, and when the market price is less than 1, the precision is 4
11.00
limit_priceStringOptionalLimit Price for Limit or StopLimit order.
When the market price is greater than or equal to 1, the precision is 2, and when the market price is less than 1, the precision is 4
11.00
quantityStringOptionalThe number of units.1
close_contracts[]CloseContractOptionalList of contracts, if the position is closed with the field passed in, the position will be closed according to the contract dimension. If contract id is not passed, the position will be closed according to the first-in-first-out rule.

close_contracts:

ParameterTypeRequired fieldsDescriptionExample value
contract_idStringNoContract id2022021819071234
quantityStringNoThe quantities of orders to be closed under each contract ID. The original value will be taken without modification, and the modified value will be passed if modification is required.10

Response

ParameterTypeRequiredDescriptionValues/Example
client_order_idStringRequiredclient_order_id to cancel0KGOHL4PR2SLC0DKIND4TI0002
order_idStringRequiredOrder id
Simple order return, Webull order ID.
80HG7CPSFDPCAL3TP66LKBAS69

Request example

from webullsdkcore.client import ApiClient
from webullsdktrade.api import API

api_client = ApiClient(your_app_key, your_app_secret, Region.JP.value)
api = API(api_client)
modify_orders = {
"client_order_id": client_order_id,
"quantity": "100",
"limit_price": "2090"
}
res = api.order_v2.replace_order(account_id=account_id, modify_orders=modify_orders)
if res.status_code == 200:
print("replace_order_res=" + json.dumps(res.json(), indent=4))

Response

Simple Order

Exception example