Code Monkey home page Code Monkey logo

erpnext_rest_api's Introduction

ERPNext GET/POST Request

1. Installation

step 1. Install python 2.7 in your system (Windows,Ubuntu,MAC)
step 2. Download and install easy install for Python (Windows,Ubuntu,MAC)
step 3. To install python requests module(library) open command prompt/terminal and type >easy_install requests
step 4. Clone/Download erpnext_rest_api

2. Running

2.1. GET

2.1.1. Get the list of documents of a particular doctype

Let us assume that we want to get the list of Item(doctype) in ERPNext

  • In command prompt/terminal and navigate to the downloaded erpnext_rest_api folder
  • >python get_doc_list.py Item
  • Response {"data": [{"name":"Kitchen rack"}, {"name":"Iron rods"}, {"name":"Book rack"},{"name":"Plywood"}] }

2.1.2. Get the specific information of a doctype

Let us assume that we want to get the information of an Item Plywood in ERPNext

  • In command prompt/terminal and navigate to the downloaded erpnext_rest_api folder
  • >python get_doc_info.py Item Plywood
  • Response {"data": {"name":"Plywood", "doctype":"Item", "last_purchase_rate":10.0, ...... ...... } }

2.2. Post

2.2.1. Create new element in a document

Let us assume that we want to create new address in ERPNext

  • In command prompt/terminal and navigate to the downloaded erpnext_rest_api folder
  • >python post_to_doc.py
  • Response {"data": {"creation":"2014-07-13 22:04:35.098221", "doctype":"Address", "phone":"012345678", "owner":"Administrator", "city":"BangLORE", "address_line1":"Vijayanagar", "modified_by":"Administrator", "address_title":"Mr.Machha", "name":"Mr.GuruMachha-Billing", "country":"India", ...... ...... } }
  • By this you created new address in your ERPNext
  • To create new element, open post_to_doc.py in any editor and declare data as a dictionary like above and modify as you want
  • Make sure to include mandatory fields in data

erpnext_rest_api's People

Contributors

rahulnejanawar avatar

Watchers

James Cloos avatar Nikhil K A avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.