Skip to navigation

Amend order

Amend an incomplete order.

Authentication

OK-ACCESS-KEYstring
Your API key.
OK-ACCESS-SIGNstring

Base64-encoded HMAC-SHA256 signature of the prehash string.

OK-ACCESS-TIMESTAMPstring

ISO 8601 UTC timestamp, e.g. 2020-12-08T09:08:57.715Z.

OK-ACCESS-PASSPHRASEstring
The passphrase you set when creating the API key.

Request

This endpoint expects an object.
instIdstringRequired
Instrument ID
cxlOnFailbooleanOptional

Whether the order needs to be automatically canceled when the order amendment fails Valid options: false or true, the default is false. Amendment failure scenarios include: newSz not a multiple of lotSz, position or risk limit breach, etc. When false (default): the original order continues unchanged after a failed amendment. When true: the original order is auto-cancelled on any amendment failure.

ordIdstringOptional

Order ID Either ordId or clOrdId is required. If both are passed, ordId will be used.

clOrdIdstringOptional
Client Order ID as assigned by the client
reqIdstringOptional

Client Request ID as assigned by the client for order amendment A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 32 characters. The response will include the corresponding reqId to help you identify the request if you provide it in the request.

newSzstringOptional

New total target quantity after amendment, must be > 0. This is the desired total order size, not the remaining unfilled portion. For a partially-filled order: if 3 contracts are already filled and you want a total of 8, pass newSz=8 (not 5). The system will attempt to fill the remaining 5. At least one of newSz or newPx (or newPxUsd/newPxVol for options) must be provided.

newPxstringOptional

New price after amendment. When modifying options orders, users can only fill in one of the following: newPx, newPxUsd, or newPxVol. It must be consistent with parameters when placing orders. For example, if users placed the order using px, they should use newPx when modifying the order. At least one of newSz or newPx must be provided.

attachAlgoOrdslist of objectsOptional

Attached TP/SL or trailing stop order information

Response

Successful response
codestringOptional

Result code. 0 means success; any other value is an error code.

msgstringOptional
Error message. Empty on success.
datalist of objectsOptional