The Republican National Committee, faced with a growing shortage of cash, yesterday fired 40 of 275 staff members. In addition, the RNC has terminated contracts with 10 politically influential consultants and plans to sharply cut back or eliminate roughly 20 other consulting deals.

Battered by President Reagan's falling ratings, the Iran-contra scandal and disclosures of large consulting fees, fund-raising at the RNC and the GOP Senate and House campaign committees took a nose dive during the first six months of this year.

Among the consultants who have lost contracts paying $2,000 to $5,000 a month are former White House aide Joseph Canzeri, former Reagan-Bush campaign manager and White House political director Ed Rollins, former RNC deputy chairman Fred Biebel, former RNC chief of staff Bill Phillips and the firm of Black, Manafort & Stone.

"For a long time, we were fat, dumb and happy," said a participant in discussions of the layoffs and cutbacks. "Now it's back to fundamentals." Another participant said: "The gravy train is over."

At the RNC, the cash flow dropped to $17.1 million in the first half of 1987, compared to $22.5 million in that period in 1985 and $19.8 million in 1983. At the National Republican Senatorial Committee, which was severely damaged by disclosures of large staff bonuses paid days after the GOP lost control of the Senate, cash receipts were $10.7 million, less than half of the $23 million raised in the first six months of 1985. The National Republican Congressional Committee raised an estimated $6.1 million, compared to $9.6 million in 1985.

"We got hit, we got hit pretty hard," said Jann L. Olsten, executive director of the Republican Senate committee.

The GOP, despite these declines, retains a massive dollar advantage over the Democrats. The margin, however, is declining as the Democrats are doing better now than in 1985, the previous nonelection year.

The Democratic National Committee reported raising $4.1 million, compared to $3.6 million in 1985. For the Democratic Senatorial Campaign Committee, the cash flow grew from $1.7 million to $2.5 million, and for the Democratic Congressional Campaign Committee, it went from $2.4 million in 1985 to $2.9 million this year.

Terry Michael, spokesman for the DNC, noted that "we have been hiring in our political, communications and finance divisions."

Terry Wade, Michael's counterpart at the RNC, said that even after laying off 40 employes, "we still have 235 people here to do what we have to do." Wade said decisions concerning firings were based on the goal of protecting the RNC's drive to build up state and local parties before the 1988 election. "We want to be 100 percent sure that we are able to deliver for the 1988 nominee."

One source said the decision was made to maintain a number of consulting contracts amid the cutbacks. Among those who will continue to receive monthly payments from the RNC, according to the source, are Charles Black, who was a senior adviser to the Reagan-Bush campaign; Eddie Mahe, former RNC political director; Donald Devine, a consultant to the presidential campaign of Sen. Robert J. Dole (R-Kan.), and Richard Bond, former deputy director of the RNC and currently deputy campaign manager of Vice President Bush's presidential campaign.

Olsten, of the Republican senatorial committee, said that direct-mail drives during the first quarter had such poor response that the committee abandoned prospecting efforts for the period. Those efforts, essentially "prospecting" for people who have not given regularly and could become regular donors, is highly expensive because the cost of the mailing often equals or exceeds donations. But having given once, the new donors may be more likely to give again.

Olsten said the committee has been able to retire most of a $5 million debt. A spokesman for the Republican congressional committee said the debt has been reduced from $4 million at the start of the year to $2 million.

The Democrats had poor direct-mail results as well. Peggy Connolly, communications director for the Democratic congressional committee, said direct mail is down for 1987, and that all the increase in cash resulted from a larger number of major contributors.

Direct mail for the committee went from $1.1 million in the first six months of 1985 to $960,000 this year.