Error when passing Serial Number as JSON thru RESTful

Dear all,

I’m trying to create a Purchase Receipt with Serial Number Items to ERPNext thru the RESTful Web-Service API. The Purchase Receipt without Serial Number Items works fine. But I’m having trouble passing the Serial Numbers in the correct format.

When I receive a Purchase Receipt RESTful JSON file FROM ERPNext, multiple serial numbers are passed in one string separated by a line-break. This then looks similar to this:


(In my example 2 Serial Numbers, 111 and 222).
When I pass it back in the same format or also with a space, I’m getting the following error message return from ERPNext: XCE212 Error performing the HTTP-call, HTTP-status is 500, INTERNAL SERVER ERROR {"exc":"[\"Traceback (innermost last):\\n File \\\"/home/erp/frappe-bench/apps/frappe/frappe/\\\", line 74, in application\\n response = frappe.api.handle()\\n File \\\"/home/erp/frappe-bench/apps/frappe/frappe/\\\", line 111, in handle\\n data = json.loads(\\n File \\\"/usr/lib/python2.7/json/\\\", line 338, in loads\\n return _default_decoder.decode(s)\\n File \\\"/usr/lib/python2.7/json/\\\", line 366, in decode\\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\\n File \\\"/usr/lib/python2.7/json/\\\", line 382, in raw_decode\\n obj, end = self.scan_once(s, idx)\\n ValueError: Expecting , delimiter: line 1 column 362 (char 361)\\n\"]"}

It would be great if somebody would have an input about the JSON format which needs to be passed in the serial_no property to ERPNext when using the RESTful API.

Thank you,

It seems, input json is not in required format. You can validate json via


Thank you @saurabh6790 I found the issue, I put it as instead of , now it is working fine.