Can't able to create invoice through REST (Postman testing)

I am new to erpnext. I installed frappe and bench in my server. I want to create an invoice through a php website. So I am testing that endpoint with data shown in the following image. But it’s ending up with the error listed below the image.

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 127, in handle
“data”: frappe.get_doc(data).insert().as_dict()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 896, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 797, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1067, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1050, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 791, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 74, in validate
super(SalesInvoice, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 39, in validate
super(SellingController, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 21, in validate
super(StockController, self).validate()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 82, in validate
self.set_total_in_words()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 118, in set_total_in_words
if self.is_rounded_total_disabled() else self.base_rounded_total)
TypeError: bad operand type for abs(): ‘NoneType’

1 Like

Facing the same error. Did you find any solution?

You need to specify the “items”: [] data

1 Like