We have been able to do things in a good shape for creating invoice through Frappe REST Api.
However, we are facing an issue with inventory. Like, when the invoice is generated and closed on creation itself, the inventory is not updated properly. The item count doesnt reduce. Instead, it shows 0 and moves ahead.
This is about an entry inside the Stock Ledger - for instance
When Sales Invoice is closed via Rest API, is Submit function called on it? As per the design, stock and account posting on the invoice is only done when it is submitted.
If possible, please share the code and logic written for submission and closure of the invoice.