How to get the margin fees when using MARGIN_BUY and AUTO_REPAY ?

Hello fellow crypto enthousiasts,

Playing around with Binance margin API to implement a small bot, I quickly encountered a issue when trying to get paid margin fees.

Here is what I’m doing :
opening a position via an order using MARGIN_BUY
closing the position via an order using AUTO_REPAY

In both cases, spot commission are being returned, However, I don’t seen anything regarding margin fees except API providing history of borrow/repays.

The transaction id is being return from the POST borrow-repay endpoint, However, this is not shared from a order with MARGIN_BUY side effect.

I still can “manually” borrow and repay before placing orders, but I believe this won’t solve the problem on stop loss orders.

However, I still wonder if there is a way to know the borrow-repay transaction when using a side effect on order.