Place complex order
Changed onPlaces a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the brokerage trading support page for details on which brokerages support complex orders and which types they support.
- OCO (One Cancels the Other): Two peer orders; when one fills the other is cancelled.
- OTO (One Triggers the Other): A trigger order that, when filled, activates a conditional order.
- OTOCO (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity.
On tastytrade, option OCO supports closing an existing long or short option position with one Limit order and one Stop or StopLimit order. Both PEER orders must use SELL_TO_CLOSE or both must use BUY_TO_CLOSE, with Day or GTC time in force. Opening option OCOs are not supported.
On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one Limit take-profit order and one Stop stop-loss order. Both PEER orders must use SELL_TO_CLOSE, Day, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as STOP_PROFIT and STOP_LOSS orders sharing a combo ID, without a MASTER order. Opening option OCOs, BUY_TO_CLOSE, StopLimit, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
Request
- Base URLhttps://api.snaptrade.com
- URLhttps://api.snaptrade.com/accounts/{accountId}/trading/complex
- AuthAPI key in header Signature and API key in query parameter clientId and API key in query parameter timestamp
Path parameters
Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
The ID of the account to execute the trade on.
Query parameters
SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the rotate user secret endpoint.
Request body
Example request
{
"type": "OTO",
"orders": [
{
"order_role": "TRIGGER",
"instrument": {
"symbol": "AAPL"
},
"order_type": "Market",
"units": 1,
"time_in_force": "Day",
"price": 31.33,
"stop": 29.5
}
],
"client_order_id": "550e8400-e29b-41d4-a716-446655440000"
}Response
OK
Example response
{
"type": "OTO",
"brokerage_group_order_id": "1234567890"
}Changes
- breaking
the
response's property type changed fromstringto no type for status - breaking
the
response's property type changed fromstringto no type for status - breaking
the
response's property type changed fromstringto no type for status - breaking
the
response's property type changed fromstringto no type for status
- breaking
- breaking
the
response's property type changed from no type tostringfor status - breaking
the
response's property type changed from no type tostringfor status - breaking
the
response's property type changed from no type tostringfor status - breaking
the
response's property type changed from no type tostringfor status
- breaking