All communication with the ERPNext server happens via web services using HTTP requests and passing data via JSON (Javascript Object Notation). Using web requests you can insert, update, query, run public triggers etc. The basic scheme is as follows:
1. All API calls are to me made to `server.py` on your public folder of your erpnext account. For hosted users, it is (yourdomain.erpnext.com).
1. The `cmd` parameter points to the python function to be executed.
1. Authentication is managed using cookies.
### Authentication
Authentication is done via the login method:
GET server.py?cmd=login&usr=[username]&password=[password]
The login method returns a session id `sid` cookie in the header and a status in the
body of the request. The `sid` cookie must be sent for each subsequent request.
To insert or update documents in ERPNext you have to pass them as a JSON Object. The structure of a Document is a list of plain objects (called `doclist`). The `doclist`
contains the the parent document and any child documents (if they are present).
Example:
[{
"doctype": "Parent"
"key1": "value1"
..
},{
"doctype": "Child",
"parenttype": "Parent",
"parentfield": "children",
"key1", "value1",
..
}]
### webnotes.client
`webnotes.client` is the easiest way to interact with the ERPNext Server. It contains
a bunch of server-side public methods that can be used by any client.