For the past three weeks a cargo ship laden with butter intended for woefully butter-short Iraq has been drifting around Jordan's port of Aqaba while international bankers work out arrangements for paying for it.

Exporters and contractors who deal with Iraq now demand firm agreements for cash on the line. It is an embarrassing state of affairs for this oil-rich nation which was flush with cash a couple of years ago but now finds itself increasingly having trouble paying its bills.

The clearest result of Iraq's 34-month-old gulf war with Iran is the bankrupting effect it has had on the economy here. The big French, West German, Japanese and South Korean contractors who flocked here during the oil boom to do business with Iraq are being forced to find financing for the billions of dollars in overdue payments they are owed.

"Whether or not Iraq is flat broke nobody really knows," said one western diplomat here. "But certainly they are not awash in cash as they were before."

Saudi Arabia and other Arab gulf states have provided considerable aid to Iraq. Estimates are that their contributions last year totaled more than $20 billion. But the rumors here now are that this amount has dropped. Iraqi President Saddam Hussein suggested as much in a speech last month in which he criticized "certain Arab brothers" for supporting increases in aid when the dangers to them of Iran's crusade to export Islamic fundamentalism increases and reducing aid when it subsides.

When the Persian Gulf war began in September 1980, Iraq was exporting 3.4 million barrels of oil per day and it had foreign exchange reserves estimated at $35 billion. This wealth apparently lulled Saddam Hussein's regime into feeling that it could pursue a guns-and-butter policy, continuing with multibillion dollar development projects while waging a war costing an estimated $1 billion a month. Now they are having trouble paying for butter.

Iran destroyed Iraq's Gulf pipeline early in the war and cut off movement of cargo ships on the Shatt al Arab waterway to the Gulf. Dozens of those ships are neatly lined up in the harbor of the southern Iraqi port city of Basra. Most of their crews have gone home and the hulls of the big boats are beginning to rust.

Syria, an Iranian ally, dealt Iraq a further devastating blow last April when it closed Iraq's oil pipeline to the Mediterranean. Iraq's oil exports are now estimated at fewer than 700,000 barrels a day and the loss of export earnings is taking a toll on the economy.

Iraq's cash reserves had dwindled to about $5 billion by the end of 1982, according to most financial estimates, and the presumption is that they have been further eroded this year. Rumors in Amman, Jordan's capital, and Beirut are that Iraq has sold off $4 billion in gold reserves.

Asked about this recently, Iraq's first Deputy Prime Minister Taha Yassin Ramadan responded, "Iraq has not sold any quantity of its gold reserves."

Iraq has resorted to a variety of tactics in the face of its financial difficulty. Imports have been sharply restricted causing widespread shortages. They have closed down embassies in the Caribbean. Casinos have opened at hotels here to attract foreigners' hard currency and plans have been laid for a national lottery to attract the savings of natives.

The government here has kept the price of dinars, its currency, artifically high while placing restrictions on bringing them in or taking them out. In Beirut, one Iraqi dinar costs $1.40; here the charge is $3.10. It has created a situation where a foreigner abiding by the rules finds that a beer costs $3.72, a pack of cigarets about $5 and a razor $21.

The government has taken further measures to reduce the percentage of salary that the more than 1 million foreign workers can convert from Iraqi dinars into hard currency from 75 percent to 50 percent. That restriction has spawned an elaborate currency black market bringing together foreign workers and foreign visitors.

But mostly Iraq has managed the financial crisis by not paying its bills. A Jordanian trader with a $1.5 million export contract tells of getting paid after six months only after he traveled to Iraq and walked the invoices through the ministries. By then, he said, every cent of his profits had been eaten up by interest costs. But he considers himself luckier than colleagues who have suffered losses. Neither he nor colleagues wants to do business with Iraq again, he said, unless there is cash up front.

Big firms working on multimillion dollar housing and other construction projects have been called to the government offices, told to seek their own financing and forced with their lenders to negotiate deferrals of most payments. The deferrals run into billions of dollars.

By all accounts, the Iraqis have been tough bargainers in the negotiations, pitting companies and countries against one another and reminding them of the reality they know--that they can pull out and lose everything or defer payment in the hope that the war will end and Iraq's economy will be restored to its former health. Further, there is the implication in official statements that those who cooperate now during the tough times will be favorably remembered in the better days.

The pattern of the agreements is to pay all outstanding bills for 1982, 15 percent of 1983 bills, deferring the balance to 1985. Payments for 1984 are not always fully detailed in contracts, according to western diplomats.

London bankers and the French government--both of which have arranged generous loans and arms sales to Iraq--expect Iraq will be able to repay its obligations in 1985 but the European officials do not know how. Few here believe that the war with Iran will end before the death of Ayatollah Ruhollah Khomeini. The desperate hopes for an end to the economic squeeze seem rather to be based on the possibility for internal change in Iran or that, at the least, Syria can be persuaded to reopen the pipeline.

"Are they buying time?" asks one western diplomat on the sidelines of the frenzied rescheduling negotiations. "Are they really going to bail themselves out or are they postponing the inevitable? The biggest if that nobody in this town can answer is when and if the war will end."

Because of long, chilly diplomatic relations between the United States and Iraq, American firms only began doing business here recently as relations warmed up. As a result their exposure is limited.

The French, heavily exposed, are clearly hoping that the new arms they have provided to the Iraqis will somehow be used to bring a decisive result to the war. However, there is a pervasive feeling that the Iraqis have been somewhat timid in taking full advantage of their technological superiority.

Both Iraqi Foreign Minister Tarik Azziz and First Deputy Prime Minister Ramadan have threatened attacks on Iran's oil installations. But such attacks carry wider dangers--Iran has threatened to expand the war to other countries in the area if Iraq attacks its oil facilities.