Bulk create using Frappe Rest API

Hello ERPNext Team,

I am working with Frappe Rest in order to generate Sales Invoice. However, we are stuck with this thing where we want to generate Sales Invoice in Bulk.

I read this documentation here - https://frappe.github.io/frappe/user/en/guides/integration/rest_api

This was helpful when we were generating single invoices. However, now when we have to generate bulk invoices, we are not able to do so.

One solution we thought was, to send the array of objects. For instance, if I am creating multiple users -
[
{“first_name”: “Robert 1”},
{“first_name”: “Robert 2”},
{“first_name”: “Robert 3”}
]

But it seems that this is not allowed.

Another way is calling rest call with async. But that doesnt feel to be a good solution.

Is there a way to do this with ease?

Thanks

Try using the data import tool API (using CSVs)

Actually it is not a manual process. We are generating Invoice from our another app which uses rest to create Invoice.

So, we want to generate Invoices in Bulk with a single Rest Call to ERPNext.

Try this:

docs = []
(add docs to list of docs)
(docs will look like [ {"field1": "value1", "field2":"value2"}, {"field1":"value3".....}]

session = [path to FrappeClient class](URL, username, password)
session.bulk_update(docs)

FrappeClient sends a json dump to frappe.client.bulk_update. See here GitHub - frappe/frappe-client: Python library to use Frappe API, best of luck!

I read this documentation here - https://frappe.github.io/frappe/user/guides/integration/rest_api.html
link is 404 page .kindly update links.

@chinmay

refer https://frappe.github.io/frappe/user/en/guides/integration/rest_api