ios - create a "Production" certificate programmatically

I am trying to make some automation with the iOS certificate creation. Therefor i am trying to make the whole process of adding/creating an iOS certificate programmatically.

I mainly use Node.js with my projects, and already succeeded in making .pem files, the only problem is somehow sending it to Apple and then downloading the Key to the Keychain Access.

I would like to know if there is a way to communicate with apple developer site/server and do the whole key exchange programmatically.

Let me know if i did not give enough Information or if you have any idea of solving the problem,

Thanks, giorge.