How can I create a margin limit order?

I want to create margin limit order. I use POST /sapi/v1/margin/order endpoint.
And every time I get an error

A mandatory parameter was not sent, was empty/null, or malformed.

But it doesn’t even specify which parameter causes the error.
I send:

      'side' => 'BUY',
      'isIsolated' => 'TRUE',
      'type' => 'LIMIT',
      'quantity' => 20.0,
      'price' => 24000,

But if I create an order by market, then it is successfully created. Limit - no!
Any ideas what I’m doing wrong

I finally got it!
For a limit order, it is mandatory to pass the timeInForce parameter. But the documentation does not say this. In the documentation for spot trading there is, but not in margin trading

1 Like