ERPNext

App · Accounting & Finance · 23 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 documentCreate a document of any type in ERPNext, such as a lead, a project, a task or a type of your own, from the fields you give.
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.
Delete documentDelete an ERPNext document of any type for good.
Get customerRetrieve a specific customer by name (ERPNext's document id).
Get documentGet one ERPNext document of any type by its name, with all its fields.
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 documentsList ERPNext documents of any type, optionally only those matching filters, in the order you choose.
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.
Update documentChange fields of an ERPNext document of any type.

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": {
    "creation": "2026-11-10 14:32:05.218744",
    "customer_group": "Commercial",
    "customer_name": "Harbor Supply Co",
    "customer_type": "Company",
    "disabled": 0,
    "email_id": "purchasing@example.com",
    "mobile_no": "+1-555-0142",
    "modified": "2026-11-10 14:32:05.218744",
    "name": "Harbor Supply Co",
    "owner": "ops@example.com",
    "territory": "United States"
  }
}

Create document

Create a document of any type in ERPNext, such as a lead, a project, a task or a type of your own, from the fields you give. It is saved as a draft where the type has drafts.

Inputs

Document typedoctypetextRequired
The kind of ERPNext document, such as Lead, Project, Task or a custom type of your own. Pick one, or type its name exactly as ERPNext shows it.
FieldsfieldsobjectRequired
The document's fields and their values, by the names ERPNext uses for them, such as {"lead_name": "Ana Lima", "email_id": "ana@example.com"}. Customize Form in ERPNext lists a type's field names.

Outputs

