I need Payment Entry request URL, method and json request details
I’m working on ERPNext API
Frappe REST API is pretty generic and works for any doctype
I read that document
/api/resource/Payment Entry
Request would be
{“doctype”:“Payment Entry”,“naming_series”:“PE-”,“payment_type”:“Receive”,“references”:[{“reference_name”:“SINV-00010”,“total_amount”:“200.0”,“allocated_amount”:“200.0”,“outstanding_amount”:“200.0”}],“paid_to_account_currency”:“USD”,“paid_to”:“IFtin”,“paid_amount”:“200.0”,“received_amount”:“200.0”,“reference_date”:“1/6/2018”,“posting_date”:“2018 06 21 00:00:00”,“reference_no”:“0832414324324”}
i’m getting [unexpected url: /api/resource/Payment Entry]
unexpected error comes due to missing some value
Missing value in json
plz look at this
can you plz send me Payment Entry JSON request format
url: http://frappe.local:8000/api/resource/Payment Entry
cmd:frappe.desk.form.save.savedocs
action:Save
doc:
{"__islocal":1,"total_allocated_amount":424,"naming_series":"PE-","target_exchange_rate":1,"paid_to":"Cash - R","base_paid_amount":424,"paid_to_account_currency":"INR","references":[{"reference_doctype":"Sales Invoice","__islocal":1,"total_amount":424,"due_date":"2018-06-21","reference_name":"VODA-20677","outstanding_amount":424,"idx":1,"parenttype":"Payment Entry","doctype":"Payment Entry Reference","docstatus":0,"allocated_amount":424,"exchange_rate":1,"parentfield":"references","parent":"New Payment Entry 1","name":"New Payment Entry Reference 1"}],"owner":"Administrator","unallocated_amount":0,"allocate_payment_amount":1,"paid_amount":424,"party_type":"Customer","base_total_allocated_amount":424,"party":"9724124613","base_received_amount":424,"source_exchange_rate":1,"doctype":"Payment Entry","paid_from_account_balance":0,"company":"RSA","paid_from":"Debtors - R","party_balance":424,"deductions":[],"party_name":"VINAYAK BOOK AGENCY","docstatus":0,"paid_from_account_currency":"INR","paid_to_account_balance":5333389,"idx":0,"difference_amount":0,"received_amount":424,"payment_type":"Receive","posting_date":"2018-06-21","name":"New Payment Entry 1","__last_sync_on":"2018-06-21T09:04:20.063Z","mode_of_payment":"Cash","__unsaved":1}
i’m using Java for development so i dont know what is cmd and where to give this?
In action we are not using Save we are only using get, post, delete, put.
can you plz let me know how to use it in rest call.
cmd and action is not method which is parameter so you just pass three parameter cmd,action and save same as login api of erpnext.
you need to use POST Method for save document
I’m getting some error
URL is http://212.129.20.137:9001/api/resource/Payment Entry
Data is following
cmd:frappe.desk.form.save.savedocs
action:Save
doc:{“__islocal”:1,“total_allocated_amount”:200,“naming_series”:“PE-”,“target_exchange_rate”:1,“paid_to”:“Cash - R”,“base_paid_amount”:200,“paid_to_account_currency”:“INR”,“references”:[{“reference_doctype”:“Sales Invoice”,“__islocal”:1,“total_amount”:200,“due_date”:“2018-06-21”,“reference_name”:“SINV-00010”,“outstanding_amount”:200,“idx”:1,“parenttype”:“Payment Entry”,“doctype”:“Payment Entry Reference”,“docstatus”:0,“allocated_amount”:200,“exchange_rate”:1,“parentfield”:“references”,“parent”:“New Payment Entry 1”,“name”:“New Payment Entry Reference 1”}],“owner”:“Administrator”,“unallocated_amount”:0,“allocate_payment_amount”:1,“paid_amount”:200,“party_type”:“Customer”,“base_total_allocated_amount”:200,“party”:“9724124613”,“base_received_amount”:200,“source_exchange_rate”:1,“doctype”:“Payment Entry”,“paid_from_account_balance”:0,“company”:“RSA”,“paid_from”:“Debtors - R”,“party_balance”:200,“deductions”:[],“party_name”:“VINAYAK BOOK AGENCY”,“docstatus”:0,“paid_from_account_currency”:“INR”,“paid_to_account_balance”:5333389,“idx”:0,“difference_amount”:0,“received_amount”:200,“payment_type”:“Receive”,“posting_date”:“2018-06-21”,“name”:“New Payment Entry 1”,“__last_sync_on”:“2018-06-21T09:04:20.063Z”,“mode_of_payment”:“Cash”,“__unsaved”:1}
Response{protocol=http/1.1, code=500, message=Internal Server Error, url=http://212.129.20.137:9001/api/resource/Payment%20Entry}
Why i’m getting this error i dont know
can you plz reply for this error report
you used all field same as i give you but you need to change many parameter value like company,paid_to,party_name or many thing…so please check that first.
thanks i’ll try and let u know
I need rest API header for post PaymentEntry