Hi,
I’m trying to submit a margin buy order from python but encountered a “Margin account does not exist” error. I have activated my margin account already and flagged
the API to enable margin trade. What’s wrong in this case?
from binance.client import Client
from binance.exceptions import BinanceAPIException
Yes, I followed exactly the same steps 1 to 5.
I can execute
info = client.get_margin_asset(asset=‘BNB’)
but
transaction = client.transfer_spot_to_margin(asset=‘BTC’, amount=‘0.001’)
failed as well with an error bellow.
BinanceAPIException: APIError(code=-1002): You are not authorized to execute this request.
The You are not authorized to execute this request. error is probably related with “Enable Margin…Transfer” permission not been enabled.
For the original error message, thanks for verifying the steps! Just one more request, can you try to send Margin Order request with the Postman to see if it’s not related with the library ( I think it’s python-binance) that you’re using, please?
Please share the request URL in query string afterwards here.