(Bloomberg) -- ByteDance Ltd.’s TikTok has struck an agreement to invest in a unit of Indonesia’s GoTo Group and cooperate on an online shopping service, pioneering a template for e-commerce beyond Southeast Asia’s biggest economy.

The Chinese-owned video service has agreed broadly to work with GoTo’s Tokopedia across several areas rather than compete directly with the Indonesian platform, people familiar with the pact said. The pair aim to announce details of that tie-up as soon as next week, the people said, asking not to be identified disclosing a deal before it’s formalized. 

GoTo’s shares erased morning declines to climb as high as 5% in Jakarta. While the two companies have reached an informal agreement, the final details of that alliance are getting hammered out and could change before announcement, the people said. The pact is also subject to regulatory approval and could still fall through, they added.

An investment in Tokopedia will be a first of its kind for TikTok Shop, the rapidly growing arm of ByteDance’s video service that’s making inroads into online shopping from the US to Europe. Its progress in Indonesia against Sea Ltd. and Tokopedia, however, came to a halt when Jakarta — responding to complaints from local merchants — forced TikTok to split payments from shopping in the country.

Now, a tieup with a savvy local operator could provide a model for TikTok as it pursues expansion in other markets such as Malaysia, where the government has signaled a willingness to review the influence of overseas players like TikTok. Bloomberg News reported last month that TikTok and GoTo were discussing a potential investment but another option was a joint venture. That could entail building a new e-commerce platform. Representatives for TikTok and GoTo declined to comment.

Read more: TikTok’s E-Commerce Ambitions Stall as Global Backlash Grows

ByteDance’s ultimate goal is revive its online-shopping service in Southeast Asia’s largest retail arena. TikTok, the only platform immediately affected by Jakarta’s new rules, has halted online shopping to comply with the curbs.

Indonesia is the first and largest market for TikTok Shop. It started the service in Indonesia in 2021 and its instant success with younger, video-first shoppers encouraged it to expand into other markets including the US.

For GoTo, Indonesia’s largest internet company, a deal with TikTok could be risky as it would help a major online-retail rival to operate in the country. But it would also give GoTo a strong global social-media partner in an arrangement that could boost shopping, logistics and payments volumes for both companies.

Chief Executive Officer Patrick Walujo, who took over in June, is trying to bring GoTo to profitability on an adjusted basis by the end of the year to show the ride-hailing and e-commerce company has long-term potential. The managing partner of shareholder Northstar Group is continuing his predecessors’ campaign to reduce losses by slashing jobs, cutting promotions and tightening expense controls.

TikTok has been attempting to engage government officials and other social media companies to figure out a way to restart its e-commerce operations in the country. Indonesian minister Teten Masduki said TikTok has spoken with five companies including Tokopedia, PT Bukalapak.com and Blibli about possible partnerships.

Indonesia is among the first countries in Southeast Asia to push back against TikTok. Navigating the conflict will be pivotal for the company as governments across the world assess how Southeast Asia’s largest nation moves to curb the social media giant’s burgeoning e-commerce presence. TikTok said just months earlier it will invest billions of dollars into the region.

Following the Indonesian restrictions, nearby Malaysia said it is studying the possibility of regulating TikTok and its e-commerce operations. The social media leader is already facing possible bans and scrutiny in the likes of the US, Europe and India on national security concerns.

(Updates with share action in the third paragraph)

©2023 Bloomberg L.P.