Skip to content

MFA & Security

PageMastr edited this page Mar 4, 2021 · 9 revisions

Updated: 2021/03/04

If you are getting the error below:

{'success': False, 'msg': 'deviceId=null'}

or

{'msg': 'System error.', 'traceId': 'XXXXXXXXXXXXXXXXXXXXXXXXX', 'code': 'system.error'}

That might be because Webull has made MFA mandatory after 2020/05/27.

And they added Security Question in 2021/02/06.

In order to accomplish the MFA challenge, you will need to obtain the mfa first:

wb.get_mfa(webull_email) #mobile number should be okay as well.
wb.get_security(webull_email) #get your security question.

You will then obtain the MFA code (6 digits) through Email or SMS.

You will get an output like this: [{'questionId': '1001', 'questionName': "What's your birth month and day?"}]

If needed you can request a different security question using:

wb.next_security(webull_email) #This can be used to request an alternate security question

Now use that information to login:

data = wb.login(webull_email, webull_pass, 'Any Name You Like', '123456', '1001', 'XXXX') # 6 digits MFA, Security Question ID, Question Answer.

Any Name You Like can be anything, it will show up under listed devices in your Webull Two Factor Auth in the app.

Once you have completed the MFA login, you should be able to login without MFA codes after that. But it is strongly recommended that you use the refreshToken to update your accessToken by calling the wb.refresh_login() function when you are about to run the script and record the refreshToken and the accessToken again so you won't have to face the challenge every time.