Binance Python – enable InternalTransfer and send fund to financement Wallet

Question:

I’m trying to send some token from a spot account to a sub-account of the same wallet.
As far as I understand, there is few sub-account wallet on ‘regular’ binance account (<25bnb):

  • Spot Wallet
  • Futures Wallet
  • Isolated Maring Wallet
  • Crossed Margin Wallet
  • Financement Wallet

I’m using python 3.8 and the python binance api.

Here is the command I’ve used:

transfer_spot_to_isolated_margin(asset="MATIC", amount=float(amount), type="1") 

And here is the result :

binance.exceptions.BinanceAPIException: APIError(code=-1002): You are not authorized to execute this request. 

It seems the API configuration isn’t setup to allow this transfert.
Here is API configuration

from

get_account_api_permissions()

got

{'ipRestrict': True, 'createTime': 1641830788000, 'enableReading': True, 'enableSpotAndMarginTrading': True, 'enableWithdrawals': True, 'enableInternalTransfer': False, 'enableMargin': False, 'enableFutures': False, 'permitsUniversalTransfer': True, 'enableVanillaOptions': False}

I think the problem is comming from enableInternalTransfer that is set to 'False'. But I don’t know how to change this configuration. I’ve cross everything in the API configuration in the binance API panel.

Do you know how to enable it?

I live in France, so margin and futures are disable. But it should be ok to transfert token to these Wallet (it’s possible from binance Android application)

Do you know how to transfert fund to ‘Financement Wallet’? I can’t find anything about it in the binance API python documentation.

Thanks a lot in advance for any help 🙂
Sorry for asking that many question in a single post !

Asked By: M.Ferru

||

Answers:

The sub-account feature is used by corporate account users and VIP1 (or higher) personal account users which has a master account for the management.
If you’re not under those categories, then sub-accounts feature is not enabled and its associated permission “enableInternalTransfer" doesn’t matter for your case.

Any Binance account comes with many different products, for example: Spot, Futures and Margin (each with their own account wallet).

If you want to transfer from Spot to Isolated Margin wallet,there’s 2 ways:

For both options, you should have the check the following on API Management page:

  • Have ‘enableMargin’ enabled
  • See if your request IP is whitelisted

In case you still get error code -1002, please go to https://dev.binance.vision/t/error-you-are-not-authorized-to-execute-this-request/8102 to test on more possibilities.

Useful links:

Answered By: Binance

The margin account was totally initialized : it is mandatory to send some fund in this account ‘manually’ to enable the margin wallet.
Once this was done I didn’t receive the error anymore.

Please check out ‘Binance’ answer for more link to documentations.

Answered By: M.Ferru
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.