Skip to main content
POST
TypeScript

Authorizations

Authorization
string
header
required

The Trading API key (trdrs_sk_…), for market data, orders and account state on the accounts its owner holds. Use it server-to-server, and keep it on your server. Its scope is named trading in the API.

Query Parameters

provider
string

The provider the account is at. Omit it to use your default provider.

account
string

The account number at that provider. It must be one of your own accounts.

Body

application/json

The working order to change, and what it should become.

providerOrderId
string
required

The order id at the provider.

instrument
string
required

The instrument.

side
enum<string>
required

Buy or sell.

Available options:
buy,
sell
orderType
enum<string>
required

The order type.

Available options:
limit,
stop,
stop_limit
price
number
required

The new price: a limit order's limit, or a stop or stop-limit order's trigger.

clientOrderId
string
required

Your own id for this change, and its idempotency key.

orderQty
number

The order's whole quantity after the change, filled and open, as FIX's OrderQty. What can still fill is this less what the order has filled when the change is made, so a fill that lands while the request is on its way counts. At or below what has filled, the order ends filled and nothing rests. The paper book takes it; any other provider answers 400 order_qty_unsupported, and takes qty. Send orderQty or qty, not both.

qty
number

Deprecated: send orderQty. The new quantity in the provider's own terms, which a provider that does not take orderQty still reads.

stopLimitPrice
number

Required for a stop-limit order: the limit price it rests at once triggered.

Response

The replace is finished. Read outcome.

What happened to the order.

outcome
enum<string>
required

What happened. See the operation for what each outcome means.

Available options:
amended,
replaced,
gone,
restored,
unconfirmed,
order_lost
providerOrderId
string | null
required

The id of the order that is working after the change: the same id where the provider changes the order in place, and a new one where the order was cancelled and placed again. Null where nothing works after it, as when an orderQty no more than what the order has filled ends it filled, or when the new price crosses the market and the paper book fills the replacement at once.

message
string | null

More detail, as an English sentence, or null.