API “Invalid msg.value” error when swapping bnb for another token

Hi, I am using the api to do a swap. When I try swapping DAI for BNB on Binance Smart Chain, it goes through.

However, when I try to swap BNB for DAI or for USDC or for CAKE, I am getting “Invalid msg.value” error. I do have enough BNB and using the same gas settings as for the successful transaction above.
Here are failed transactions:
0x231ad53ea298672d842a413c63fa5da5de7f83a204dae0f2608f3884262aa144
0x4a71c27e365e738d82368b21d5e8e570329627a4b8cc3ed41f2c7e8eb1b22949
0x9e5279e1c98613ef8f57002dbaa8785fe2a721ddec8639ed4bfb6890ec942d15

Thank you!

Hi,

You may need to make sure your msg.value is being create as a Big Number. JavaScript (or python) may have rounding issues causing this invalid msg.value error.

Thanks for the reply. I think it is but let me doublecheck, I am using Nethereum when sending transaction.