margin account doesnt work

Why I cant use margin account, nothing heppens, do I missing any comamand?

BinanceApiClientFactory factory = BinanceApiClientFactory.newInstance(“key”,
“secret”, true, true);

BinanceApiAsyncMarginRestClient client = factory.newAsyncMarginRestClient();

client.transfer("USDT", "1", TransferType.SPOT_TO_MARGIN, transaction -> System.out.println(transaction.getTranId()));

Hi,

It looks like you’re using Java, correct? Are you using the Binance Java Connector? Take a look at the following example for creating a new transfer from Spot to Margin (change type from 2 to 1): binance-connector-java/CrossMarginTransfer.java at master · binance/binance-connector-java · GitHub

Also make sure that you’ve enabled Margin privileges in your API settings for that specific keypair.

thats helps alot! thank you!!! =]