tedchou12 / webull

Unofficial APIs for Webull.
MIT License
601 stars 185 forks source link

Exception: ('place_option_order failed', 405, '') #382

Open lunascimentog opened 1 year ago

lunascimentog commented 1 year ago

Hi, I'm having a problem when i'll place an order with options. It happens this error:

"File "c:\Users\Proje\OneDrive\Documentos\GitHub\webull\webull\endpoints.py", line 10, in result = wb.place_order_option(optionId='1035911289', lmtPrice='0.1', action="BUY" , orderType="LMT", quant=1) File "C:\Users\Proje\AppData\Local\Programs\Python\Python310\lib\site-packages\webull\webull.py", line 849, in place_order_option raise Exception('place_option_order failed', response.status_code, response.reason) Exception: ('place_option_order failed', 405, '') " My programmation: result = wb.place_order_option(optionId='1035911289', lmtPrice='0.1', action="BUY" , orderType="LMT", quant=1) print(result)

RichiePBot commented 1 year ago

hey. yes im getting similar problem, but i got 403 image

i can place trades on webull desktop app

ICANTFINDAUSERNAMEATALL commented 1 year ago
  1. Make sure your logged in. If your not logged in, it wont work. Try to get your positions and if you get nothing when you have stuff in your account or if you get an error, make sure you login first.
  2. Make sure you place the order during trading hours. If you entered this order outside of trading hours, make sure you use enforce='GTC'in order for the order to go through. You might be trying to place a day trade during the outside hours
  3. Make sure you have enough funds. The order won't go through if you don't have enough funds.

I believe that 405 means its outside of trading hours and 403 is that you don't have enough funds but I don't remember. Hope this helps

lunascimentog commented 1 year ago

The problem is on image verification when i try to login. There is any solution for that? {'msg': 'Fail to verify image verification code.', 'traceId': '191fe5321f414c6b9e983c84794576d5', 'code': 'user.check.slider.pic.fail'}

ICANTFINDAUSERNAMEATALL commented 1 year ago

366

ICANTFINDAUSERNAMEATALL commented 1 year ago

The instructions are mentioned on other threads. Heres a run down summary:

  1. get a valid "did" by going to webull web, login, and inspect the page. Find a random request and look for a did request header
  2. create a webull object and run the wb._set_did([your did here]) function and add your did as the argument

hope this helps

webullstocktrader commented 1 year ago

I have done that. But I still get the same 405 error when trying to place a trade. I have the available funds and placing trades during markethours, but still get the 405 error.