Place complex order
Places 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.
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": 10.5,
"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"
}