I want to create PAYU API for Checksum generation at the Magento backend and send the Hash key value to Mobile Apps.
You dont need to create an API from scratch for PAY U , you need use to their existing PHP SDK which helps to connect to their REST API.
In Magento create a module with rest api service classes (under Vendor/Module/Api directory) which should be properly configured in Vendor/Module/etc/webapi.xml and Vendor/Module/etc/di.xml.
Create the Model classes which use the PayU PHP SDK to connect with their API and do what you want to do.
Refer this article for information on how to create a REST API in Magento 2
Hope this helps !
PayU has Magento2 module which you can checkout