In Japanese, there are different ways to acknowledge something (e.g. ok, I understand, got it) with varying levels of politeness. We call this 敬語 (keigo) which stands for honorifics. Here, I will walk you through four common ways to say “ok”:
①わかりました / wakarimashita
You are probably familiar with this expression. If you are speaking to a service provider as a customer or client, using わかりました for acknowledgment is polite enough. Since わかりました comes across as friendly, there are other acknowledgment phrases to use in the context of business.
②了解(りょうかい)/ ryōkai
or
了解(りょうかい)です / ryōkai desu
or
了解(りょうかい)しました / ryōkai shimashita
or
了解(りょうかい)いたしました / ryōkai itashimashita
You might’ve seen this expression in anime and dramas. Although it’s tempting to use this expression because it sounds cool, this one is the trickiest because it’s less polite compared to the basic わかりました. Coworkers can use it for each other (if they have equal status), senior workers can use it for junior workers, and supervisors can use it for their direct report(s). Saying 了解 to your supervisor or senpai (senior colleague) would be inappropriate unless you have a close enough relationship with them.
③承知(しょうち)しました / shōchi shimashita
or
承知(しょうち)いたしました / shōchi itashimashita
This is an expression that you can use for your boss or client. The main nuance this conveys is your understanding.
④かしこまりました / kashikomarimashita
This is another expression that you can also use for your boss or client. The difference is that かしこまりました has more emphasis on respect.
In my experience, the phrases involving 了解(りょうかい) and 承知(しょうち) tend to be used in internal communications (between a supervisor and a direct report), and かしこまりました tends to be used in external communications (between a service provider and a customer/client).
In summary,
かしこまりました is the politest, closely followed by
承知いたしました > 承知しました, then
わかりました, and finally
了解いたしました > 了解しました > 了解です > 了解
As a customer saying that you understand what the service provider is saying, わかりました is suitable.
As a service provider saying that you understand what your customer is saying, かしこまりました is the most appropriate.
As a supervisor saying that you understand what your direct report is saying, 了解しました is acceptable.
As a direct report saying that you understand what your supervisor is saying, 承知いたしました is apt.
Fun fact:
Just like the way in English we shorten “ok” to “k” when we text people close to us, in Japanese some people shorten 「了解(りょうかい)」 to 「りょ」or even just 「り」.