The main objective of this work is to demonstrate the possibilities of using optimal control theory methods to solve applied problems of optimizing the work of a specialized trading enterprise, taking into account the real conditions and features of its functioning. The focus is on trading perishable food products. A difference system was selected as the basic mathematical model, where the control variable is the daily volume of wholesale purchases, and the phase variable is the quantity of goods intended for retail sale during the day. Natural losses due to spoilage are random, and a statistical procedure is used for their local assessment. The ultimate goal of the order management process is to compute an optimal wholesale purchase plan that maximizes profits over a given planning horizon. To address this problem, the dynamic optimal control problem is transformed into an interval linear programming problem. A meaningful example based on real data from a trading enterprise is provided, illustrating all the nuances of model construction. A numerical experiment confirms the effectiveness of the developed algorithm. In the concluding section of the article, the results are discussed, and recommendations for possible directions for modifying the proposed approach are provided.