I created a fresh paper account to do some testing and generated new keys for it. When I used the keys for the new account, my script acted as though it was still using a previous paper account. I deleted the old paper account, but my script was still attempting to access it for trading, although it now returned {“code”:40010001,“message”:“account is not allowed to trade”} after the deletion. I regenerated the keys twice with the new paper account that I am hoping to use and made an additonal paper account, neither of which worked. Whatever I try, my API is trying to access a deleted paper account. Has anyone else encountered this? Do any devs know what happened?
@Amich If you created a new paper account and used keys for that new account, but your script acted as though it was still using the previous account, my guess is that you actually aren’t using the new keys. It is functionally not possible for API keys from one account to reference another account.
Are you by chance storing your account keys in an OS variable or system file? Often times those variables are only read when the OS starts. Therefore, if values are modified without restarting, the old values will be retained. A simple test would be to restart your computer and see which account is accessed then. Another test would be too hard code the API keys immediately before they are used in your algo. As a double check you may also want to print those keys immediately after they are used in your code.
I can also help troubleshoot if you provide the account numbers of both the deleted and new account. Also provide the end point you were accessing when you got the message “account is not allowed to trade” along with an approximate time including time zone. With that information I can check the logs and verify the API key which you are actually sending in the request.