Special agents of the U.S. Customs office at John F. Kennedy Airport arrested the president of a customhouse brokerage firm for allegedly diverting in excess of $2 million in duties due U.S. Customs.

Matthew Yip, 37, is principal owner of Airway Shipping Co., of Jamaica, Queens, which is said to conduct business at John F. Kennedy Airport.As a licensed customs broker for Samsung International, an importer of electronic equipment, Mr. Yip collected duties from Samsung, based upon its importations, Customs said.

Samsung International is the trading arm of the Samsung Group, South Korea's largest corporation, which produces everything from textiles and ocean tankers to electronics and medical equipment.

Customs said Mr. Yip failed to turn duty payments over to the agency. These illegal practices - violations of Customs regulations and mail fraud - took place from May until October of 1986, Customs said.

An 18-month Customs investigation by Customs auditors and special agents revealed that Mr. Yip used a major portion of the diverted funds for personal as well as other unrelated business expenses, Customs said.

Telephone inquiries turned up no listing for Airway Shipping. Calls to Samsung at its Fort Lee, N.J., office also were unanswered.

A spokeswoman for Customs in New York said the agency was informed by the U.S. attorney's office that Airway Shipping is defunct.

The attorney's office confirmed by telephone that the company, whose address was cited as 149-10 183rd St., Jamaica, Queens, is in bankruptcy.

Mr. Yip was arrested at his home in Muttontown, N.Y., and was scheduled to be arraigned Friday evening in Eastern District of New York, the attorney's office said.

He is charged with Customs and mail fraud.