Synchronizing Orders with Accurate Tax Mapping via API

I am working on integrating an eCommerce platform with ERPNext to synchronize orders. The eCommerce platform calculates taxes, and I need to transfer the tax, net, and gross values for each product from the eCommerce platform to ERPNext Sales Orders.

The challenge is that I have two products (A and B) with different tax rates, and I want to ensure that each product’s corresponding tax details are correctly reflected in ERPNext. For example:

  • Product A (Tax rate: 10%): Tax amount $10, Net $100, Gross $110
  • Product B (Tax rate: 7%): Tax amount $7, Net $100, Gross $107

I need to know how to pass all this pricing and tax information from the eCommerce platform to ERPNext Sales Orders through the API. My goal is to input these values directly via the API without having ERPNext recalculate the taxes.