ERPNext
App · Accounting & Finance · 23 actions
Manage customers, suppliers, inventory, sales, purchases and HR in ERPNext, the open-source ERP system.
Actions
| Action | What it does |
|---|---|
| Create customer | Create a new customer in ERPNext. |
| 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. |
| Create employee | Create a new employee record. |
| Create expense claim | Create an employee expense claim. |
| Create item | Create a new inventory item. |
| Create leave application | Submit a leave application for an employee. |
| Create purchase invoice | Create a draft purchase invoice from a supplier. |
| Create purchase order | Create a new purchase order for a supplier. |
| Create sales invoice | Create a draft sales invoice for a customer. |
| Create sales order | Create a new sales order for a customer. |
| Delete document | Delete an ERPNext document of any type for good. |
| Get customer | Retrieve a specific customer by name (ERPNext's document id). |
| Get document | Get one ERPNext document of any type by its name, with all its fields. |
| Get invoice | Retrieve a specific sales invoice by name. |
| Get sales order | Retrieve a specific sales order by name. |
| List customers | Fetch a list of customers from ERPNext. |
| List documents | List ERPNext documents of any type, optionally only those matching filters, in the order you choose. |
| List employees | Fetch a list of employees from ERPNext. |
| List invoices | Fetch a list of sales invoices from ERPNext. |
| List items | Fetch a list of inventory items from ERPNext. |
| List suppliers | Fetch a list of suppliers from ERPNext. |
| Update customer | Update an existing customer's email or phone. |
| Update document | Change fields of an ERPNext document of any type. |
Create customer
Create a new customer in ERPNext.
Inputs
- Customer name
customer_nametextRequired - The customer's name.
- Customer type
customer_typetextRequired - Either 'Individual' or 'Company'.One of:
Individual,Company. - Email
emailtext - The customer's email address.
- Phone
phonetext - 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 type
doctypetextRequired - 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
fieldsobjectRequired - 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 name
employee_nametextRequired - The employee's first name.
- Gender
gendertextRequired - A Gender record in ERPNext, e.g. 'Male' or 'Female'.
- Date of birth
date_of_birthdateRequired - The employee's date of birth.
- Date of joining
date_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
- Employee
employeetextRequired - The employee's ERPNext document name.
- Posting date
posting_datedate - The date the claim is posted. Defaults to today.
- Expenses
expenseslistRequired - 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 approver
expense_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 code
item_codetextRequired - A unique code identifying the item.
- Item name
item_nametextRequired - The item's display name.
- Item group
item_grouptext - The item group this item belongs to. Defaults to 'All Item Groups'.
- Track stock
is_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
- Employee
employeetextRequired - The employee's ERPNext document name.
- From date
from_datedateRequired - The first day of leave.
- To date
to_datedateRequired - The last day of leave.
- Leave type
leave_typetextRequired - The type of leave, e.g. 'Casual Leave'. Every type except 'Leave Without Pay' needs a Leave Allocation covering the dates.
- Leave approver
leave_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
- Supplier
suppliertextRequired - The supplier's ERPNext document name.
- Items
itemslistRequired - 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 date
posting_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
- Supplier
suppliertextRequired - The supplier's ERPNext document name.
- Items
itemslistRequired - 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 date
transaction_datedate - The date the order was placed. Defaults to today.
- Required by
schedule_datedate - The date the goods are needed. Defaults to the order date.
- Target warehouse
warehousetext - 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
- Customer
customertextRequired - The customer's ERPNext document name.
- Items
itemslistRequired - 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 date
posting_datedate - The date the invoice is posted.
- Due date
due_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
- Customer
customertextRequired - The customer's ERPNext document name.
- Items
itemslistRequired - 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 date
transaction_datedate - The date the order was placed.
- Delivery date
delivery_datedate - The date the order is expected to be delivered.
- Source warehouse
warehousetext - 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 type
doctypetextRequired - 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 name
document_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
- Customer
customer_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 type
doctypetextRequired - 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 name
document_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
- Invoice
invoice_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 order
order_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
- Limit
limitnumber - Maximum number of customers to return.From 1 to 500. Default:
10. - Offset
offsetnumber - 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 type
doctypetextRequired - 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 return
fieldslist - The field names to return for each document, such as name, lead_name and status. Leave blank for every field.
- Filters
filterslist - 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 by
order_bytext - A field name and asc or desc, such as 'modified desc'. Leave blank for ERPNext's usual order, newest change first.
- Limit
limitnumber - The most documents to return, up to 500.From 1 to 500. Default:
20. - Offset
offsetnumber - 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
- Limit
limitnumber - 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
- Limit
limitnumber - 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
- Limit
limitnumber - 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
- Limit
limitnumber - 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
- Customer
customer_nametextRequired - The customer's ERPNext document name.
- Email
emailtext - The customer's email address.
- Phone
phonetext - 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 type
doctypetextRequired - 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 name
document_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 change
fieldsobjectRequired - 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"
}
}