Automate Sales Order to Invoice and Payment

I am new to ERPnext. I understand the process of Sales Order > Sales Invoice > (Payment Request) > Payment Entry process. But it feels like a monotonous repetitive job.
Say I am selling services(so there is no delivery) through my existing site and collecting payments directly using a Gateway.
How do I get those entries automatically populated into ERPnext?
I tried using the Frappe REST API to create the docs. I am able to create Sales Order. But how do I convert them to Invoice, Automatically Email the invoice to the customers and possibly also record their payment?
I tried
https://<site-base>/api/method/erpnext.selling.doctype.sales_order.make_sales_invoice
but it throws exception
Failed to get method for command erpnext.selling.doctype.sales_order.make_sales_invoice with module 'erpnext.selling.doctype.sales_order' has no attribute 'make_sales_invoice'

You missed extra sales_order in your URL. The correct method is erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice.

I tried the following and it worked.
curl --request GET 'https://<site-base>/api/method/erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice?source_name=SAL-ORD-XXXX' --header 'Authorization: token xxxxx:xxxxxx'

Note that it will just return the “message” with all the Sales Invoice data and it will not create Sales Invoice (even with POST request). To create Sales Invoice use the response from the above request to https:///api/resource/Sales Invoice POST method. Don’t forget to replace “message” with “data” in the request body.