inance Futures API - Profit Calculation Using Order ID

I’m trying to calculate the profit of a trade directly using the Binance Futures API with an Order ID.

My process:

Buy a symbol and close it when it reaches a higher value.
Retrieve profit details using the API.
Is there a way to get the exact profit using the Order ID, or do I need to manually calculate it from trade history? Any help or example PHP code would be appreciated.

Thanks!