Problem submitting OTO order

I’m receiving a 422 Unprocessable entity error but I can’t tell what’s wrong.

{
   "symbol": "AMZN",
   "notional": 20000,
   "side": "buy",
   "type": "market",
   "time_in_force": "gtc",
   "order_class": "oto",
   "stop_loss": {
      "stop_price": 19800,
      "limit_price": 19602
   }
}

I could be wrong, but fractional orders might not be compatible with the OTO construct. Does it work if you use a fixed quantity rather than a notional amount?

1 Like

You nailed it! It has to be “qty” and can’t be a fraction. Thank you!

1 Like

For future reference, I also discovered that “stop_price” and “limit_price” can have a max decimal place of 2.

Here is a working example:

{
   "symbol": "TSLA",
   "side": "buy",
   "type": "market",
   "time_in_force": "day",
   "order_class": "oto",
   "qty": 26,
   "stop_loss": {
      "stop_price": "744.68",
      "limit_price": "737.23"
   }
}
1 Like