ERP Next API

This week I still continue to look into on how to integrate ERPNext and WooCommerce and after that I tried to run ERPNext VM with VirtualBox. I downloaded ERPNext Production and import it into the VirtualBox. Then, I spend my time trying to find the endpoint to send API request of four basic functions which are Create, Read, Update and Delete. To test this out I am using Client for URLs (cURL) which is a command line tool for getting and sending files using URL syntax. For Read and Delete it was quite easy to find the endpoint but for Create and Update I have to spend some time trying to figure out what is the right syntax. After a few times doing try and error, I found the right syntax for Create and Update.

Here are some examples how to send API request using cUrl :

  • Sending a GET request :

curl -X GET http://example.com/

  • Sending a POST or PUT request :

curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:3000/data

  • Sending a DELETE request :

curl -X DELETE http://example.com/

You may also like...

Leave a Reply