Pokémon Ultra Sun and Ultra Moon players in Japan will be able to receive Shiny Groudon and Shiny Kyogre via special serial codes that will be distributed next month. The codes will be available from January 13, 2018, at various locations, including Aeon, Tsutaya, Amazon, WonderGoo, Yodobashi and Pokémon Centers until March 5, 2018. Shiny Groudon will be given to Pokémon Ultra Sun players, which Shiny Kyogre can be unlocked in Pokémon Ultra Moon. The codes will work until March 28, 2018.
Source: Official Pokémon website