documentobject
The document as ERPNext saved it, with every field of its type (each under the name ERPNext uses for it, such as lead_name or status)
Example output
{
  "document": {
    "creation": "2026-11-30 09:00:00.000000",
    "doctype": "Lead",
    "modified": "2026-11-30 09:00:00.000000",
    "name": "CRM-LEAD-2026-00001",
    "owner": "Administrator"
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-02 09:12:47.330915",
    "date_of_birth": "1991-04-18",
    "date_of_joining": "2026-11-02",
    "employee_name": "Maya",
    "first_name": "Maya",
    "gender": "Female",
    "modified": "2026-11-02 09:12:47.330915",
    "name": "HR-EMP-00023",
    "owner": "ops@example.com",
    "status": "Active"
  }
}

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": {
    "approval_status": "Draft",
    "company": "Lakeside Goods",
    "creation": "2026-11-10 15:08:51.205667",
    "docstatus": 0,
    "employee": "HR-EMP-00023",
    "employee_name": "Maya",
    "expense_approver": "manager@example.com",
    "expenses": [
      {
        "amount": 142.4,
        "default_account": "Travel Expenses - LG",
        "description": "Train fare to the regional trade show",
        "expense_date": "2026-11-04",
        "expense_type": "Travel",
        "sanctioned_amount": 142.4
      }
    ],
    "modified": "2026-11-10 15:08:51.205667",
    "name": "HR-EXP-2026-00006",
    "owner": "ops@example.com",
    "posting_date": "2026-11-10",
    "status": "Draft",
    "total_claimed_amount": 142.4,
    "total_sanctioned_amount": 142.4
  }
}

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": {
    "creation": "2026-11-10 14:35:40.551209",
    "description": "Steel shelf bracket, 12 in",
    "disabled": 0,
    "is_stock_item": 1,
    "item_code": "SHELF-BRKT-12",
    "item_group": "Products",
    "item_name": "Steel shelf bracket, 12 in",
    "modified": "2026-11-10 14:35:40.551209",
    "name": "SHELF-BRKT-12",
    "owner": "ops@example.com",
    "stock_uom": "Nos"
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-10 15:02:26.774013",
    "docstatus": 0,
    "employee": "HR-EMP-00023",
    "employee_name": "Maya",
    "from_date": "2026-12-21",
    "leave_approver": "manager@example.com",
    "leave_type": "Casual Leave",
    "modified": "2026-11-10 15:02:26.774013",
    "name": "HR-LAP-2026-00004",
    "owner": "ops@example.com",
    "posting_date": "2026-11-10",
    "status": "Open",
    "to_date": "2026-12-22",
    "total_leave_days": 2.0
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-10 14:52:09.481376",
    "currency": "USD",
    "docstatus": 0,
    "due_date": "2026-12-10",
    "grand_total": 650.0,
    "items": [
      {
        "amount": 650.0,
        "item_code": "SHELF-BRKT-12",
        "item_name": "Steel shelf bracket, 12 in",
        "qty": 200.0,
        "rate": 3.25
      }
    ],
    "modified": "2026-11-10 14:52:09.481376",
    "name": "ACC-PINV-2026-00012",
    "outstanding_amount": 650.0,
    "owner": "ops@example.com",
    "posting_date": "2026-11-10",
    "status": "Draft",
    "supplier": "Pinecrest Metals",
    "supplier_name": "Pinecrest Metals"
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-10 14:44:02.317846",
    "currency": "USD",
    "docstatus": 0,
    "grand_total": 650.0,
    "items": [
      {
        "amount": 650.0,
        "item_code": "SHELF-BRKT-12",
        "item_name": "Steel shelf bracket, 12 in",
        "qty": 200.0,
        "rate": 3.25,
        "schedule_date": "2026-11-24",
        "warehouse": "Stores - LG"
      }
    ],
    "modified": "2026-11-10 14:44:02.317846",
    "name": "PUR-ORD-2026-00008",
    "owner": "ops@example.com",
    "schedule_date": "2026-11-24",
    "set_warehouse": "Stores - LG",
    "status": "Draft",
    "supplier": "Pinecrest Metals",
    "supplier_name": "Pinecrest Metals",
    "total_qty": 200.0,
    "transaction_date": "2026-11-10"
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-10 14:47:33.640192",
    "currency": "USD",
    "customer": "Harbor Supply Co",
    "customer_name": "Harbor Supply Co",
    "docstatus": 0,
    "due_date": "2026-12-10",
    "grand_total": 102.0,
    "items": [
      {
        "amount": 102.0,
        "item_code": "SHELF-BRKT-12",
        "item_name": "Steel shelf bracket, 12 in",
        "qty": 12.0,
        "rate": 8.5
      }
    ],
    "modified": "2026-11-10 14:47:33.640192",
    "name": "ACC-SINV-2026-00031",
    "outstanding_amount": 102.0,
    "owner": "ops@example.com",
    "posting_date": "2026-11-10",
    "status": "Draft"
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-10 14:41:18.902551",
    "currency": "USD",
    "customer": "Harbor Supply Co",
    "customer_name": "Harbor Supply Co",
    "delivery_date": "2026-11-17",
    "docstatus": 0,
    "grand_total": 102.0,
    "items": [
      {
        "amount": 102.0,
        "delivery_date": "2026-11-17",
        "item_code": "SHELF-BRKT-12",
        "item_name": "Steel shelf bracket, 12 in",
        "qty": 12.0,
        "rate": 8.5,
        "warehouse": "Stores - LG"
      }
    ],
    "modified": "2026-11-10 14:41:18.902551",
    "name": "SAL-ORD-2026-00017",
    "owner": "ops@example.com",
    "set_warehouse": "Stores - LG",
    "status": "Draft",
    "total_qty": 12.0,
    "transaction_date": "2026-11-10"
  }
}

Delete document

Delete an ERPNext document of any type for good. ERPNext refuses to delete a submitted document (cancel it first) or one that other documents link to.

Inputs

Document typedoctypetextRequired
The kind of ERPNext document, such as Lead, Project, Task or a custom type of your own. Pick one, or type its name exactly as ERPNext shows it.
Document namedocument_nametextRequired
The document's ERPNext name, its ID, such as CRM-LEAD-2026-00001 (shown at the top of the document and in its address).

Outputs

