I'm working on a script to calculate product prices for dropshipping. My problem: I have price from wholesaler let say wp I know how much I want to profit lets say mp and I can call API for margin I will pay to marketplace lest say mm( it based on final price, so wp+mm). So i calculate my final price like x=wp+mp+mm. Problem is that in reality marketplace margin is calculated when product is sold based on price so the real margin will be calculated out of price I calculated x not from wp+mp. It creates some differences. I have no idea how to do it right.
I tried writing some formulas but I couldn't figure it out. I know I can call API over and over again with final prices and it minimize the error but I have a lot of products that has to be recalculated every hour and my marketplace API is limited to 150 calls per minute