ERPNext

App · Accounting & Finance · 18 actions

Manage customers, suppliers, inventory, sales, purchases and HR in ERPNext, the open-source ERP system.

Actions

ActionWhat it does
Create customerCreate a new customer in ERPNext.
Create employeeCreate a new employee record.
Create expense claimCreate an employee expense claim.
Create itemCreate a new inventory item.
Create leave applicationSubmit a leave application for an employee.
Create purchase invoiceCreate a draft purchase invoice from a supplier.
Create purchase orderCreate a new purchase order for a supplier.
Create sales invoiceCreate a draft sales invoice for a customer.
Create sales orderCreate a new sales order for a customer.
Get customerRetrieve a specific customer by name (ERPNext's document id).
Get invoiceRetrieve a specific sales invoice by name.
Get sales orderRetrieve a specific sales order by name.
List customersFetch a list of customers from ERPNext.
List employeesFetch a list of employees from ERPNext.
List invoicesFetch a list of sales invoices from ERPNext.
List itemsFetch a list of inventory items from ERPNext.
List suppliersFetch a list of suppliers from ERPNext.
Update customerUpdate an existing customer's email or phone.

Create customer

Create a new customer in ERPNext.

Inputs

Customer namecustomer_nametextRequired
The customer's name.
Customer typecustomer_typetextRequired
Either 'Individual' or 'Company'.One of: Individual, Company.
Emailemailtext
The customer's email address.
Phonephonetext
The customer's mobile number.

Outputs

customerobject
The created customer record
Example output
{
  "customer": {
    "name": "example_value"
  }
}

Create employee

Create a new employee record.

Inputs

Employee nameemployee_nametextRequired
The employee's first name.
GendergendertextRequired
A Gender record in ERPNext, e.g. 'Male' or 'Female'.
Date of birthdate_of_birthdateRequired
The employee's date of birth.
Date of joiningdate_of_joiningdate
The employee's start date.

Outputs

employeeobject
The created employee record
Example output
{
  "employee": {
    "name": "example_value"
  }
}

Create expense claim

Create an employee expense claim.

Inputs

EmployeeemployeetextRequired
The employee's ERPNext document name.
Posting dateposting_datedate
The date the claim is posted. Defaults to today.
ExpensesexpenseslistRequired
The claim's expense lines; at least one is required. Each entry needs 'expense_type' (an Expense Claim Type, e.g. 'Travel') and 'amount', and may include 'sanctioned_amount', 'expense_date', 'description' and 'default_account' (needed when the expense type has no default account for the employee's company).
Expense approverexpense_approvertext
The user who approves the claim. Defaults to the employee's expense approver, or the connected ERPNext user.

Outputs

expense_claimobject
The created expense claim
Example output
{
  "expense_claim": {}
}

Create item

Create a new inventory item.

Inputs

Item codeitem_codetextRequired
A unique code identifying the item.
Item nameitem_nametextRequired
The item's display name.
Item groupitem_grouptext
The item group this item belongs to. Defaults to 'All Item Groups'.
Track stockis_stock_itemtrue/false
Whether ERPNext tracks inventory for this item. Stock items need a warehouse on every order; turn this off for services. Defaults to ERPNext's own setting (tracked).

Outputs

itemobject
The created item record
Example output
{
  "item": {}
}

Create leave application

Submit a leave application for an employee.

Inputs

EmployeeemployeetextRequired
The employee's ERPNext document name.
From datefrom_datedateRequired
The first day of leave.
To dateto_datedateRequired
The last day of leave.
Leave typeleave_typetextRequired
The type of leave, e.g. 'Casual Leave'. Every type except 'Leave Without Pay' needs a Leave Allocation covering the dates.
Leave approverleave_approvertext
The user who approves the leave. Defaults to the employee's leave approver, or the connected ERPNext user.

Outputs

leave_applicationobject
The created leave application
Example output
{
  "leave_application": {}
}

Create purchase invoice

Create a draft purchase invoice from a supplier.

Inputs

SuppliersuppliertextRequired
The supplier's ERPNext document name.
ItemsitemslistRequired
The document's line items; at least one is required. Each entry needs 'item_code' and 'qty', and may include 'rate', 'warehouse', and a per-line 'delivery_date' (sales orders) or 'schedule_date' (purchase orders).
Posting dateposting_datedate
The date the invoice is posted.

Outputs

purchase_invoiceobject
The created purchase invoice
Example output
{
  "purchase_invoice": {}
}

Create purchase order

Create a new purchase order for a supplier.

Inputs

