Integrated Data With Other Php Website

Hi, I want to integrate my erpnext with my other php based website and Mysql for database. Can i do this?

Is it possible to do it without the API?

Sending data when the document is submitted (trigger with before_submit).

Please explain what steps I should take, thank you.
I Love ERPnext very much, but I am very beginner.

Regards,
Rizqi

Hello @hani.rizqi,

Yes, You can do it. Either you can use inbuilt API or you can develop your own APIs.

There is also concept of webhook in ERPNext.

Hello @bhavikpatel7023, thankyou very much for your response.

Where i can do this? client side? server side? pls tell me how, and give me example.
sorry, i’m newbie.

regards,
hani.rizqi

hello @hani.rizqi

Webhook is doctype is ERPNext and client side you have to make API to handle those data.

Refer this for more information:
https://frappe.io/docs/user/en/guides/integration/webhooks

1 Like

Hello @bhavikpatel7023, thankyou very much for your response

i have read about this Webhook. But, how my php website catch the data from erpnext? just $_POST[‘field_name’] ? or what? I have been trying for hours, but not yet successful.

@hani.rizqi
you will get whole JSON object in one field. $_POST[‘data’] then parse JSON object and access it.

@bhavikpatel7023 How can i access it after i parse JSON object? just call the field name? e.g $_POST[‘customer_name’] ?

@bhavikpatel7023 i have make webhook on Sales Invoice with trigger on_submit. But,how this webhook working? after i submite the Sales Invoice, and then the data will send to my php website (example.site.php) ? Pls tell me. I need this, but not yet solved.

Thankyou very much for your answer

yes if you set event “on_submit”

Hi @Maheshwari_Bhavesh Tank you for your response.

And how my php website catch the data from webhook after data on submit?

Hii @hani.rizqi @Maheshwari_Bhavesh how you catching data from webhook in php side??
i have created webhook but problem is i am not able to catch data in php side.
tried using
$data=$_POST
$data2=$_REQUEST
both not working.

Thanks
Sandeepkumar