Custom Sales invoice numbering through rest api

Hi ,

I want create a sales invoice through rest api and i am using the below JSON for this. It works fine. But i would like to create invoice with custom invoice numbering not ERPNext numbering. I used name tag and it is not working. Kindly update the solution if available.
“against_income_account”:“Sales - HE”,
“docstatus”: 1,
“company”:“Har ent”,
“customer”:“Kumudham - 1”,
“is_opening”:" No",
“debit_to”:“Debtors - HE”,
“selling_price_list”:“Standard Selling”,

“cost_center”:“Main - HE”,
“warehouse”:“Stores - HE”,
“parenttype”:" Sales Invoice",

“doctype”: “Sales Taxes and Charges”,
“rate”: 5,
“item_wise_tax_detail”: “{"prdocut" Rs.10":[5.0,0.38]}”,
“cost_center”: “Main - HE”,
“description”: “VAT @ 5%”,
“account_head”: “VAT @ 5% - HE”,
“charge_type”: “On Net Total”,
“parenttype”: “Sales Invoice”,
“parentfield”: “taxes”


it is not possible to change or set the name for sales invoice documents through API, You will need to write the auto_name method to achieve that

can you please share the use case?


I have a third party invoicing application which will create and manage the invoices alone. From there i would like to export the invoices, payments to erpnext through REST api. I want to maintain the same invoice number in erpnext as in third party application.

Mohanraj K