SuppliersuppliertextRequired
The supplier's ERPNext document name.
ItemsitemslistRequired
The document's line items; at least one is required. Each entry needs 'item_code' and 'qty', and may include 'rate', 'warehouse', and a per-line 'delivery_date' (sales orders) or 'schedule_date' (purchase orders).
Order datetransaction_datedate
The date the order was placed. Defaults to today.
Required byschedule_datedate
The date the goods are needed. Defaults to the order date.
Target warehousewarehousetext
The warehouse every line is received into unless it names its own. Needed for stock items when the site has no default warehouse.

Outputs

purchase_orderobject
The created purchase order
Example output
{
  "purchase_order": {}
}

Create sales invoice

Create a draft sales invoice for a customer.

Inputs

CustomercustomertextRequired
The customer's ERPNext document name.
ItemsitemslistRequired
The document's line items; at least one is required. Each entry needs 'item_code' and 'qty', and may include 'rate', 'warehouse', and a per-line 'delivery_date' (sales orders) or 'schedule_date' (purchase orders).
Posting dateposting_datedate
The date the invoice is posted.
Due datedue_datedate
The date payment is due.

Outputs

sales_invoiceobject
The created sales invoice
Example output
{
  "sales_invoice": {
    "name": "example_value"
  }
}

Create sales order

Create a new sales order for a customer.

Inputs

CustomercustomertextRequired
The customer's ERPNext document name.
ItemsitemslistRequired
The document's line items; at least one is required. Each entry needs 'item_code' and 'qty', and may include 'rate', 'warehouse', and a per-line 'delivery_date' (sales orders) or 'schedule_date' (purchase orders).
Order datetransaction_datedate
The date the order was placed.
Delivery datedelivery_datedate
The date the order is expected to be delivered.
Source warehousewarehousetext
The warehouse every line ships from unless it names its own. Needed for stock items when the site has no default warehouse.

Outputs

sales_orderobject
The created sales order
Example output
{
  "sales_order": {
    "name": "example_value"
  }
}

Get customer

Retrieve a specific customer by name (ERPNext's document id).

Inputs

Customercustomer_nametextRequired
The customer's ERPNext document name.

Outputs

customerobject
The customer record
Example output
{
  "customer": {}
}

Get invoice

Retrieve a specific sales invoice by name.

Inputs

Invoiceinvoice_nametextRequired
The sales invoice's ERPNext document name.

Outputs

invoiceobject
The sales invoice
Example output
{
  "invoice": {}
}

Get sales order

Retrieve a specific sales order by name.

Inputs

Sales orderorder_nametextRequired
The sales order's ERPNext document name.

Outputs

sales_orderobject
The sales order
Example output
{
  "sales_order": {}
}

List customers

Fetch a list of customers from ERPNext.

Inputs

Limitlimitnumber
Maximum number of customers to return.From 1 to 500. Default: 10.
Offsetoffsetnumber
Number of customers to skip before the first one returned.At least 0. Default: 0.

Outputs

countnumber
Customers returned
customerslist
Customer records
Example output
{
  "count": 1,
  "customers": []
}

List employees

Fetch a list of employees from ERPNext.

Inputs

Limitlimitnumber
Maximum number of employees to return.From 1 to 500. Default: 10.

Outputs

countnumber
Employees returned
employeeslist
Employee records
Example output
{
  "count": 1,
  "employees": []
}

List invoices

Fetch a list of sales invoices from ERPNext.

Inputs

Limitlimitnumber
Maximum number of invoices to return.From 1 to 500. Default: 10.

Outputs

countnumber
Invoices returned
invoiceslist
Sales invoice records
Example output
{
  "count": 1,
  "invoices": []
}

List items

Fetch a list of inventory items from ERPNext.

Inputs

Limitlimitnumber
Maximum number of items to return.From 1 to 500. Default: 10.

Outputs

countnumber
Items returned
itemslist
Item records
Example output
{
  "count": 1,
  "items": []
}

List suppliers

Fetch a list of suppliers from ERPNext.

Inputs

Limitlimitnumber
Maximum number of suppliers to return.From 1 to 500. Default: 10.

Outputs

countnumber
Suppliers returned
supplierslist
Supplier records
Example output
{
  "count": 1,
  "suppliers": []
}

Update customer

Update an existing customer's email or phone.

Inputs

Customercustomer_nametextRequired
The customer's ERPNext document name.
Emailemailtext
The customer's email address.
Phonephonetext
The customer's mobile number.

Outputs

customerobject
The updated customer record
Example output
{
  "customer": {}
}

On this page