Sub-account universal transfer between Spot and Margin wallet

Hello,

I was testing universal transfer from Spot to Margin wallet for sub-accounts (with fromEmail and toEmail are set to the same sub-account email), and received the following error:

{"code":-9000,"msg":"Unsupported transfer type."}

Do I understand correctly that direct transfer from Spot to Margin is not supported for sub-accounts?
If yes, are there any plans to add that support in the nearest future?

Hi,

In the documentation notes under the universal transfer endpoint, it outlines the supported transfer types:

Supported transfer scenarios:

  • SPOT transfer to SPOT, USDT_FUTURE, COIN_FUTURE (regardless of master or sub)
  • SPOT, USDT_FUTURE, COIN_FUTURE transfer to SPOT (regardless of master or sub)
  • Master account SPOT transfer to sub-account MARGIN(Cross), ISOLATED_MARGIN
  • Sub-account MARGIN(Cross), ISOLATED_MARGIN transfer to master account SPOT

So yes that’s correct that you can’t transfer from a subaccount SPOT to subaccount MARGIN using the Universal Transfer endpoint.

However since you’re just wanting to do an internal transfer (within the 1 subaccount), you can use the POST /sapi/v1/sub-account/margin/transfer endpoint

This endpoint allows you to transfer from SPOT → MARGIN and vice-versa within a subaccount.

Hope that helps.