The batting order, also called the lineup, is the order in which the offensive players on a team go to bat. The lineup is determined by the field manager and other coaches, and changes with every game depending on strategy and which players are in the game. The lineup is nine people long, having one spot for each defensive player.
In the National League of the MLB, the pitcher takes a turn to bat and is usually the last person in the lineup. Unlike the American league, the National League does not allow designated hitters. A designated hitter, is a substitute player that bats for the pitcher. However, the MLB is currently exploring a universal designated hitter rule that will allow both leagues to have designated hitters.
In the American League, the pitcher does not bat. Instead, a designated hitter (DH) bats but does not play a defensive position. Unlike the pitcher in the National League, the DH is not always the last person in the lineup.
As each team takes their half-inning to bat, the lineup cycles through. Except for the first inning, the beginning of each half-inning does not necessarily start with the first person in the lineup. Instead, it picks off at whoever's turn was next when the team's previous offensive turn ended. The lineup does not change except in the case of substitutions.
The team's most powerful hitter usually occupies the fourth spot in the lineup and is called the cleanup hitter. The idea behind this is that the batters before him will reach base, then he will get a strong hit and advance those base runners to home plate, in effect cleaning up the bases.
The lineup card is written by the manager to list the lineup he has created for the game. Before the game, it is shared with the umpires, the opposing team, and viewers. The lineup card also lists potential substitution players.
At the start of a baseball game, the managers of each team will exchange their team's batting orders. The umpires will also get a copy. Each lineup card lists out each player that will be fielding and batting in the game, potential substitutes, and designated hitters. The Umpire in chief will ensure that the copies match the originals.
If at any point a batter is found to have batted out of order, the previous play with the results will be nullified. Managers can make an appeal to the umpires if they see a batter bats out of order or if an illegal substitution is made during the game.