itsjafer / schwab-api

A python library for placing trades on Charles Schwab
MIT License
201 stars 64 forks source link

Error when placing order: This order cannot be accepted. Please ensure logged into correct account for order processing through Charles Schwab or TD Ameritrade #26

Closed zzhua100 closed 6 months ago

zzhua100 commented 8 months ago

get account and position are both ok, but an error occurred when placing an order. messages, success = api.trade_v2( ticker="AAPL", side="Buy", #or Sell qty=1, account_id=XXXX, )

"orderMessages":
        [
            {
                "messageId": "DO3120",
                "message": "This order cannot be accepted. Please ensure logged into correct account for order processing through Charles Schwab or TD Ameritrade",
                "legNumber": 0,
                "disclaimerCode": "",
                "o2Code": "",
                "isCheckAffirm": "",
                "versionCode": "",
                "localizationCode": "US",
                "severity": "30",
                "renewal": false,
                "moduleShortName": "DO3120",
                "disclosureContent": "",
                "msgSubtnParam1": "",
                "msgSubtnParam2": "",
                "isTopLevel": false,
                "redirectMessage": null
            }
]
itsjafer commented 7 months ago

Unclear to me on how to reproduce this. My gut based on the error message tells me that you may have input the account ID incorrectly in the call