binance / binance/binance-futures-connector-python

get_open_orders() raises "orderId is mandatory" when symbol is provided for USDT-M Futures

Open Beginner friendly
#263 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.2k
Forks
326
PR merge metrics
No merged PRs in 30d

Description

When calling the get_open_orders() method on the UMFutures client and passing only the symbol parameter, the library throws a validation error: orderId is mandatory, but received empty.

According to the Binance API documentation, passing symbol to the open orders endpoint should return all open/conditional orders for that specific trading pair, and orderId should be optional. However, the library incorrectly treats orderId as a mandatory parameter inside this method, making it impossible to fetch open orders by symbol using the built-in high-level method.

### Steps to Reproduce:

```
from binance.um_futures import UMFutures

client = UMFutures(key='YOUR_API_KEY', secret='YOUR_API_SECRET')

# Trying to get all open orders for a specific symbol
try:
open_orders = client.get_open_orders(symbol="BTCUSDT")
print(open_orders)
except Exception as e:
print(f"Error: {e}")
```

### Expected Behavior:
The method should successfully call GET /fapi/v1/openOrders?symbol=BTCUSDT and return a list of all currently open and conditional (trigger) orders for BTCUSDT without requiring an orderId.

### Actual Behavior / Error Log:

Error: orderId is mandatory, but received empty.

### Temporary Workaround:
Currently, the only way to bypass this bug is to use the low-level sign_request method directly, which proves the API endpoint itself works fine:

`open_orders = client.sign_request('GET', '/fapi/v1/openOrders', payload={'symbol': 'BTCUSDT'})`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the UMFutures.get_open_orders(symbol="BTCUSDT") entry point and inspect how its parameters are validated before calling GET /fapi/v1/openOrders. Reproduce the reported error, then verify that symbol-only requests succeed without orderId and return the endpoint response.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.