[Cotlet](https://cotlet.dev/index.md) · [Integrations](https://cotlet.dev/integrations.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Use cases](https://cotlet.dev/use-cases.md) · [Security](https://cotlet.dev/security.md) · [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md) · [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [Contact](https://cotlet.dev/contact.md) · [Pricing](https://cotlet.dev/pricing.md) · [Sign up](https://cotlet.dev/signup)

# Create and submit ERPNext sales invoices from a billing list

> Turn a billing list into ERPNext sales invoices: create missing customers, save drafts, check totals, then submit. Runs weekly in Claude Code or n8n.

Source: https://cotlet.dev/integrations/erpnext-api-mcp-server/create-invoices-from-a-billing-list

Every week the same list lands in a spreadsheet: customer, item, quantity, rate. Someone opens ERPNext, finds or creates each customer and types the lines into a new Sales Invoice one by one.

Cotlet does it in your own ERPNext account with list\_customers, create\_customer, create\_sales\_invoice and submit\_sales\_invoice, called by your AI agent, an n8n workflow or a script.

[Sign up free](https://cotlet.dev/app/signup?app=erpnext) [All ERPNext tools](https://cotlet.dev/integrations/erpnext-api-mcp-server.md)

Hosted · nothing to install or maintain

## Can ERPNext do this on its own?

ERPNext lets you build one invoice at a time in the Sales Invoice form (checked 14 Oct 2026). The REST API can create the same records, but it is a building block: you write the customer lookup, the line items and the submit step yourself. ERPNext has no feature that turns a list of customers and hours into a batch of invoices.

## How you do it in ERPNext today

1. Open Selling > Customer and search for the customer; if there is none, select Add Customer, enter the Customer Name and pick the Customer Type, Customer Group and Territory.
2. Open Accounting > Sales and Receivables > Sales Invoice and click Add Sales Invoice, then choose the Company and the Customer, which brings in the address, currency and price list.
3. Set the Posting Date and the Payment Due Date, then add each line under Items with Quantity and Rate.
4. Add taxes under Sales Taxes and Charges, either by hand or from a template, and read the Grand Total.
5. Save the invoice, which keeps it as a draft with no ledger effect, then click Submit once the amounts are right. Repeat for every customer on the list.

## How to create and submit ERPNext sales invoices from a billing list

Prompt

```
Here is this week's billing list with customer, item, quantity and rate. Create the customers that do not exist yet, create a draft sales invoice for each one with the 10% sales tax template, show me the totals, and submit them after I say OK.
```

1. 01  
### Match every name to a customer  
Your agent looks up each name from the list with list\_customers and writes down the exact Customer ID. A name with two close matches, such as two companies called Northwind, goes back to you instead of being guessed.
2. 02  
### Create only what is missing  
For a name with no match, create\_customer runs with the Customer Type you named in the prompt. Nothing is created twice if the same new customer appears on three lines.
3. 03  
### Save drafts, not invoices  
create\_sales\_invoice saves one draft per customer with its lines, Posting Date, Payment Due Date and tax template. A draft has no ledger effect, so a wrong row costs you nothing yet.
4. 04  
### Show the totals before anything is final  
The agent lists each draft with net total, tax and grand total and checks that the sum of the lines matches your list. It stops here until you reply OK, or runs on if you told it to.
5. 05  
### Submit in a fixed order  
submit\_sales\_invoice runs one invoice at a time, oldest customer first, and reports any invoice ERPNext refuses, for example because a mandatory field on your site is empty. The rest continue.

### What you get back

Example data

```
Billing list: 3 customers
New customers created: 1 (Harbor & Pine, Company)
Drafts created: 3
- ACC-SINV-2026-00042 Northwind Studio: net 1,500.00, tax 150.00, total 1,650.00
- ACC-SINV-2026-00043 Lumen Dental: net 450.00, tax 45.00, total 495.00
- ACC-SINV-2026-00044 Harbor & Pine: net 800.00, tax 80.00, total 880.00
Submitted after your OK: 3 of 3
```

### Other ways to ask

- Create the drafts only and leave them for me to check in ERPNext. Do not submit anything.
- Bill the same three retainers on the first working day of every month, using last month's invoice as the template.
- Create one invoice per row of this CSV and send me the ones where the grand total is above 5,000.
- Find customers on my list that have no invoice since 1 September and draft one for each.

## What ERPNext allows, and what to know first

- ERPNext saves a new Sales Invoice as a draft, and a draft has no effect on the ledger until you click Submit.
- The Payment Due Date on the invoice decides whether it becomes Overdue later, so set it before you submit.
- A submitted or cancelled document cannot be edited, so a wrong submitted invoice has to be cancelled and replaced.
- The Customer on an invoice supplies the billing address, contact, currency, price list and receivable account defaults.
- Creating, submitting and cancelling follow the roles of the signed-in user, so an account that may only create drafts cannot submit.

submit\_sales\_invoice asks for your OK by default. To run it weekly without you, switch confirmation off for that tool in your dashboard.

Sources: [ERPNext Docs: Sales Invoice](https://docs.frappe.io/erpnext/user/manual/en/sales-invoice) · [ERPNext Docs: Customer](https://docs.frappe.io/erpnext/user/manual/en/customer) · [Frappe Docs: Docstatus](https://docs.frappe.io/framework/doctypes/docstatus) · [Frappe Docs: REST API](https://docs.frappe.io/framework/user/en/api/rest)

## Call create\_sales\_invoice from a script

curl

```
curl -X POST https://cotlet.dev/api/v1/erpnext/sales-invoices \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer":"Northwind Studio","items":[{"item_code":"CONSULT-HR","qty":10,"rate":120},{"item_code":"SETUP-FEE","qty":1,"rate":300}],"posting_date":"2026-10-14","due_date":"2026-11-13","taxes_template":"Sales Tax 10% - AC"}'
```

Example response

```
{
"invoice": "ACC-SINV-2026-00042",
"customer": "Northwind Studio",
"status": "Draft",
"docstatus": 0,
"posting_date": "2026-10-14",
"due_date": "2026-11-13",
"currency": "USD",
"items": [
{
"item_code": "CONSULT-HR",
"qty": 10,
"rate": 120,
"amount": 1200
},
{
"item_code": "SETUP-FEE",
"qty": 1,
"rate": 300,
"amount": 300
}
],
"net_total": 1500,
"total_taxes": 150,
"grand_total": 1650
}
```

MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is erpnext\_write → create\_sales\_invoice. Example data.

[Schedule it in n8n, Make, Zapier or cron](https://cotlet.dev/integrations/erpnext-api-mcp-server.md#automations)

## ERPNext tools this automation uses

__Cotlet ERPNext tools used to create and submit ERPNext sales invoices from a billing list__
| Tool | Parameters |
| ---------------------- | ----------------------------------------------------------------------------- |
| list\_customers | search, customer\_group, territory, limit, cursor |
| create\_customer | customer\_name, customer\_type, customer\_group, territory, billing\_currency |
| create\_sales\_invoice | customer, items, posting\_date, due\_date, company, taxes\_template |
| submit\_sales\_invoice | invoice |

[All 13 ERPNext tools with descriptions](https://cotlet.dev/integrations/erpnext-api-mcp-server.md#tools)

## Frequently asked questions

### Does the agent send the invoice to my customer?

No. It creates and submits the Sales Invoice in ERPNext. Sending it by email or sharing a link is a separate step you do in ERPNext or with your own mail tool.

### Is it safe to connect ERPNext to Cotlet?

Yes. You sign in to ERPNext yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get ERPNext once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.

## More ERPNext automations

- [Record customer payments against ERPNext invoices](https://cotlet.dev/integrations/erpnext-api-mcp-server/record-customer-payments.md)
- [Report overdue ERPNext invoices every week](https://cotlet.dev/integrations/erpnext-api-mcp-server/weekly-overdue-invoices-report.md)
- [ERPNext API and MCP server: every tool](https://cotlet.dev/integrations/erpnext-api-mcp-server.md)
- [All use cases](https://cotlet.dev/use-cases.md)

## Give your agent access to ERPNext.

Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with ERPNext.

[Sign up free](https://cotlet.dev/app/signup?app=erpnext)

---

Give your AI agents your signed-in browser.

**Product:** [Integrations](https://cotlet.dev/integrations.md) · [Use cases](https://cotlet.dev/use-cases.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Pricing](https://cotlet.dev/pricing.md) · [Security](https://cotlet.dev/security.md)

**Resources:** [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [GitHub](https://github.com/cotletdev/cotlet)

**Solutions:** [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md)

**Company:** [About](https://cotlet.dev/about.md) · [AI info: company facts](https://cotlet.dev/ai-info.md) · [Contact](https://cotlet.dev/contact.md)

**Legal:** [Terms of service](https://cotlet.dev/terms) · [Privacy policy](https://cotlet.dev/privacy) · [Refund policy](https://cotlet.dev/refunds) · [Acceptable use](https://cotlet.dev/acceptable-use) · [Cookie policy](https://cotlet.dev/cookies) · [DPA](https://cotlet.dev/dpa) · [Subprocessors](https://cotlet.dev/subprocessors)

**Elsewhere:** [Status page](https://status.cotlet.dev) · [Cotlet on GitHub](https://github.com/cotletdev) · [Cotlet on X](https://x.com/cotletdev) · [Cotlet on LinkedIn](https://www.linkedin.com/company/cotletdev) · [Cotlet on Product Hunt](https://www.producthunt.com/products/cotlet) · [Cotlet on Crunchbase](https://www.crunchbase.com/organization/cotlet) · [Cotlet on SaaSHub](https://www.saashub.com/cotlet)

Cotlet is an independent service. It is not affiliated with, endorsed by or sponsored by any of the products listed on this site. Product names are trademarks of their respective owners.

## For AI agents: sign your user up

Is your user asking you to sign them up for Cotlet? You can do it for them, no account or key needed.

1. Read the fields and their allowed values: GET https://cotlet.dev/api/v1/access-requests
2. Ask the user for each value: email, apps, what you will do with them. If they leave the password to you, generate a strong one and show it to them.
3. Show the user what you will send, then POST it as JSON to https://cotlet.dev/api/v1/access-requests.

One call creates the account and sends the access request; we email the user when access is granted.
