How to receive data from a POST request in frappe

I am sending post request to frappe API using python script

how could I receive this posted data in frappe, I have tried but it’s not working

When you post to a frappe api method:

If you included parameters in yous post method, the parameters will be passed into the method. The method then uses these parameters to do what it is coded to do.

  1. Do you know the method that you are posting the data to?
  2. What are you trying to achieve with your post? (I see a customer doctype parameter but a education module in the path.)

@fineco Thanks for the reply and yes I know the method to which I am passing data here is complete url

In method post_test I want to Iterate the doc dictionary and insert that record into customer’s doctype
here is the receiving side code which always return false for the moment I just want to check if data received or not ?

try json.dumps(payload) while making the request.
and json.loads( when reading data from request.


make request

r =, data=json.dumps(doc))

read request

def post_test():
    return json.loads(

from frappe import _

def post_test(**kwargs):
	#pack your parameters back into a dictionary
	#auth into erp site
	#use built-in api or other method to add the customer
	make post to URL:

If you intend to just add a customer, as it seems, you may want to authenticate the user and directly use the /api/resource/Customer resource. This should also work if you post via web.@relevant_one method also works for sending the request but returns the incoming parameters before using them.


Thanks a lot @fineco :slight_smile: I works for me.

1 Like