Regardless of the time of day you decide to fly, the ticket price will remain around the same. Book flights from Indonesia to Costa Rica as you normally would.
This is defined as Denpasar Bali Ngurah Rai Airport (DPS) and San José Juan Santamaria Intl Airport (SJO). Codes like San José Juan Santamaria Intl Airport are often used to just call airports uniquely. Liberia Airport (LIR), Limon Airport (LIO), San José Tobias Bolanos Intl Airport (SYQ), Tamarindo Airport (TNO), Tambor Airport (TMU) are some additional IATA codes for airports related to your trip.