Negative Stock While creating Sales Invoice through RESTapi call

Hi All i am facing big issue while creating sales invoice through REST api call.

http://localhost:9088/api/method/erpnext_magento.pos_api.create_pos_invoices

req data:

{
data:
[
{
“invoice_id”:“POS-0045455445534659454545455456450”,
“customer_name”:“khushal”,
“customer_id”:“CUST098765”,
“posting_date”:“2017-07-02”,
“items”:[
{
“item_code”:“mouse”,
“item_name”:“mouse”,
“rate”:125,
“qty”:2,
“warehouse”:“Stores - I”
}
],
“payments”:[
{
“mode_of_payment”:“Cash”,
“amount”:200
}
],
“taxes”:[
{
“charge_type”:“On Net Total”,
“rate”:7,
“account_head”:“VAT - I”,
“description”:“Testing vat 12”
}
],
“selling_price_list”:“Standard Selling”,
“additional_discount_percentage”:10
}
]
}

it says following error on postman

“message”: {
“status”: “Success”,
“data”: [
{
“status”: “Error”,
“invoice_id”: “POS-004545545645534659454545455456450”,
“traceback”: “Traceback (most recent call last):\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext_magento/erpnext_magento/pos_api.py”, line 164, in create_pos_invoices\n doc.submit()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 723, in submit\n self._submit()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 712, in _submit\n self.save()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 223, in save\n return self._save(*args, **kwargs)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 269, in _save\n self.run_post_save_methods()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 771, in run_post_save_methods\n self.run_method(“on_submit”)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 651, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in composer\n return composed(self, method, *args, **kwargs)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 841, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/model/document.py”, line 645, in \n fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 115, in on_submit\n self.update_stock_ledger()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 334, in update_stock_ledger\n self.make_sl_entries(sl_entries)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 253, in make_sl_entries\n make_sl_entries(sl_entries, is_amended, allow_negative_stock, via_landed_cost_voucher)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 39, in make_sl_entries\n update_bin(args, allow_negative_stock, via_landed_cost_voucher)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/stock/utils.py”, line 96, in update_bin\n bin.update_stock(args, allow_negative_stock, via_landed_cost_voucher)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/stock/doctype/bin/bin.py”, line 52, in update_stock\n }, allow_negative_stock=allow_negative_stock, via_landed_cost_voucher=via_landed_cost_voucher)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 108, in init\n self.build()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 118, in build\n self.raise_exceptions()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 377, in raise_exceptions\n frappe.throw(msg, NegativeStockError, title=‘Insufficent Stock’)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/init.py”, line 309, in throw\n msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/init.py”, line 302, in msgprint\n _raise_exception()\n File “/home/indictrans/Magento/Workspace/frappe-bench/apps/frappe/frappe/init.py”, line 275, in _raise_exception\n raise raise_exception, encode(msg)\nNegativeStockError: 34.0 units of <a href=”#Form/Item/mouse" style=“font-weight: bold;”>Item mouse needed in <a href="#Form/Warehouse/Stores - I" style=“font-weight: bold;”>Warehouse Stores - I to complete this transaction.\n",
“error”: “NegativeStockError('34.0 units of <a href=”#Form/Item/mouse" style=“font-weight: bold;”>Item mouse needed in <a href="#Form/Warehouse/Stores - I" style=“font-weight: bold;”>Warehouse Stores - I to complete this transaction.’,)"
}
]
},
“_server_messages”: “[”{\“message\”: \“34.0 units of <a href=\\\”#Form/Item/mouse\\\" style=\\\“font-weight: bold;\\\”>Item mouse needed in <a href=\\\"#Form/Warehouse/Stores - I\\\" style=\\\“font-weight: bold;\\\”>Warehouse Stores - I to complete this transaction.\", \“indicator\”: \“red\”, \“title\”: \“Insufficent Stock\”}"]"
}

when i send post req in first attemp it says above error when i click again to hit an api it creates SI

help appreciated