E-commerce XYZ is an Indonesian omnichannel commerce company that have 3 types of products in its B2C business line: trading, consignment, and marketplace. From January 2021 until October 2022, the company’s trading rice category product sales generated a negative profit. Even though for the last several years e-commerce has been focused on growth instead of profitability, the current economic environment is forcing e-commerce companies to focus on profitability as well. For trading products, maximum profit can be achieved in two ways: selling products with a very high margin but with less quantities or selling in large quantities but with a sub-optimal margin. Hence, the company needs to find maximum profit that can be created by an optimal combination of price and quantity. To find the maximum profit, the researcher first created a demand function by using Gradient Boosted for every product group which is already grouped based on their Unit of Measurement. Next, to find the optimal price point that generates the best profit, the researcher used heuristic method against each of the demand functions. This method resulted in an increased profit up to 975% from the actual negative profit at 8.5 billion Rupiah. Although this model successfully gave price recommendation which results in better profit, business context still needs to be added before this model can be implemented in real life as well as finding other features that might affect the demand function.