General Error at sub-account/futures/internalTransfer

My POST to /sub-account/futures/internalTransfer is failing with {‘code’: 200000000, ‘msg’: ‘General error.’}

I am using the example code provided on github, except for the final lines and the api base url I am using is “https://api.binance.com”:

params = {
    "fromEmail": "xx@yy.com"
    "toEmail": "virtualemail@yy.com",
    "futuresType": 1, 
    "asset": "BUSD",
    "amount": 20,
}
response = send_signed_request("POST", "/sapi/v1/sub-account/futures/internalTransfer", params)
print(response)

Can someone help please?

  1. If you replace the payload in this quick script:
    https://github.com/binance/binance-signature-examples/blob/master/python/spot/spot.py
    Does the same error code happens?

  2. What happens if you use the API Key’s Binance account to make the transfer on the UI?

  3. You can also test with Postman https://github.com/binance/binance-api-postman

Since this error message is too general, we’ll have to debug a bit to gather more details.

Hi @aisling2 , I have some more clues for you, I hope these will help:

I ran the following shell script, and all the requests are succeeding except for two, both at sapi/v1/sub-account/futures/. They return these errors:

POST /sapi/v1/sub-account/futures/internalTransfer returns {"code":200000000,"msg":"General error."}.

POST /sapi/v1/sub-account/futures/enable returns {"code":-1000,"msg":"System abnormality"}.

But POST /sapi/v1/sub-account/margin/enable works, even when I called it again after enabling margin. I thought maybe “system abnormality” meant “already enabled,” because I received that when trying to enable futures (and futures for the sub-account was enabled already in the UI), but I did not get “system abnormality” when enabling margin several times in a row.

Could it be an issue with /sapi/v1/sub-account/futures/…`? Maybe I should just erase the subaccount and make a new one.

KEY="key"
SECRET="secret"
fromEmail="masteracct@email.com"
toEmail="virtual_subacct@email.com"
timestamp=`date +%s%N | cut -b1-13`
echo $timestamp
query_string="email=${toEmail}&timestamp=${timestamp}"
#query_string="amount=0.01&fromEmail=${fromEmail}&toEmail=${toEmail}&futuresType=1&asset=BUSD&timestamp=${timestamp}"
#query_string="timestamp=${timestamp}"
echo $query_string
signature=`echo -n $query_string | openssl dgst -sha256 -hmac $SECRET`
echo $signature
sig_no_prefix=${signature#* } # Removes up to the space after "(SHA2-256(stdin)= "
echo $sig_no_prefix

#echo `curl -H "X-MBX-APIKEY: ${KEY}" \
#       -X POST 'https://api.binance.com/sapi/v1/sub-account/futures/internalTransfer' \
#       -d "${query_string}&signature=${sig_no_prefix}"`

#echo `curl -H "X-MBX-APIKEY: ${KEY}" \
#       -X POST 'https://api.binance.com/sapi/v1/sub-account/futures/enable' \
#       -d "${query_string}&signature=${sig_no_prefix}"`

#echo `curl -H "X-MBX-APIKEY: ${KEY}" \
#       -X POST 'https://api.binance.com/sapi/v1/sub-account/margin/enable' \
#       -d "${query_string}&signature=${sig_no_prefix}"`

#echo `curl -H "X-MBX-APIKEY: ${KEY}" "https://api.binance.com/sapi/v1/sub-account/list?${query_string}&signature=${sig_no_prefix}"`
#echo `curl -H "X-MBX-APIKEY: ${KEY}" "https://api.binance.com/sapi/v1/sub-account/spotSummary?${query_string}&signature=${sig_no_prefix}"`
#echo `curl -H "X-MBX-APIKEY: ${KEY}" "https://api.binance.com/sapi/v1/capital/config/getall?${query_string}&signature=${sig_no_prefix}"`
#echo `curl -H "X-MBX-APIKEY: ${KEY}" -X POST "https://api.binance.com/sapi/v3/asset/getUserAsset" -d "${query_string}&signature=${sig_no_prefix}"`

Hi @aisling2 , thank you for helping me out.

Using the spot.py script you linked instead of the um_futures.py one I was using earlier:

  1. Doing sapi/v1/futures/transfer with transfer type either 1 or 2, I receive a transaction id for a successful request. This works while making the request using either the sub-account’s credentials or the master account’s.
  2. I have made successful transfers to the subaccount from the UI.

Also running sapi/v1/futures/transfer works with the um_futures.py script I had before works, but for both scripts, I receive the “General Error” when trying sapi/v1/sub-account-futures/internalTransfer. Maybe there is something I need to enable in the UI first, does master-subaccount internal transfer require this? I noticed that Universal Transfer does.

Again thanks for your help, I’ll do everything you suggest to get this resolved soon.

This is resolved, sub-account/futures/internalTransfer is from main futures to subaccount futures – and I had no balance in the main futures account. We’ll need to use sub-account/universalTransfer to transfer from main spot to subaccount futures. Thanks anyway @aisling2

1 Like