Error: Order's position side does not match user's setting

Q: Why do I receive the following error when I create a new order (POST /fapi/v1/order)?

{
    "code": -4061,
    "msg": "Order's position side does not match user's setting."
}
  1. Check your current Position Mode through:
  • Website:
    Screenshot 2021-09-15 at 14.45.59

  • (or) Endpoint GET /fapi/v1/positionSide/dual

  1. Compare the obtained Position Mode with what was sent in the new order’s parameter “positionSide”. The error is returned, when they don’t match!

Note:

  • “dualSidePosition” -> “true” = Hedge Mode; “false” = One-way Mode
  • “positionSide” -> Default: BOTH = One-way Mode ; LONG or SHORT for Hedge Mode. (Mandatory when Hedge Mode)

Examples of different scenarios for the error to occur:

A)

  • “dualSidePosition”: true
  • New order with no “positionSide”

B)

  • “dualSidePosition”: true
  • New order with with “positionSide=BOTH”

C)

  • “dualSidePosition”: false
  • New order with “positionSide=LONG” or “positionSide=SHORT”