deletedtrue/false
True once ERPNext has deleted it
doctypetext
The deleted document's type
nametext
The deleted document's name
Example output
{
  "deleted": true,
  "doctype": "Lead",
  "name": "CRM-LEAD-2026-00001"
}

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": {
    "creation": "2026-11-10 14:32:05.218744",
    "customer_group": "Commercial",
    "customer_name": "Harbor Supply Co",
    "customer_type": "Company",
    "disabled": 0,
    "email_id": "purchasing@example.com",
    "mobile_no": "+1-555-0142",
    "modified": "2026-11-10 14:32:05.218744",
    "name": "Harbor Supply Co",
    "owner": "ops@example.com",
    "territory": "United States"
  }
}

Get document

Get one ERPNext document of any type by its name, with all its fields.

Inputs

Document typedoctypetextRequired
The kind of ERPNext document, such as Lead, Project, Task or a custom type of your own. Pick one, or type its name exactly as ERPNext shows it.
Document namedocument_nametextRequired
The document's ERPNext name, its ID, such as CRM-LEAD-2026-00001 (shown at the top of the document and in its address).

Outputs

documentobject
The document as ERPNext saved it, with every field of its type (each under the name ERPNext uses for it, such as lead_name or status)
Example output
{
  "document": {
    "creation": "2026-11-30 09:00:00.000000",
    "doctype": "Lead",
    "modified": "2026-11-30 09:00:00.000000",
    "name": "CRM-LEAD-2026-00001",
    "owner": "Administrator"
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-10 14:47:33.640192",
    "currency": "USD",
    "customer": "Harbor Supply Co",
    "customer_name": "Harbor Supply Co",
    "docstatus": 0,
    "due_date": "2026-12-10",
    "grand_total": 102.0,
    "items": [
      {
        "amount": 102.0,
        "item_code": "SHELF-BRKT-12",
        "item_name": "Steel shelf bracket, 12 in",
        "qty": 12.0,
        "rate": 8.5
      }
    ],
    "modified": "2026-11-10 14:47:33.640192",
    "name": "ACC-SINV-2026-00031",
    "outstanding_amount": 102.0,
    "owner": "ops@example.com",
    "posting_date": "2026-11-10",
    "status": "Draft"
  }
}

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": {
    "company": "Lakeside Goods",
    "creation": "2026-11-10 14:41:18.902551",
    "currency": "USD",
    "customer": "Harbor Supply Co",
    "customer_name": "Harbor Supply Co",
    "delivery_date": "2026-11-17",
    "docstatus": 0,
    "grand_total": 102.0,
    "items": [
      {
        "amount": 102.0,
        "delivery_date": "2026-11-17",
        "item_code": "SHELF-BRKT-12",
        "item_name": "Steel shelf bracket, 12 in",
        "qty": 12.0,
        "rate": 8.5,
        "warehouse": "Stores - LG"
      }
    ],
    "modified": "2026-11-10 14:41:18.902551",
    "name": "SAL-ORD-2026-00017",
    "owner": "ops@example.com",
    "set_warehouse": "Stores - LG",
    "status": "Draft",
    "total_qty": 12.0,
    "transaction_date": "2026-11-10"
  }
}

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": [
    {
      "creation": "2026-11-10 14:32:05.218744",
      "customer_group": "Commercial",
      "customer_name": "Harbor Supply Co",
      "customer_type": "Company",
      "disabled": 0,
      "email_id": "purchasing@example.com",
      "mobile_no": "+1-555-0142",
      "modified": "2026-11-10 14:32:05.218744",
      "name": "Harbor Supply Co",
      "owner": "ops@example.com",
      "territory": "United States"
    }
  ]
}

List documents

List ERPNext documents of any type, optionally only those matching filters, in the order you choose.

Inputs

Document typedoctypetextRequired
The kind of ERPNext document, such as Lead, Project, Task or a custom type of your own. Pick one, or type its name exactly as ERPNext shows it.
Fields to returnfieldslist
The field names to return for each document, such as name, lead_name and status. Leave blank for every field.
Filtersfilterslist
Only documents that match, as [field, operator, value] lists, such as [["status", "=", "Open"], ["creation", ">", "2026-01-01"]]. Operators: =, !=, >, <, >=, <=, like, not like, in, not in, is, between. Leave blank for every document.
Sort byorder_bytext
A field name and asc or desc, such as 'modified desc'. Leave blank for ERPNext's usual order, newest change first.
Limitlimitnumber
The most documents to return, up to 500.From 1 to 500. Default: 20.
Offsetoffsetnumber
How many matching documents to skip first.At least 0. Default: 0.

