LOS ANGELES/SAN FRANCISCO (Reuters) - A Hanjin Shipping Co 117930.KS container vessel idled off the coast of Mexico after the company's bankruptcy has received permission to dock and unload cargo at the Port of Long Beach, industry and union officials said Friday.

A Hanjin Shipping Co ship is seen stranded outside the Port of Long Beach, California, U.S., September 8, 2016. REUTERS/Lucy Nicholson - RTX2ORIR

Authorization for the Hanjin Greece to enter the port came after bankruptcy courts in the United States and South Korea cleared the way for the company to spend $10 million to unload cargo from four ships headed for ports on the U.S. West Coast.

South Korea said it expects Hanjin Greece to start unloading cargo on Saturday morning U.S. time. Hanjin could not be immediately reached for a comment.

“We’re looking forward to getting these ships unloaded, said Ray Familathe, vice president of the International Longshore and Warehouse Union representing 20,000 dockworkers.

But he said that could be complicated by legal wrangling. “It’s a day-to-day thing for us,” he said.

U.S. Bankruptcy Judge John Sherwood, who issued an order barring seizure of Hanjin property by creditors, acknowledged that some details remained unresolved and urged the parties to “self-help” and work out problems among themselves.

That could prove thorny. Hanjin has identified 14 U.S.-bound ships in bankruptcy filings, including the Hanjin Greece and two other vessels currently near the Southern California coast.

Port operators, cargo owners, longshoremen, shippers and others all must reach financial agreements with Hanjin before each ship can be docked, officials said.

Terminal operators could be reluctant to allow Hanjin ships to dock without assurances they would leave promptly, said Robert Krieger, president of Krieger Worldwide, a customs broker and freight forwarder headquartered in Carson, California.

“The money is in place to pay for [unloading] as far as I can tell,” Krieger said. “The question is, once that happens, what happens next? Because the terminal operators don’t want the ships to stay there.”

Among other issues raised in court but not fully resolved was what to do with Hanjin containers that are piling up at ports and with retailers.

Some retailers are stuck with empty containers they cannot return to port, said Jonathan Gold, vice president of supply chain and customs policy at the National Retail Federation.

The containers are tying up equipment needed to handle loaded containers, he said.

“Also, the shipper and retailer get charged for not returning the equipment on time, and they cannot return it because the ports wouldn’t accept it,” Gold said. “This is just a completely chaotic situation.”

Union officials said the docking situation seemed to change hourly over the last week, with conflicting reports about where ships might be headed.

“It’s been a really, really fluid situation where it’s very hard to get info about it,” said Barbara Maynard, a spokeswoman for Justice for Port Drivers, a union organizing effort by the Teamsters’ Port Division.

HANJIN CONTAINERS ON SHIPS OWNED BY OTHERS

In South Carolina, ports were trying to sort out what to do with Hanjin containers coming in on ships owned by other firms.

The Charleston port allowed trucking companies to pick up imported Hanjin containers and also allowed exporters to “restuff” them into containers from other carriers, said Clinton Eisenhauer, senior vice president of external affairs for the South Carolina Ports Authority.

Charleston is, however, levying a $350 fee on empty containers brought back to the port to go back to Asia, to cover its labor costs. The fee will be returned to customers if Hanjin eventually covers the costs.

“We decided we didn’t want to make a bad situation worse,” Eisenhauer said.

Hanjin’s bankruptcy has caused a scramble to book new shipments with other container lines, as shippers who expected to move cargo with Hanjin over the coming weeks and months make other arrangements, said Candace Sider, vice president of regulatory affairs in Canada for trade compliance company Livingston International.

“For some companies it may take them weeks to get those appointments in place,” Sider said, adding that shippers risk missing deliveries in time for the holiday season.

FUNDING AND ALTERNATE VESSEL PLANS

To help unload cargo stranded on Hanjin ships, Korean Air Lines 003490.KS, Hanjin Shipping's biggest shareholder, has approved a plan to provide a loan of 60 billion won ($54.16 million) but only if the troubled shipper gives a stake in its Long Beach Terminal as collateral.

However, that would also require approval from the other stakeholder in the terminal - Mediterranean Shipping Co (MSC), a Korean Air spokesman said in Seoul on Saturday.

Meanwhile, the world's top two container shippers, Maersk MAERSKb.CO and MSC, will add vessels on three routes for Asia-North America to fill the void left after Hanjin's collapse, South Korea said. Hyundai Merchant Marine 011200.KS will also cover another Asia-North America route, the government added.

Elsewhere, courts in the United Kingdom and Japan have granted protection from creditors to ships run by Hanjin, the government added. The shipper is also seeking stay orders to prevent creditors from seizing its vessels in other countries, such as Germany and Netherlands.

($1 = 1,107.7300 won)