<!-- BusyBot node reference — https://busybot.net/tools/erpnext/ -->

> Node: ERPNext (`erpnext`) · Action · v1
> Category: Data & Storage · Credentials: ERPNext API (`erpNextApi`)
> Updated: 2026-08-16

# ERPNext

> Perform CRUD operations on ERPNext documents

## Overview

ERPNext is a free and open-source enterprise resource planning (ERP) platform built on the Frappe Framework. This tool provides a generic CRUD interface for any DocType in an ERPNext instance, including Customers, Sales Invoices, Items, Purchase Orders, and any custom DocTypes. It supports creating, reading, updating, deleting, and listing documents with optional field selection and filtering. The API uses token-based authentication with an API key and secret pair.

**Category:** Data & Storage  
**Tool Name:** `erpnext`  
**Version:** 1

**Appearance:** Icon: `lucide-Building` | Color: `#0089FF`

## Node Type

**Action** — processes input items and produces output

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **ERPNext API** credentials.
See the [Credentials Guide](https://busybot.net/credentials/erp-next-api/) for setup instructions.

### Resources

| Resource | Value |
|----------|-------|
| Document | `document` |

### Operations

| Operation | Value | Description |
|-----------|-------|-------------|
| Create | `create` | Create a document |
| Delete | `delete` | Delete a document |
| Get | `get` | Retrieve a document |
| Get Many | `getAll` | Retrieve many documents |
| Update | `update` | Update a document |

### Parameters

#### Document: Create

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| DocType | `string` | Yes | — | The DocType of the document to create (e.g., "Customer", "Sales Invoice", "Item"). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Properties | `fixedCollection` | Yes | `{}` | Field-value pairs for the document to create. At least one property is required. |
| — Field | `string` | No | — | Field name (e.g., "customer_name", "item_code"). Find available fields at your ERPNext DocType definition. |
| — Value | `string` | No | — | The value to store in that field. |

#### Document: Delete

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| DocType | `string` | Yes | — | The DocType of the document to delete (e.g., "Customer", "Sales Invoice", "Item"). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Document Name | `string` | Yes | — | The name (unique ID) of the document to delete. |

#### Document: Get

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| DocType | `string` | Yes | — | The DocType of the document to retrieve (e.g., "Customer", "Sales Invoice", "Item"). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Document Name | `string` | Yes | — | The name (unique ID) of the document to retrieve. |

#### Document: Get Many

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| DocType | `string` | Yes | — | The DocType whose documents to retrieve (e.g., "Customer", "Sales Invoice", "Item"). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Return All | `boolean` | No | `false` | Whether to return all results or only up to a given limit. |
| Limit | `number` | No | `10` | Max number of results to return. _(shown when Return All is `false`)_ |
| Options | `collection` | No | `{}` | Field selection and filtering for the query. |
| — Fields | `string` | No | — | Comma-separated list of fields to return. Use "*" for all fields. Leave empty for default fields (usually just "name"). Example: "name,customer_name,status". |
| — Filters | `fixedCollection` | No | `{}` | Filter conditions for the query. |
| — — Field | `string` | No | — | The field name to filter on (e.g., "status", "customer_name"). Find available fields at your ERPNext DocType definition. |
| — — Operator | `options` | No | `is` | How the field is compared to the value. |
| | | | | Options: `equalsGreater` (EQUALS, or GREATER — `>=`), `equalsLess` (EQUALS, or LESS — `<=`), `is` (`=`), `greater` (`>`), `less` (`<`), `isNot` (`!=`) |
| — — Value | `string` | No | — | Value of the operator condition. |

#### Document: Update

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| DocType | `string` | Yes | — | The DocType of the document to update (e.g., "Customer", "Sales Invoice", "Item"). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Document Name | `string` | Yes | — | The name (unique ID) of the document to update. |
| Properties | `fixedCollection` | No | `{}` | Field-value pairs to update on the document. At least one property is required. |
| — Field | `string` | No | — | Field name to update (e.g., "status", "customer_name"). Find available fields at your ERPNext DocType definition. |
| — Value | `string` | No | — | The value to store in that field. |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. Accepts 1–100. |

## Output Data

The ERPNext document is merged onto the input item's JSON, so the properties you started with remain available alongside the DocType's fields. Binary data on the input item is forwarded.

| Operation | Output |
|-----------|--------|
| `create` | One item per input item, carrying the created document — including the `name` ERPNext assigned, which is the ID every other operation takes. |
| `get` | One item per input item, carrying the document's fields. |
| `update` | One item per input item, carrying the document as it stands after the update. |
| `delete` | One item per input item, carrying ERPNext's delete response. |
| `getAll` | **Fans out** — one output item per document returned. A query that matches nothing emits one item, which is the input item passed through unchanged. |

By default a listing returns only the `name` of each document — set **Fields** to `*`, or to the specific columns you need, to get more back.

Reference fields downstream by their ERPNext field name, e.g. `{{ $json.name }}` or `{{ $json.customer_name }}`.

## Usage Examples

- Create a new Customer in ERPNext
- Retrieve all Sales Invoices with status Active
- Update an Item record by name
- Delete a Purchase Order document
- List all DocTypes with field filtering

## Example Configuration

Create a Customer:

```json
{
  "type": "erpnext",
  "parameters": {
    "resource": "document",
    "operation": "create",
    "docType": "Customer",
    "properties": {
      "customProperty": [
        { "field": "customer_name", "value": "{{ $json.company }}" },
        { "field": "customer_type", "value": "Company" },
        { "field": "customer_group", "value": "Commercial" }
      ]
    }
  }
}
```

Fetch one document by its name:

```json
{
  "type": "erpnext",
  "parameters": {
    "resource": "document",
    "operation": "get",
    "docType": "Sales Invoice",
    "documentName": "{{ $json.invoiceId }}"
  }
}
```

List Sales Invoices over a threshold, returning specific fields:

```json
{
  "type": "erpnext",
  "parameters": {
    "resource": "document",
    "operation": "getAll",
    "docType": "Sales Invoice",
    "returnAll": false,
    "limit": 50,
    "options": {
      "fields": "name,customer,status,grand_total",
      "filters": {
        "customProperty": [
          { "field": "status", "operator": "is", "value": "Overdue" },
          { "field": "grand_total", "operator": "greater", "value": "1000" }
        ]
      }
    }
  }
}
```

Page through every Item in the instance:

```json
{
  "type": "erpnext",
  "parameters": {
    "resource": "document",
    "operation": "getAll",
    "docType": "Item",
    "returnAll": true,
    "options": {
      "fields": "*"
    }
  }
}
```

Update a document's status:

```json
{
  "type": "erpnext",
  "parameters": {
    "resource": "document",
    "operation": "update",
    "docType": "Item",
    "documentName": "{{ $json.name }}",
    "properties": {
      "customProperty": [
        { "field": "disabled", "value": "1" }
      ]
    }
  }
}
```

Delete a document:

```json
{
  "type": "erpnext",
  "parameters": {
    "resource": "document",
    "operation": "delete",
    "docType": "Purchase Order",
    "documentName": "{{ $json.name }}"
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Perform CRUD operations on ERPNext/Frappe Framework documents such as Customers, Invoices, Items, and any other DocType.