Outputs

countnumber
How many documents were returned
documentslist
The documents, with the fields asked for
Example output
{
  "count": 1,
  "documents": [
    {
      "creation": "2026-11-30 09:00:00.000000",
      "doctype": "Lead",
      "modified": "2026-11-30 09:00:00.000000",
      "name": "CRM-LEAD-2026-00001",
      "owner": "Administrator"
    }
  ]
}

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": [
    {
      "company": "Lakeside Goods",
      "creation": "2026-11-02 09:12:47.330915",
      "date_of_birth": "1991-04-18",
      "date_of_joining": "2026-11-02",
      "employee_name": "Maya",
      "first_name": "Maya",
      "gender": "Female",
      "modified": "2026-11-02 09:12:47.330915",
      "name": "HR-EMP-00023",
      "owner": "ops@example.com",
      "status": "Active"
    }
  ]
}

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": [
    {
      "company": "Lakeside Goods",
      "creation": "2026-11-10 14:47:33.640192",
      "currency": "USD",
      "customer": "Harbor Supply Co",
      "customer_name": "Harbor Supply Co",
      "docstatus": 0,
      "due_date": "2026-12-10",
      "grand_total": 102.0,
      "modified": "2026-11-10 14:47:33.640192",
      "name": "ACC-SINV-2026-00031",
      "outstanding_amount": 102.0,
      "owner": "ops@example.com",
      "posting_date": "2026-11-10",
      "status": "Draft"
    }
  ]
}

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": [
    {
      "creation": "2026-11-10 14:35:40.551209",
      "description": "Steel shelf bracket, 12 in",
      "disabled": 0,
      "is_stock_item": 1,
      "item_code": "SHELF-BRKT-12",
      "item_group": "Products",
      "item_name": "Steel shelf bracket, 12 in",
      "modified": "2026-11-10 14:35:40.551209",
      "name": "SHELF-BRKT-12",
      "owner": "ops@example.com",
      "stock_uom": "Nos"
    }
  ]
}

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": [
    {
      "country": "United States",
      "creation": "2026-09-14 10:05:51.604417",
      "disabled": 0,
      "modified": "2026-10-02 16:20:13.118025",
      "name": "Pinecrest Metals",
      "owner": "ops@example.com",
      "supplier_group": "Raw Material",
      "supplier_name": "Pinecrest Metals",
      "supplier_type": "Company"
    }
  ]
}

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": {
    "creation": "2026-11-10 14:32:05.218744",
    "customer_group": "Commercial",
    "customer_name": "Harbor Supply Co",
    "customer_type": "Company",
    "disabled": 0,
    "email_id": "purchasing@example.com",
    "mobile_no": "+1-555-0199",
    "modified": "2026-11-10 15:20:44.093120",
    "name": "Harbor Supply Co",
    "owner": "ops@example.com",
    "territory": "United States"
  }
}

Update document

Change fields of an ERPNext document of any type. Only the fields you give change. A submitted document only takes changes to fields ERPNext allows after submitting.

Inputs

Document typedoctypetextRequired
The kind of ERPNext document, such as Lead, Project, Task or a custom type of your own. Pick one, or type its name exactly as ERPNext shows it.
Document namedocument_nametextRequired
The document's ERPNext name, its ID, such as CRM-LEAD-2026-00001 (shown at the top of the document and in its address).
Fields to changefieldsobjectRequired
The fields to change and their new values, by the names ERPNext uses for them, such as {"status": "Replied"}.

Outputs

documentobject
The document as ERPNext saved it, with every field of its type (each under the name ERPNext uses for it, such as lead_name or status)
Example output
{
  "document": {
    "creation": "2026-11-30 09:00:00.000000",
    "doctype": "Lead",
    "modified": "2026-11-30 09:00:00.000000",
    "name": "CRM-LEAD-2026-00001",
    "owner": "Administrator"
  }
}

On this page