How to synchronize an e-commerce site and a pharmacy management software?

Assuming the pharmacy’s inventory management software can be connected to via API of some sort, you will need to write custom scripts which trigger when an order is placed within your WordPress environment.

In case of WooCommerce, read up on the hook woocommerce_checkout_order_processed for example.

Probably most important though – read up on the API documentation of your pharmacy’s existing software.