> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helloleo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ERPNext Integration

> Connect HelloLeo to your ERPNext

Connect your ERPNext, on Frappe Cloud or on your own servers. Leo and your agents then read your ERPNext data live, and change it within the rights you give them.

## What you need

* A user in ERPNext made for HelloLeo, not a person's own account
* The address you open ERPNext at
* A few minutes with an ERPNext administrator

## Prepare ERPNext

**1. Create the user**

In ERPNext, open **User** and add a user for HelloLeo. Give it roles that cover only the data HelloLeo should see or change.

**2. Generate the keys**

Open that user, go to **Settings** → **API Access**, and click **Generate Keys**. Copy the **API key** and the **API secret**. The secret is shown only once: generating keys again replaces it.

**3. Make it reachable**

Frappe Cloud sites are ready. On your own servers, ERPNext must be reachable from the internet, on an address that starts with https.

## Connect in HelloLeo

1. Go to **Project Settings** → **Integrations** and pick **ERPNext**. For an agent, open its **Integrations** panel instead.
2. Fill in:
   * **ERPNext address**: the address you open ERPNext at in your browser, like `https://erp.yourcompany.com`.
   * **API key** and **API secret**: the keys of the user made for HelloLeo.
3. Click **Test connection**, then save.

## Reading and changing data

HelloLeo can do in ERPNext what its ERPNext user is allowed to do, nothing more. To keep it reading only, give that user roles that only read.

An agent also follows its own **Permissions**: you choose what it may do on its own and what waits for you in **Approvals**. Submitting, cancelling or deleting a document is treated as something that cannot be undone.

## Example prompts

```
Which sales orders are still to deliver this week, and for which customers?
```

```
Create a quote for Acme: 4 chairs and 1 table, delivery on the 15th.
```

```
Every Monday, email me the invoices that are overdue, with the amount per customer.
```

## Troubleshooting

### Could not connect

* Check that the address is the one you open ERPNext at, starting with https
* Copy the API key and secret again. If the secret was lost, generate new keys and use both new values
* Check that the user is enabled in ERPNext

### Leo says it may not read something

The ERPNext user's roles leave that data out. Ask your ERPNext administrator to add a role that covers it.

### ERPNext refuses a change

ERPNext checks every change and explains what is missing, like a required field or a customer that does not exist. Leo shows you that message. A submitted document can no longer be edited: cancel it first, then amend it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.