Sure, I’m unable to reply to you directly so hopefully you will see this in here. I can explain how to access the network tab in developer tools so that you can see the payload. I’m going to use Chrome as an example, but pretty much all modern browsers will have the same or similar for viewing stuff like this.
If you just search ‘Chrome Developer Tools’ in Google, there is a nice documentation site on using it.
For the sake of answering your question - (in Chrome) click ‘View’ → ‘Developer’ → ‘Developer Tools’. A new window should open, normally at the bottom of the page but if you click on the 3 dots at the top right of this window you can choose where it goes by selecting an arrangement in ‘Dock side’.
You will see along the top of the window ‘Elements’, ‘Console’… ‘Network’ is also there, this particular tab allows you to see the calls that are being made when you click on a link, etc.
The setup for viewing the call being made when you make an order with a TP/SL is to input all the values as if you were going to make a trade on the Binance site. Make sure you have TP/SL checked with your respective values in the fields.
With the ‘Network’ tab open, just before you click to buy or sell, there is a small circle with a diagonal line through it on the left of the Developer Tools window on the row below where it says ‘Network’. Click this to clear any previous network activity. It makes it easier for sorting through and finding the Binance request. Or in the filter box you can just search for it.
Now make your order and you will see under the ‘Name’ column the request called ‘place-order’ appear, this is your order. Click on it and to the right of it a window will open with ‘Headers’, ‘Payload’… Click ‘Payload’ and expand the ‘Request Payload’ JSON, then expand {strategyType: “OTOCO”,…} inside that. You will then see ‘subOrderList’. This contains the fields and their values for the calls needed to Binance, 1 for the trade, 1 for the TP and 1 for the SL.
There are extra values in there that won’t be required, but I’m sure you can work out what is and isn’t needed by comparing to the api documentation.
For the three calls to execute all of this, my logic is this (pseudo code):
make trade request:
if it returns a 200:
make a SL request:
if that returns a 200:
make a TP request
if that returns a 200:
return 200
otherwise:
cancel the original trade and SL
otherwise:
cancel the original trade (with its orderId)
otherwise:
return error
If you need any more clarification on any of this, let me know.