Payment Entry REST API

Hi, Will appreciate if someone can share the sample JSON for the Payment Entry; I am trying the below JSON but the record is not getting created

{
“payment_type”: “Receive”,
“naming_series”: “PE-TA-.#####”,
“company”: “Test - Akhilesh”,
“mode_of_payment”: “Cash”,
“party_type”: “Customer”,
“party”: “Bhaskar Jain”,
“party_name”: “Bhaskar Jain”,
“paid_from”: “Debtors-Retail - TA”,
“paid_from_account_currency”: “INR”,
“paid_to_account_balance”: 0,
“paid_to”: “Cash - TA”,
“paid_to_account_currency”: “INR”,
“reference_date”: “2018-05-10”,
“received_amount”: 100,
“paid_amount”: 0,
“source_exchange_rate”: 1,
“received_amount”: 100,
“target_exchange_rate”: 1,
“base_received_amount”: 100,
“reference_no”: “transaction ref no”,
“title”: “Bhaskar Jain”,
“docstatus”: 0,
“remarks”: “”
}

Any Errors ? It could be possible that Link Field is missing

No error. its returning the list of PEs created in the system when the request type is POST

any help is appreciated. Just need to know whether the functionality not available for this document or is it a bug; This is critical for us as we accept Sales Orders from customers and Payment as Payment entry that will get settled when invoicing is done

I’m having some issues with creating a Payment Entry via REST API. I know my credentials are correct and are properly passing to the system as I have tested them by creating other documents. However, with Payment entry, I keep getting the following error:
{
“exception”: “frappe.exceptions.ValidationError: Account: Bank Account Name is not permitted under Payment Entry”,
“exc_type”: “ValidationError”,
exc_source": “erpnext (app)”,
“exc”: "["Traceback (most recent call last):\n File \“apps/frappe/frappe/app.py\”, line 115, in application\n response = frappe.api.handle(request)\n File \“apps/frappe/frappe/api/init.py\”, line 50, in handle\n data = endpoint(**arguments)\n File \“apps/frappe/frappe/api/v1.py\”, line 46, in create_doc\n return frappe.new_doc(doctype, **data).insert()\n File \“apps/frappe/frappe/model/document.py\”, line 309, in insert\n self.run_before_save_methods()\n File \“apps/frappe/frappe/model/document.py\”, line 1140, in run_before_save_methods\n self.run_method(\“validate\”)\n File \“apps/frappe/frappe/model/document.py\”, line 1011, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File \“apps/frappe/frappe/model/document.py\”, line 1371, in composer\n return composed(self, method, *args, **kwargs)\n File \“apps/frappe/frappe/model/document.py\”, line 1353, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File \“apps/frappe/frappe/model/document.py\”, line 1008, in fn\n return method_object(*args, **kwargs)\n File \“apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py\”, line 89, in validate\n self.set_missing_values()\n File \“apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py\”, line 477, in set_missing_values\n acc = get_account_details(self.paid_to, self.posting_date, self.cost_center)\n File \“apps/frappe/frappe/utils/typing_validations.py\”, line 32, in wrapper\n return func(*args, **kwargs)\n File \“apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py\”, line 2724, in get_account_details\n frappe.throw(
(\“Account: {0} is not permitted under Payment Entry\”).format(account))\n File \“apps/frappe/frappe/init.py\”, line 609, in throw\n msgprint(\n File \“apps/frappe/frappe/init.py\”, line 574, in msgprint\n _raise_exception()\n File \“apps/frappe/frappe/init.py\”, line 525, in _raise_exception\n raise exc\nfrappe.exceptions.ValidationError: Account: Chase Checking - Chase is not permitted under Payment Entry\n"]”,
“_server_messages”: “[“{\“message\”: \“Account: Chase Checking - Chase is not permitted under Payment Entry\”, \“title\”: \“Message\”, \“indicator\”: \“red\”, \“raise_exception\”: 1, \”__frappe_exc_id\“: \“36c35cbebad80febe650a86c0ffd4ee12bfc06ab8f0b13d154d6ef39\”}”]”
}
I checked what the error means and it’s basically verifying if the user has permissions to interact with the Bank Account. I have used the Admin account credentials for testing, as well as a test user and I still cannot figure out how to solve this.

Any help will be greatly appreciated :slight_smile:

When you pay it manually through UI from that account does it throw an error?

(post deleted by author)

I tried that, it does not throw an error if I do it manually though the UI

Maybe you’re lucky if that space in front of “ exc_source” is not from a typo in your post.

It could be, but I doubt it, I copy/pasted the error. Not sure what difference would that space would make?