An Energy Department official has been traveling the statehouse circuit in recent weeks, testifying at government expense against legislation that would bar oil companies from charging extra for credit-card sales.

The official is Leonard Coburn, head of the DOE Office of Competition, who has appeared recently before legislative panels in at least three states to argue against any restrictions on the so-called "credit surcharge," usually advertised at the pumps as a discount for cash customers.

Coburn says he sees himself as a messenger for the Reagan administration's free-market philosophy, giving "expert guidance" to state legislators "before they do something to the marketplace that somehow will mess it up."

But his activities have been attacked by some gasoline wholesalers and service station dealers who oppose the surcharge. They say Coburn's activity amounts to "gratuitous lobbying" by a government official and runs counter to the administration's vow to keep the federal nose out of state business.

Rep. Berkley W. Bedell (D-Iowa) passed along their complaints, and a few of his own, in a letter to Energy Secretary Donald P. Hodel this month. Finding a "remarkable coincidence" between Coburn's views and those of the major oil companies, he pointedly suggested that Hodel might even save federal money by abolishing Coburn's office.

"I can confidently predict that whatever work they do in that office would quickly be picked up by the big oil companies, whose budgets are in better shape than the government's right now," he wrote.

Coburn's boss, Assistant Secretary Robert C. Odle Jr., says that Coburn's activities have his full approval and are "totally consistent" with the administration's pro-federalism and anti-regulation policies.

"It is a perfectly proper thing for government officials to present their views on administration policy," said Odle, who added that Coburn testified at the request of several states. "If he wasn't welcome, the appropriate state body would tell us and he wouldn't go."

But Texas legislators say Coburn's appearance before a House committee in Austin last week was his idea, not theirs.

"He was not invited by the committee," said Rep. Hugo Berlanga, who sponsored the anti-surcharge bill. "This gentleman called and indicated to the committee that he had been traveling around the states offering testimony in opposition to similar legislation and he wanted to come down.

"I find it rather disturbing," said Berlanga. "I'm appalled that someone from the Department of Energy would come in and interfere with the state's ability to deal with the major oil companies."

State Rep. Lee Jackson, chairman of the committee that held Tuesday's hearing, confirmed Berlanga's account.

"I've never had an out-of-town witness come and ask if they could speak, but our rules are that hearings are open and anyone can speak," he said. "They said they needed something in writing, so I sent them a letter saying they'd be welcome. I assume someone needed that as evidence for reimbursement of travel."

Jackson said he didn't share his fellow Democrat's sense of outrage at Coburn's appearance, noting that the legislature frequently hears witnesses from federal agencies. "We have somewhat selective indignation," he said.

Odle also attributed the complaints to special-interest concerns. "I suspect that there's more concern about the policy as opposed to the methods by which he's doing it," he said.

In his testimony before a Maryland Senate committee, which eventually killed the bill, and a Texas House committee, Coburn said the surcharge puts the cost of credit where it belongs--on the upper- and middle-income customers who use credit cards--rather than on the "poorest segments of our society" and the elderly.

By barring the surcharge, he suggested, a state might force an oil company to drop credit-card programs or pass the costs along to all customers by raising the price of its gasoline to the dealer.

Opponents of the surcharge, or cash discount, say their price comparisons show that both cash and credit-card customers pay less for gasoline at stations that don't offer the discount.

"That discount is the biggest phony in the world. Coburn knows it and so do the oil companies," said Vic Rasheed, executive director of the Service Station Dealers of America, who has sent a formal complaint about Coburn's activities to the DOE inspector general.

The inspector general's office said it is conducting a preliminary investigation into Rasheed's complaint. But the department's ethics officer said he knew of no provision in the DOE standards of conduct that would apply to Coburn's activities