Convert sales order to sales invoice an create the sale invoice with the same endpoint

Hello everyone,
I need a help,
i find this endpoint which allow to create a sale invoice from a sale order but when i executed for specific sale order, when i get the list of list invoices i realize that the sale invoice was not added, i think we have to add something in the function make_sales_invoice in order to create it at the same time we call the url/api/method/erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice
but i don’t what and how
please
Thanks