A group of Los Angeles medical marijuana collectives that will be required to shut down under the city’s new ordinance has sued to prevent the law from being enforced, alleging that it “arbitrarily and capriciously” makes their operations illegal.

In two lawsuits filed late Tuesday, 21 collectives challenged the City Council’s decision to allow only those dispensaries that registered with the city in 2007 to stay open. The dispensaries that filed the suits have valid city business licenses but did not register by the deadline or opened afterward.

“We’re not really asking for much,” said David Welch, one of three attorneys representing the dispensaries. “All we’re asking for is to be given due process and to be treated equally.”

The collectives are hoping to win a preliminary injunction before the ordinance takes effect in June to keep the city from denying them the chance to apply to operate dispensaries. The city’s ordinance caps the number of dispensaries at 70, but allows previously registered dispensaries to stay open.

Frank Mateljan, a spokesman for the Los Angeles city attorney’s office, said its lawyers have not reviewed the suits, but added, “We’re ready to defend the city’s ordinance.”

One of the dispensaries is Rainforest Collective in Mar Vista. Dan Halbert, the operator, tried to qualify a referendum to overturn the ordinance but failed to collect enough signatures. “I’m just trying to use our democratic process to establish our rights,” he said. “We just want an opportunity to be involved.”

In the lawsuit, the dispensaries challenge the provision that gives priority to dispensaries that registered in 2007 under a moratorium imposed on new stores. The dispensaries allege that the moratorium expired after 45 days because the council illegally extended it. A local judge agreed with that contention in another case.

“There is no rational basis for the discrimination,” Welch said.

The dispensaries also allege that the ordinance denies them due process by eliminating their property rights, which they say the city acknowledged when it granted them business licenses, required expensive remodeling, collected taxes and took no steps to shut them down.

The basic argument, Welch said, is, “You told me I could do it, or at least licensed me, I relied on your word, and you can’t take my investment away without providing me with due process.”

Welch said he expects to add at least four more dispensaries by next week, but has turned down many others.

“A lot of people don’t qualify for the suit,” he said, “because they tried to hide what they are doing.”

john.hoeffel@latimes.com