This paper studies the multi-stage supply chain system (MSSCM) controlled by the kanban mechanism. In the kanban system, decision making is based on the number of kanbans as well as batch sizes. A kanban mechanism is employed to assist in linking different production processes in a supply chain system in order to implement the scope of just-in-time (JIT) philosophy. For a MSSCM, a mixed-integer nonlinear programming (MINLP) problem is formulated from the perspective of JIT delivery policy where a kanban may reflect to a transporter. Since the adopted model is of MINLP type and solving it by branch and bound (B& B) takes time, a metaheuristic is presented. This metaheuristic is an electromagnetic algorithm (EA). The EA is compared against an existing algorithm and also B& B results to evaluate the proposed metaheuristic. Extensive experiments and statistical analyses demonstrate that our proposed EM is more efficient than B& B with regard to the objective functions considered in this paper.