Difference between transfer api's?

What is the difference between these api’s?

/sapi/v1/futures/transfer

and

/sapi/v1/sub-account/transfer/subUserHistory

With the first api, I seem to be getting an extra transfer as if it was showing a transaction between spot wallet and futures wallet. However, I can tell for sure.

And additional question…How can I retrieve a list of transactions that occur between an accounts spot and futures wallet?

Hi.
Though the HTTP request methods are not mentioned, I assume you want to ask the following two endpoints?

  • GET /sapi/v1/futures/transfer -> retrieves the transfer history between spot account and futures account.
  • GET /sapi/v1/sub-account/transfer/subUserHistory -> retrieves the transfer history between this account and its master account or another sub account.

Note that neither spot account nor futures account is equivalent to sub account. Sub account is a special type of account that managed by a master account, aka corporate account.

Ishuen,

Thanks for the response.

So, the GET /sapi/v1/futures/transfer endpoint will show all transfers between spot and futures account regardless of the direction. E.g, spot to futures and futures to spot?

1 Like

That’s right, if you do transfer in both directions, you’ll see “type”: 1 and “type”: 2 for GET /sapi/v1/futures/transfer response

So, one other question. I seem to also get a Transfer when making a call to the endpoint: /fapi/v1/income.

It’s a transfer that seems to be a sub-account (futures wallet) to the master account. I don’t understand why it does NOT come back in the call to endpoint: /sapi/v1/sub-account/transfer/subUserHistory but only in this income history endpoint above.

Could you sure the API response to help us better understand your question? (Please remove the sensitive part.)

Here is the response that I get when calling the endpoint: /fapi/v1/income

[{“symbol”:“SRMUSDT”,“incomeType”:“REALIZED_PNL”,“income”:“0.26373750”,“asset”:“USDT”,“time”:1619105918000,“info”:”xxx53543”,“tranId”:xxxx453543,“tradeId”:”xxx453”},{“symbol”:“SRMUSDT”,“incomeType”:“COMMISSION”,“income”:”-0.00174960",“asset”:“USDT”,“time”:1619105918000,“info”:”xxx53543”,"tranId”:xxxx0453543,"tradeId”:”xxx453”},
{“symbol”:"",“incomeType”:“TRANSFER”,“income”:"-5000.00000000",“asset”:“USDT”,“time”:1619105921000,“info”:“TRANSFER”,“tranId”:xxxx824793,“tradeId”:”"}]

Notice the last item is a TRANSFER but it does NOT indicate from and to but matches what my UI says.

GET /sapi/v1/sub-account/transfer/subUserHistory shows the sub-account transfer history. That is, it shows the record of calling the following two APIs:

  1. POST /sapi/v1/sub-account/transfer/subToSub
  2. POST /sapi/v1/sub-account/transfer/subToMaster
    However, as you can see from the 2nd endpoints acceptable parameters, it’s not able to specify if it’s from futures wallet or not. Probably that’s why its not listed in the query result.