Indonesia’s ride-hailing and payments giant Gojek is in advanced discussions about merging with local e-commerce pioneer PT Tokopedia, ahead of a planned initial public offering of the combined entity, according to people with knowledge of the matter.

The country’s two most valuable startups have signed a detailed term sheet to conduct due diligence of each other’s business, said the people, who asked not to be named as the discussions are private. Both sides see potential synergies and are keen to close the deal as soon as possible in coming months, they said.

The merged entity would create an Indonesian internet powerhouse with a combined valuation of more than US$18 billion ($23.7 billion). Its businesses range from ride-hailing and payments to online shopping and delivery -- a local mashup of Uber Technologies Inc., PayPal Holdings Inc., Amazon.com Inc., and DoorDash Inc. It plans to go public in the US and Indonesia.

Gojek and Tokopedia have considered a potential merger since 2018, but discussions accelerated after deal talks between Gojek and arch-rival Grab Holdings Inc. reached an impasse, the people said. Grab Chief Executive Officer Anthony Tan continues to resist pressure from SoftBank Group Corp.’s Masayoshi Son to give up some control in a combined entity with Gojek, said the people.

Southeast Asia’s two most valuable startups -- together worth about US$25 billion -- held on-and-off talks to combine after years of fierce competition in ride-hailing, food delivery and financial technology. As recently as December, the companies were said to have made substantial progress in working out a deal to combine, people with knowledge of the talks told Bloomberg News at the time. But they clashed over how to manage Indonesia, the key market in the region.

Get the latest Singapore corporate news stories for FREE

Son, who had been a steadfast supporter of Tan in the past, is losing patience with the Grab co-founder’s reluctance to cede some control and is now supporting a merger between Gojek and SoftBank-backed Tokopedia, the people said. The two home-grown tech pioneers have common investors, including Google, Temasek Holdings Pte and Sequoia Capital India. Tokopedia is also backed by Alibaba Group Holding Ltd., which has its own e-commerce unit in the region, Lazada.

Representatives of Gojek and Tokopedia declined to comment.

The firms are valued at about US$10.5 billion and about US$7.5 billion, respectively, according to people familiar with their accounts, and merger ratios are currently under discussion. Founders of the two companies have been friends since their inception more than 10 years ago and anticipate an amicable alliance. Grab and Gojek discussions were more contentious and had not progressed enough for them to sign a term sheet, the people said.

A combined Gojek and Tokopedia would dominate in Indonesia, one of the world’s fastest-growing internet economies. Their planned US-listing would provide global investors an alternative to Sea Ltd., the only major Southeast Asian internet company listed in the US Sea’s shares climbed almost 400% last year, boosted by the growing popularity of its mobile gaming and online shopping platform.

A deal between Gojek and Tokopedia is likely to face less regulatory opposition than the deal previously under consideration. The combination of Grab and Gojek would reduce competition in ride-hailing, delivery and digital payments in Southeast Asia, a prospect over which government officials have already expressed reservations.

The companies are contemplating several options for a public offering. They could choose a traditional IPO in Indonesia and the US or work with a blank-check company for the US listing, one of the people said. A handful of blank-check companies have held discussions with the two companies in recent months, the person said.

“Southeast Asia’s unicorns are entering a stage of maturity where investors require an exit, such as a trade sale or IPO,” said Mark Robinson, Asia Pacific head of technology, media and telecom at international law firm Herbert Smith Freehills. “It is driving companies to look at a host of options, some novel and challenging.”

Tokopedia said last month it hired Morgan Stanley and Citigroup Inc. as advisers to help accelerate its plan to go public, following a Bloomberg News report that Bridgetown Holdings Ltd., the blank-check company backed by billionaires Richard Li and Peter Thiel, is considering a potential merger with the e-commerce giant. The special purpose acquisition company is exploring the structure and feasibility of a deal with Tokopedia.

“We have not decided yet which market and method, and are still considering options,” the Jakarta-based company said in a statement on Dec. 16. “SPAC is a potential option that we could consider but we have not committed to anything at the moment.”