ERPNext

Actions

The ERPNext node allows you to automate work in ERPNext, and integrate ERPNext with other applications. n8n has built-in support for a wide range of ERPNext features, including creating, updating, retrieving, and deleting documents.

On this page, you'll find a list of operations the ERPNext node supports and links to more resources.

Credentials

Refer to ERPNext credentials for guidance on setting up authentication.

Examples and templates

For usage examples and templates to help you get started, take a look at n8n's ERPNext integrations list.

Basic Operations#

Document - Create a document - Delete a document - Retrieve a document - Retrieve all documents - Update a document

Example Usage#

This workflow allows you to create, update, and retrieve a document from ERPNext. You can also find the workflow on n8n.io. This example usage workflow uses the following nodes. - Start - ERPNext

The final workflow should look like the following image.

A workflow with the ERPNext node

1. Start node#

The Start node exists by default when you create a new workflow.

2. ERPNext node (document: create)#

This node will create a new document in ERPNext.

  1. First of all, you'll have to enter credentials for the ERPNext node. You can find out how to do that here.
  2. Select 'Item' from the DocType dropdown list.
  3. Click on the Add Property button.
  4. Select 'Item Name' from the Field dropdown list.
  5. Enter item 1 in the Value field.
  6. Click on the Add Property button.
  7. Select 'Item Code' from the Field dropdown list.
  8. Enter item-1 in the Value field.
  9. Click on the Add Property button.
  10. Select 'Item Group' from the Field dropdown list.
  11. Enter Products in the Value field. Note: Make sure that the item group exists in your ERPNext account.
  12. Click on Execute Node to run the node.

In the screenshot below, you will notice that the node creates a new item with the name item 1.

Using the ERPNext node to create a new item

3. ERPNext1 node (document: addContact)#

This node will add the Item Tax property to the item that we created in the previous node.

  1. Select the credentials that you entered in the previous node.
  2. Select 'Update' from the Operation dropdown list.
  3. Select 'Item' from the DocType dropdown list.
  4. Click on the gears icon next to the Item Name field and click on Add Expression.
  5. Select the following in the Variable Selector section: Current Node > Input Data > JSON > name. You can also add the following expression: {{$json["name"]}}.
  6. Click on the Add Property button.
  7. Select 'Item Tax' from the Field dropdown list.
  8. Enter 5 in the Value field.
  9. Click on Execute Node to run the node.

In the screenshot below, you will notice that the node adds the Item Tax property to the item that we created in the previous node.

Using the ERPNext node to update an item

4. ERPNext2 node (document: get)#

This node will get the information about the item that we created earlier.

  1. Select the credentials that you entered in the previous node.
  2. Select 'Get' from the Operation dropdown list.
  3. Select 'Item' from the DocType dropdown list.
  4. Click on the gears icon next to the Item Name field and click on Add Expression.
  5. Select the following in the Variable Selector section: Current Node > Input Data > JSON > name. You can also add the following expression: {{$json["name"]}}.
  6. Click on Execute Node to run the node.

In the screenshot below, you will notice that the node returns the information of the item.

Using the ERPNext node to return the information an item

 
 

Credentials

You can use these credentials to authenticate the following nodes with Emelia.

Prerequisites#

Using API Key#

  1. Open your ERPNext dashboard page.
  2. Click on Settings on the top and select 'My Settings'.
  3. Scroll down to the bottom of the page and click on API Access.
  4. Click on the Generate Keys button.
  5. Copy the displayed API Secret.
  6. Enter a name for your credentials in the Credentials Name field in the 'ERPNext API' credentials in n8n.
  7. Paste the API Secret in the API Secret field in the 'ERPNext API' credentials in n8n.
  8. Copy the API Key from ERPNext. Note: You might have to refresh the ERPNext window to view the API Key.
  9. Paste the API Key in the API Key field in the 'ERPNext API' credentials in n8n.
  10. Enter the subdomain of your ERPNext account in the Subdomain field in the 'ERPNext API' credentials in n8n. Refer to the FAQs to learn how to get your subdomain.
  11. Click on the Create button to create your credentials in n8n.

FAQs#

How to find the subdomain of an ERPNext account?#

In the address bar of your browser, you can find the subdomain. The string between https:// and .erpnext.com is your subdomain. For example, if the URL in the address bar is https://n8n.erpnext.com, the subdomain will be n8n.