Japanese e-commerce and entertainment group Rakuten is to receive a $2.2 billion (JPY242 billion) capital injection through a share sale headed by Japan Post, Chinese social media and entertainment group Tencent and Walmart.

The move is intended to help the e-commerce leader strengthen itself and weather competition from Amazon. It comes after Rakuten slipped into loss last year.

Rakuten, which owns video streaming services operating across 12 countries in Europe and Rakuten Viki, is also trying to compete against larger companies on its home turf with its own mobile phones service.

Under the share deal Japan Post will cement its logistics alliance with Rakuten and buy an 8.3% stake. Tencent will buy a 3.65% stake in Rakuten, and Walmart, a chunk just under 1%. Rakuten previously bought 20% of Walmart’s Japanese Seiyu retail chain.

Rakuten and Tencent have been in contact with each other for many years, the Japanese company said in a filing. The areas for potential cooperation are multiple, though Rakuten said that their focus will be “digital entertainment and e-commerce.” Separately Rakuten said that it is looking at expanding online payments, another area where Tencent already has a huge business.

Walmart has expanded from big box retailing into e-commerce and into services, but its entertainment strategy remains in flux. Last year, Walmart agreed to sell its Vudu VOD service to NBCUniversal’s Fandango. But later the retail giant was a bidder for the U.S. components of TikTok when China’s Bytedance was ordered by the former Trump regime to sell. That deal fizzled when TikTok challenged the order and Donald Trump lost the presidency.