Hi, I use WHATIF orders via API everyday and it always worked fine. One leg or multi-leg combos, everything OK.
Try to build the same order on TWS, and see the margin impact. You should get exactly the same with API.
If not the case, look for API error messages, maybe they will tell you what's wrong