[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)

# ERPNext API and MCP server

> Yes. ERPNext has a full REST API (checked 14 Oct 2026): any record, including customers, sales invoices and payment entries, can be listed, created, updated and deleted, and whitelisted methods can be called. It has no official MCP server, and every site needs its own URL plus an API key and secret, a session login or an OAuth token before a script can call it.

Open source ERP from Frappe Technologies: accounting, sales invoices, payments, customers and stock in one system, run on Frappe Cloud or on your own server.

## What is the ERPNext API?

Cotlet's ERPNext API exposes 13 endpoints for your own ERPNext account: list customers, list items, get stock balance, list sales invoices, get sales invoice, list overdue invoices, list payment entries, create customer, create sales invoice, submit sales invoice, create payment entry, submit payment entry and cancel sales invoice. The list_customers endpoint returns customers with type, group and territory, filtered by name. Each endpoint takes simple JSON inputs like limit, cursor or customer and works both as an operation of the erpnext_read or erpnext_write MCP tool for agents and as a REST call for scripts.

- **Category:** [Invoicing & freelance CRM](https://cotlet.dev/integrations/category/invoicing-freelance-crm.md)
- **Endpoints:** 13 (7 read, 6 write)
- **Updated:** 2026-10-21

Yes. Cotlet is a hosted MCP server and REST API for ERPNext with 13 endpoints (7 read, 6 write): you sign in once in your own cloud browser, your AI agent does the work.

## Does ERPNext have an official API?

Yes. ERPNext has a full REST API (checked 14 Oct 2026): any record, including customers, sales invoices and payment entries, can be listed, created, updated and deleted, and whitelisted methods can be called. It has no official MCP server, and every site needs its own URL plus an API key and secret, a session login or an OAuth token before a script can call it.

| Task | ERPNext official | Cotlet |
|---|---|---|
| Create customers | Yes: POST /api/resource/Customer | Yes |
| Create draft sales invoices | Yes: POST /api/resource/Sales Invoice; a saved invoice is a draft | Yes |
| Submit sales invoices | Yes: Submitted is docstatus 1; the REST page does not describe the submit step, you call it as a method | Yes |
| List overdue invoices | Yes: GET /api/resource/Sales Invoice with filters; Overdue is a status ERPNext sets | Yes |
| Create payment entries against invoices | Yes: POST /api/resource/Payment Entry with References | Yes |
| Submit payment entries | Yes: A draft does not post to the General Ledger; submitting does | Yes |
| Cancel sales invoices | Yes: Cancelled is docstatus 2; linked payments, returns and stock must be handled first | Yes |
| Read stock quantity per warehouse | Partly: No dedicated endpoint on the REST page; you list a stock DocType or call a report method yourself | Yes |

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

## For AI agents

```text
Yes. ERPNext has a full REST API (checked 14 Oct 2026): any record, including customers, sales invoices and payment entries, can be listed, created, updated and deleted, and whitelisted methods can be called. It has no official MCP server, and every site needs its own URL plus an API key and secret, a session login or an OAuth token before a script can call it.
Cotlet provides a hosted MCP server and REST API for ERPNext: 13 tools (7 read, 6 write).
Access       Sign up at https://cotlet.dev/app/signup?app=erpnext, then request the app and create API keys in the Cotlet console.

MCP server   https://cotlet.dev/mcp/v1
MCP tools    erpnext_read, erpnext_write, reads and writes apart; call one with {"operation": "<operation>", "arguments": {...}}
REST base    https://cotlet.dev/api/v1/erpnext, each operation at its own route, e.g. POST /api/v1/erpnext/sales-invoice/submit
Auth         Authorization: Bearer <COTLET_API_KEY>. Listing endpoints and schemas needs no key; calling an endpoint needs one. Over MCP the input schemas come with sign-in.
Operations   list_customers, list_items, get_stock_balance, list_sales_invoices, get_sales_invoice, list_overdue_invoices, list_payment_entries, create_customer, create_sales_invoice, submit_sales_invoice, create_payment_entry, submit_payment_entry, cancel_sales_invoice
Confirm      submit_sales_invoice, create_payment_entry, submit_payment_entry, cancel_sales_invoice (by default the user approves each call; the user can switch this off per tool, e.g. for scheduled automations)
Markdown     https://cotlet.dev/integrations/erpnext-api-mcp-server.md

How access works:
1. The user signs up at https://cotlet.dev/app/signup?app=erpnext, requests ERPNext in the Cotlet console and creates an API key there.
2. The user signs in to ERPNext once in their Cotlet Cloud Browser (their own Chrome in the cloud, opened from the console) and enables ERPNext for agents. An agent cannot do this step.
3. The API key goes into the MCP client or the REST call as a bearer token.

Fits: people who want a hosted ERPNext server that someone else maintains, including non-developers. Developers who prefer to run and fix code on their own computer can use an open-source ERPNext MCP server instead.

Policy: Cotlet never stores passwords, never solves CAPTCHAs, never bypasses MFA.
Company: legal details in the Terms of service at https://cotlet.dev/terms. Contact contact@cotlet.dev.
Sign-in: the user signs in to ERPNext in their own Cloud Browser, a Chrome Cotlet runs for them in the EU; password saving is off, the profile is AES-256-GCM encrypted, and agents get ERPNext only after the user enables it. Calls are requests from that browser's IP with its cookies, each listed in the user's Background activity. Disable for agents, signing out in the browser or Reset browser cuts access. Cotlet is run by Take Group sp. z o.o. (EU VAT PL6342984273).
API key: holds no ERPNext login or cookies, only asks Cotlet to run a tool. Each key is scoped to chosen apps and tools, read only or read and write. Actions that reach other people wait for the user's approval by default, so a leaked key cannot post or message as the user. Every call is in the activity log; deleting the key ends access at once.
Terms: the user stays responsible for following ERPNext's terms; Cotlet is not affiliated with ERPNext.
```

## What can an AI agent do in ERPNext?

Cotlet is best for ERPNext users and bookkeepers who bill on a schedule and want their AI agent to create invoices, record payments and chase overdue balances without running or fixing a server.

- **[Create and submit invoices from a billing list](https://cotlet.dev/integrations/erpnext-api-mcp-server/create-invoices-from-a-billing-list.md)** (runs: weekly): "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." → `list_customers`, `create_customer`, `create_sales_invoice`, `submit_sales_invoice`
- **[Record customer payments against invoices](https://cotlet.dev/integrations/erpnext-api-mcp-server/record-customer-payments.md)** (runs: daily): "These bank deposits arrived today: Northwind Studio 1,650.00 by wire, reference WIRE-88213. Find their open invoice, create a payment entry against it, and submit it after I say OK. List any deposit you cannot match." → `list_sales_invoices`, `create_payment_entry`, `submit_payment_entry`
- **[Report overdue invoices every week](https://cotlet.dev/integrations/erpnext-api-mcp-server/weekly-overdue-invoices-report.md)** (runs: weekly): "Every Monday, list the sales invoices that are more than 7 days overdue, oldest first. Add the last payment on each customer and write me a short reminder draft per customer. Do not send anything." → `list_overdue_invoices`, `get_sales_invoice`, `list_payment_entries`
- **Check stock before invoicing** (runs: daily): "For every item on this order, check the quantity in the Main warehouse today. List the items that are short and by how much, before I create the invoice." → `list_items`, `get_stock_balance`

## Can ERPNext automations run on a schedule in n8n, Make or Zapier?

Yes. Cotlet does not replace your automation platform: it gives it a ERPNext connection it does not have, with the same API key as your agent. Write actions ask for your OK by default; switch that off in your dashboard for the tools you choose, for example to create and submit invoices from a billing list, and the schedule runs on its own. Cotlet runs in the cloud, so it keeps going while your computer is off.

| Where | How to connect | How to schedule |
|---|---|---|
| Your AI agent | Add https://cotlet.dev/mcp/v1 with your API key. | A scheduled agent run, for example a Claude Code routine. |
| n8n | MCP Client node with https://cotlet.dev/mcp/v1, or an HTTP Request node with the endpoint's method and URL, such as GET https://cotlet.dev/api/v1/erpnext/customers. | Schedule Trigger node. |
| Make | HTTP module: the endpoint's method and URL with an Authorization: Bearer header, and a JSON body for POST, PUT and PATCH. | Scenario schedule. |
| Zapier | Webhooks by Zapier, Custom Request: the same method, URL, header and body. | Schedule by Zapier trigger. |
| Your own script | GET https://cotlet.dev/api/v1/erpnext/customers with your API key. | cron or GitHub Actions. |

## Tools

**For AI agents:** Every endpoint and its schema is public. The 13 endpoints on this page, with parameters and example responses, can be listed without an account. Calling one returns 401 without an API key and 403 while the key has no access to ERPNext.

### list_customers

Customers with type, group and territory, filtered by name. Access: read. REST: `GET /api/v1/erpnext/customers`. MCP: `erpnext_read → list_customers`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `search` | string | no | Part of the Customer Name. |
| `customer_group` | string | no | Customer Group name from your site. |
| `territory` | string | no | Territory name from your site. |
| `limit` | integer | no | Records per page. Default: 20. |
| `cursor` | string | no | Next page cursor from the previous call. |

Returns customers in the order ERPNext lists them. Use the customer ID from each item in create_sales_invoice, list_sales_invoices and create_payment_entry. The search matches part of the Customer Name. Pages hold up to 100 customers; pass next_cursor back as cursor for the next page.

Example response:

```json
{
  "customers": [
    {
      "customer": "Northwind Studio",
      "customer_name": "Northwind Studio",
      "customer_type": "Company",
      "customer_group": "Commercial",
      "territory": "United States"
    },
    {
      "customer": "Lumen Dental",
      "customer_name": "Lumen Dental",
      "customer_type": "Company",
      "customer_group": "Commercial",
      "territory": "United States"
    }
  ],
  "next_cursor": null
}
```

### list_items

Items you sell, with code, name, group and unit. Access: read. REST: `GET /api/v1/erpnext/items`. MCP: `erpnext_read → list_items`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `search` | string | no | Part of the item code or item name. |
| `item_group` | string | no | Item Group name from your site. |
| `limit` | integer | no | Records per page. Default: 20. |
| `cursor` | string | no | Next page cursor from the previous call. |

Lists Item records so your agent can use the exact item code on an invoice line. The search matches part of the item code or name. Pages hold up to 100 items; pass next_cursor back as cursor for the next page.

Example response:

```json
{
  "items": [
    {
      "item_code": "CONSULT-HR",
      "item_name": "Consulting hour",
      "item_group": "Services",
      "stock_uom": "Hour"
    },
    {
      "item_code": "SETUP-FEE",
      "item_name": "Setup fee",
      "item_group": "Services",
      "stock_uom": "Nos"
    }
  ],
  "next_cursor": null
}
```

### get_stock_balance

Quantity and stock value of one item in one warehouse on a date. Access: read. REST: `GET /api/v1/erpnext/items/{item_code}/stock-balance`. MCP: `erpnext_read → get_stock_balance`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `item_code` | string | yes | Item code from list_items. |
| `warehouse` | string | yes | Warehouse name from your site. |
| `date` | string | no | YYYY-MM-DD. Default: today. |

Returns the quantity and stock value for one item in one warehouse, the same two figures as Quick Stock Balance in ERPNext (Stock > Tools). Without a date it returns today. It reads one item and one warehouse per call; to check a whole order, call it once per line.

Example response:

```json
{
  "item_code": "WIDGET-100",
  "warehouse": "Main - AC",
  "date": "2026-10-14",
  "quantity": 42,
  "stock_value": 1260
}
```

### list_sales_invoices

Sales invoices with status, due date, total and outstanding amount. Access: read. REST: `GET /api/v1/erpnext/sales-invoices`. MCP: `erpnext_read → list_sales_invoices`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `status` | string | no | Draft, Unpaid, Overdue, Partly Paid, Paid, Credit Note Issued, Return or Cancelled. |
| `customer` | string | no | Customer ID from list_customers. |
| `from_date` | string | no | Posting date from, YYYY-MM-DD. |
| `to_date` | string | no | Posting date to, YYYY-MM-DD. |
| `limit` | integer | no | Records per page. Default: 20. |
| `cursor` | string | no | Next page cursor from the previous call. |

Lists Sales Invoice records, newest posting date first. Filter by status, customer or a posting date range. Status is the value ERPNext shows on the invoice. Outstanding amount is the balance left after payments, credit notes and adjustments. Pages hold up to 100 invoices; pass next_cursor back as cursor for the next page.

Example response:

```json
{
  "invoices": [
    {
      "invoice": "ACC-SINV-2026-00042",
      "customer": "Northwind Studio",
      "posting_date": "2026-10-14",
      "due_date": "2026-11-13",
      "currency": "USD",
      "grand_total": 1650,
      "outstanding_amount": 1650,
      "status": "Unpaid"
    },
    {
      "invoice": "ACC-SINV-2026-00036",
      "customer": "Lumen Dental",
      "posting_date": "2026-09-17",
      "due_date": "2026-10-01",
      "currency": "USD",
      "grand_total": 450,
      "outstanding_amount": 450,
      "status": "Overdue"
    }
  ],
  "next_cursor": null
}
```

### get_sales_invoice

One sales invoice with its lines, taxes, totals and status. Access: read. REST: `GET /api/v1/erpnext/sales-invoice`. MCP: `erpnext_read → get_sales_invoice`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `invoice` | string | yes | Sales Invoice ID from list_sales_invoices or create_sales_invoice. |

Returns the full invoice: customer, dates, every item line with quantity, rate and amount, the tax rows, net and grand totals, outstanding amount and status. docstatus is 0 for a draft, 1 for a submitted invoice and 2 for a cancelled one.

Example response:

```json
{
  "invoice": "ACC-SINV-2026-00036",
  "customer": "Lumen Dental",
  "status": "Overdue",
  "docstatus": 1,
  "posting_date": "2026-09-17",
  "due_date": "2026-10-01",
  "currency": "USD",
  "items": [
    {
      "item_code": "CONSULT-HR",
      "qty": 5,
      "rate": 80,
      "amount": 400
    }
  ],
  "taxes": [
    {
      "description": "Sales Tax",
      "rate": 12.5,
      "tax_amount": 50
    }
  ],
  "net_total": 400,
  "grand_total": 450,
  "outstanding_amount": 450
}
```

### list_overdue_invoices

Invoices with the Overdue status, oldest due date first, with days overdue. Access: read. REST: `GET /api/v1/erpnext/overdue-invoices`. MCP: `erpnext_read → list_overdue_invoices`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `customer` | string | no | Customer ID from list_customers. |
| `min_days_overdue` | integer | no | Only invoices at least this many days past the due date. Default: 1. |
| `limit` | integer | no | Records per page. Default: 20. |
| `cursor` | string | no | Next page cursor from the previous call. |

Returns the invoices ERPNext shows as Overdue: past the due date with a balance remaining. Sorted by due date, oldest first. days_overdue counts from the due date to today. total_outstanding adds the outstanding amounts on the page. Pages hold up to 100 invoices; pass next_cursor back as cursor for the next page.

Example response:

```json
{
  "as_of": "2026-10-14",
  "invoices": [
    {
      "invoice": "ACC-SINV-2026-00031",
      "customer": "Harbor & Pine",
      "due_date": "2026-09-20",
      "days_overdue": 24,
      "currency": "USD",
      "outstanding_amount": 800
    },
    {
      "invoice": "ACC-SINV-2026-00036",
      "customer": "Lumen Dental",
      "due_date": "2026-10-01",
      "days_overdue": 13,
      "currency": "USD",
      "outstanding_amount": 450
    },
    {
      "invoice": "ACC-SINV-2026-00039",
      "customer": "Kestrel Logistics",
      "due_date": "2026-10-05",
      "days_overdue": 9,
      "currency": "USD",
      "outstanding_amount": 1250
    }
  ],
  "total_outstanding": 2500,
  "next_cursor": null
}
```

### list_payment_entries

Payment entries with party, amount, date, reference and state. Access: read. REST: `GET /api/v1/erpnext/payment-entries`. MCP: `erpnext_read → list_payment_entries`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `party` | string | no | Customer ID from list_customers. |
| `payment_type` | string | no | Receive, Pay or Internal Transfer. |
| `state` | string | no | draft, submitted or cancelled. |
| `from_date` | string | no | Posting date from, YYYY-MM-DD. |
| `to_date` | string | no | Posting date to, YYYY-MM-DD. |
| `limit` | integer | no | Records per page. Default: 20. |
| `cursor` | string | no | Next page cursor from the previous call. |

Lists Payment Entry records, newest posting date first. A customer payment has the payment type Receive. state is draft, submitted or cancelled; only submitted entries have posted to the General Ledger. Each entry lists the invoices it is allocated to. Pages hold up to 100 entries; pass next_cursor back as cursor for the next page.

Example response:

```json
{
  "payment_entries": [
    {
      "payment_entry": "ACC-PAY-2026-00018",
      "payment_type": "Receive",
      "party": "Lumen Dental",
      "posting_date": "2026-10-12",
      "paid_amount": 200,
      "mode_of_payment": "Wire Transfer",
      "reference_no": "WIRE-88102",
      "state": "submitted",
      "allocated_to": []
    }
  ],
  "next_cursor": null
}
```

### create_customer

Creates a customer with type, group and territory. Access: write. REST: `POST /api/v1/erpnext/customers`. MCP: `erpnext_write → create_customer`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `customer_name` | string | yes | Customer Name as it should appear on invoices. |
| `customer_type` | string | no | Company, Individual or Partnership. |
| `customer_group` | string | no | Customer Group name from your site. |
| `territory` | string | no | Territory name from your site. |
| `billing_currency` | string | no | Currency code, for example USD. Sets the default currency of new documents. |

Creates a Customer and returns its ID. ERPNext asks for the Customer Name, Customer Type, Customer Group and Territory on the form; pass the ones your site needs, and the call returns ERPNext's own error if a required one is missing. Address and contact are added in ERPNext under Address & Contact. It reaches no one and can be deleted again, so it does not ask for confirmation.

Example response:

```json
{
  "customer": "Harbor & Pine",
  "customer_name": "Harbor & Pine",
  "customer_type": "Company",
  "customer_group": "Commercial",
  "territory": "United States",
  "created": true
}
```

### create_sales_invoice

Saves a draft sales invoice with item lines, dates and a tax template. Access: write. REST: `POST /api/v1/erpnext/sales-invoices`. MCP: `erpnext_write → create_sales_invoice`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `customer` | string | yes | Customer ID from list_customers. |
| `items` | array | yes | Lines as objects: item_code (from list_items), qty and rate. |
| `posting_date` | string | no | YYYY-MM-DD. Default: today. |
| `due_date` | string | no | Payment Due Date, YYYY-MM-DD. Decides when the invoice becomes Overdue. |
| `company` | string | no | Company name. Default: the default company of the signed-in user. |
| `taxes_template` | string | no | Name of a Sales Taxes and Charges template from your site. |

Saves a Sales Invoice as a draft and returns its ID and totals. A draft has no ledger effect and nothing is sent to the customer, and you can delete it in ERPNext, so this call does not ask for confirmation. The customer supplies the address, currency and price list defaults. Net total is the sum of the line amounts. To make the invoice final, call submit_sales_invoice.

Example response:

```json
{
  "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
}
```

### submit_sales_invoice

Submits a draft sales invoice so it posts to the ledger. Access: write, asks the user first. REST: `POST /api/v1/erpnext/sales-invoice/submit`. MCP: `erpnext_write → submit_sales_invoice`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `invoice` | string | yes | Sales Invoice ID from list_sales_invoices or create_sales_invoice. |

Moves a draft Sales Invoice to submitted (docstatus 1). The invoice then affects the books and shows Unpaid until paid, or Overdue after its due date. A submitted invoice cannot be edited; to change it, cancel it with cancel_sales_invoice and create a new draft. The call returns ERPNext's error if a required field is empty. By default you confirm each call; you can switch that off for this tool.

Example response:

```json
{
  "invoice": "ACC-SINV-2026-00042",
  "status": "Unpaid",
  "docstatus": 1,
  "grand_total": 1650,
  "outstanding_amount": 1650,
  "due_date": "2026-11-13"
}
```

### create_payment_entry

Saves a draft Receive payment entry allocated to one or more invoices. Access: write, asks the user first. REST: `POST /api/v1/erpnext/payment-entries`. MCP: `erpnext_write → create_payment_entry`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `party` | string | yes | Customer ID from list_customers. |
| `paid_amount` | number | yes | Amount received, in the currency of the bank account. |
| `mode_of_payment` | string | no | Mode of Payment name from your site. |
| `posting_date` | string | no | YYYY-MM-DD. Default: today. |
| `reference_no` | string | no | Bank or cheque reference. |
| `reference_date` | string | no | Date on the bank reference, YYYY-MM-DD. |
| `invoices` | array | no | Sales Invoice IDs to allocate the payment to, oldest due date first. |

Saves a Payment Entry with the payment type Receive, the customer as party, the Mode of Payment, the bank Reference No and Reference Date, and the invoices it pays under References. A draft does not post to the General Ledger; call submit_payment_entry for that. If the amount is larger than the invoices, the remainder stays as an unallocated advance. By default you confirm each call; you can switch that off for this tool.

Example response:

```json
{
  "payment_entry": "ACC-PAY-2026-00021",
  "payment_type": "Receive",
  "party": "Northwind Studio",
  "status": "Draft",
  "docstatus": 0,
  "posting_date": "2026-10-14",
  "paid_amount": 1650,
  "mode_of_payment": "Wire Transfer",
  "reference_no": "WIRE-88213",
  "reference_date": "2026-10-13",
  "allocated_to": [
    {
      "invoice": "ACC-SINV-2026-00042",
      "allocated_amount": 1650
    }
  ],
  "unallocated_amount": 0
}
```

### submit_payment_entry

Submits a draft payment entry so it posts to the General Ledger. Access: write, asks the user first. REST: `POST /api/v1/erpnext/payment-entry/submit`. MCP: `erpnext_write → submit_payment_entry`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `payment_entry` | string | yes | Payment Entry ID from list_payment_entries or create_payment_entry. |

Moves a draft Payment Entry to submitted. Submitting creates the General Ledger entries: debit to Bank or Cash, credit to the customer receivable. The allocated invoices then show Partly Paid or Paid. To reverse it, cancel the entry in ERPNext. By default you confirm each call; you can switch that off for this tool.

Example response:

```json
{
  "payment_entry": "ACC-PAY-2026-00021",
  "status": "Submitted",
  "docstatus": 1,
  "paid_amount": 1650,
  "allocated_to": [
    {
      "invoice": "ACC-SINV-2026-00042",
      "allocated_amount": 1650,
      "invoice_status": "Paid"
    }
  ]
}
```

### cancel_sales_invoice

Cancels a submitted sales invoice and reverses its ledger entries. Access: write, asks the user first. REST: `POST /api/v1/erpnext/sales-invoice/cancel`. MCP: `erpnext_write → cancel_sales_invoice`.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `invoice` | string | yes | Sales Invoice ID from list_sales_invoices or create_sales_invoice. |

Moves a submitted Sales Invoice to cancelled (docstatus 2) and reverses its ledger effects. ERPNext's guide says to handle linked payments, returns and stock transactions first; the call returns ERPNext's error if something still links to the invoice. A cancelled invoice cannot be edited, so create a new draft to replace it. By default you confirm each call; you can switch that off for this tool.

Example response:

```json
{
  "invoice": "ACC-SINV-2026-00042",
  "status": "Cancelled",
  "docstatus": 2
}
```

## How do I connect ERPNext to Claude Code, Codex or Cursor?

Connecting ERPNext takes three steps: sign up, sign in to ERPNext once in your Cloud Browser and enable it for agents, then add one MCP server or call the REST API with the same key.

### Connect ERPNext to your agent.

1. **Create an account** Sign up and add ERPNext in the console. Your API key is there too.

2. **Sign in to ERPNext in your Cloud Browser** Open your Cloud Browser in the console: your own Chrome in the cloud. Sign in to ERPNext there yourself, the way you always do, then press Enable for agents, read only or read and write. We never save your password, and your agent keeps working even when your computer is off.

3. **Add Cotlet to your agent** Paste the snippet for your client. The same server and key serve every app you connect, so you do this once.

   Claude Code:

```
claude mcp add --transport http cotlet \
  https://cotlet.dev/mcp/v1 \
  --header "Authorization: Bearer $COTLET_API_KEY"
```

   Cursor:

```
{
  "mcpServers": {
    "cotlet": {
      "url": "https://cotlet.dev/mcp/v1",
      "headers": {
        "Authorization": "Bearer ${COTLET_API_KEY}"
      }
    }
  }
}
```

   Codex:

```
# ~/.codex/config.toml
[mcp_servers.cotlet]
url = "https://cotlet.dev/mcp/v1"
bearer_token_env_var = "COTLET_API_KEY"
```

4. **Ask your agent** Ask in plain words. Your agent finds the ERPNext tools on the server and calls them for you; anything that reaches other people waits for your OK unless you switch that off for a tool.

```
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.
```

### Call ERPNext from your scripts.

1. **Export your API key** Your scripts use the same API key as your agent. Keep it in an environment variable, never in your code.

```
export COTLET_API_KEY="cotlet_..."
```

2. **Call a tool** Every tool is an endpoint under /api/v1/erpnext with its own method and path, listed with the endpoints above. Path parameters go in the URL; the other parameters go in the query for GET and DELETE and in a JSON body otherwise.

```
curl -X POST https://cotlet.dev/api/v1/erpnext/sales-invoice/submit \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invoice":"ACC-SINV-2026-00042"}'
```

3. **Read the result** You get plain JSON back, ready for your script. A failed call costs nothing.

```
{
  "invoice": "ACC-SINV-2026-00042",
  "status": "Unpaid",
  "docstatus": 1,
  "grand_total": 1650,
  "outstanding_amount": 1650,
  "due_date": "2026-11-13"
}
```

## Why use Cotlet for ERPNext?

**Built for agents**

- One MCP server for every app you connect.
- The same tools as a REST API for scripts and cron jobs.
- Works with Claude Code, Codex and Cursor.

**Your login stays yours**

- You sign in to ERPNext yourself, in your own Cloud Browser. We never save your password; the profile is encrypted with AES-256-GCM, the cipher 1Password uses.
- A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory.
- The model never sees a login.
- No stored passwords, no CAPTCHA solving, no MFA bypass.

**You stay in control**

- Scope each API key: its apps, its tools, read only or read and write.
- Anything that reaches other people waits for your OK, so a leaked key cannot post or message as you.
- Every background request listed in your Background activity. Disable for agents in one click.

**Kept working for you**

- We test every integration every 6 hours.
- When ERPNext changes, the tool pauses until we fix it.
- Failed calls cost nothing.

## Is it safe to connect ERPNext to Cotlet?

Yes. You sign in to ERPNext yourself, in your own Cloud Browser, and we never save your password. Your agents only get ERPNext once you enable it, and every background request is listed. The browser profile is stored encrypted with AES-256-GCM, the same cipher 1Password uses for its vaults and Apple for iCloud Keychain. Independent public scanners grade cotlet.dev A+ and find it clean; click a result to rerun it yourself.

- **A+ on Qualys SSL Labs**: Encryption in transit: TLS setup and certificates, on all four server addresses. [Live result](https://www.ssllabs.com/ssltest/analyze.html?d=cotlet.dev)
- **A+ on securityheaders.com**: Browser protections sent with every page, all six headers present. [Live result](https://securityheaders.com/?q=cotlet.dev&followRedirects=on)
- **A+ on Mozilla Observatory**: Mozilla's web security baseline: score 120 of 100, 12 of 12 tests passed. [Live result](https://developer.mozilla.org/en-US/observatory/analyze?host=cotlet.dev)
- **Clean on Sucuri SiteCheck**: No malware, spam or defacement, and not on any of 9 blocklists, Google Safe Browsing included. [Live result](https://sitecheck.sucuri.net/results/cotlet.dev)

[How Cotlet protects your access](https://cotlet.dev/security.md)

### Common concerns

**Who runs Cotlet?**

Cotlet is run by Take Group, a Polish software company working since 2019. Take Group runs about 3,200 websites on its own systems and has its own DevOps team for infrastructure security. We built and used integrations like this inside the company for years before opening them as Cotlet.

**Is this an official ERPNext integration?**

No, Cotlet is independent of ERPNext. ERPNext's own API is too limited for this work. Cotlet works through your own ERPNext account, the way you use ERPNext in the browser, so you need no partner approval and no developer setup.

**What about client data and GDPR?**

Cotlet is run from the EU and follows the GDPR. Cloud Browsers run in Finland, a Tier 1 country in the ITU Global Cybersecurity Index 2024. Data passes through a call and is not kept after it.

**Can I start with read only?**

Yes. Enable the app for agents as read only, or make the API key read only, and anything that reaches other people waits for your OK unless you switch that off per tool.

**Is it reliable?**

Every Cotlet service is checked every 3 minutes from Europe, North America, Asia and Australia. The live results and any outage are public at status.cotlet.dev.

**How do I stop?**

Press Disable for agents next to ERPNext in your console: your agents lose access at once and you stay signed in. Signing out of ERPNext in the browser works too, and Reset browser deletes the whole profile.

## Is there a ERPNext MCP server on GitHub?

Yes. Community ERPNext MCP servers exist on GitHub, usually maintained by one person. You install one on your own computer, give it an API key and secret from your site, and keep it running yourself; when ERPNext changes or your site is upgraded, it can stop working until you or the maintainer fix it. The official REST API is the other route: you generate keys and write every call yourself. Cotlet hosts the same kind of server for you, signs in to your ERPNext site in a browser, and our team keeps it working.

|  | GitHub MCP server | Cotlet |
|---|---|---|
| Setup | Generate an API key and secret for a user, install the server, add its credentials to each MCP client | Sign up, sign in to your ERPNext site once, add one MCP server or API key |
| When ERPNext changes | It breaks until you or the maintainer fix it | Our team tests it daily and fixes it for you; failed calls are free |
| Your ERPNext access | API key and secret in a file on your computer, valid until you revoke them | Signed in inside your own Cloud Browser in the EU, profile encrypted, only for the apps you enable, disabled for agents in one click |
| When access expires | Tools fail until you replace the keys or sign in again by hand | Your Cloud Browser keeps you signed in; if ERPNext logs you out, your agent gets a link to sign in again |
| Upkeep | You update, monitor and debug it yourself | Nothing to host or update |
| Where it runs | Your computer, while it is on | Hosted: Claude Code, Codex, Cursor, n8n and scripts, also on a schedule |
| Price | Free, paid for with your time | Free 7-day trial, then pay-as-you-go credit packs, no subscription |

### Which one fits you

**Pick Cotlet if**

- you are not a developer, or you do not want to maintain a server
- you need it to keep working when ERPNext changes, without checking it yourself
- your agent or a script should run it on a schedule, also while your computer is off

**Pick an open-source server if**

- you are comfortable installing, updating and fixing it yourself
- you want your sign-in to stay on your own computer
- you only need it now and then, from one MCP client

## How much does the ERPNext API cost?

Free 7-day trial with 2,000 credits, no card needed. After that, the ERPNext API is pay as you go with no limit on apps: Credit packs from $29 for 5,000 credits, one-time, no subscription. A successful call uses 20 to 30 credits (25 for most tools, about $0.10 to $0.15), your Cloud Browser uses 50 credits a day while it has an app enabled for agents, however many apps that is, and an agent driving the browser itself uses 5 credits a minute. Credit packs stay valid for 12 months and stack, so unused credits carry over.

| Credits | Price, one time | Calls at 25 credits | Per 1,000 credits |
|---|---|---|---|
| 5,000 | $29 | 200 | $5.80 |
| 15,000 | $79 | 600 | $5.27 |
| 32,000 | $149 | 1,280 | $4.66 |
| 60,000 | $249 | 2,400 | $4.15 |

Only successful calls use credits; failed calls and timeouts cost nothing. At a balance of 0 calls pause, never a surprise charge. Authenticate with the `Authorization: Bearer` header. [See full pricing](https://cotlet.dev/pricing.md)

## How Cotlet holds your access

Cotlet hosts MCP servers and REST APIs for apps with no usable API. Your agent works in your own ERPNext account.

- **Company details:** Cotlet is run by Take Group sp. z o.o., a company registered in Poland. Its full address and registration numbers are in the Terms of service. [Terms of service](https://cotlet.dev/terms)
- **Your sign-in:** You sign in to ERPNext yourself, in your own Cloud Browser: a Chrome we run for you in the EU, one per app. We never save your password (password saving is off), the profile is stored encrypted with AES-256-GCM, and your agents get ERPNext only after you enable it. When ERPNext signs you out, your agent gives you a link to sign in again. [Security](https://cotlet.dev/security.md)
- **Revoking access:** Press Disable for agents next to ERPNext, sign out of ERPNext in your Cloud Browser, or reset the browser. Every background request is listed in your Background activity. Actions that reach other people wait for your OK unless you switch that off per tool.
- **What we never do:** Store passwords, solve CAPTCHAs or bypass MFA.
- **ERPNext's terms:** You use your own ERPNext account and stay responsible for following ERPNext's terms. Cotlet is independent and not affiliated with ERPNext. [Terms](https://cotlet.dev/terms)
- **Contact:** Questions about the company, security or an app: [contact@cotlet.dev](mailto:contact@cotlet.dev)

## Frequently asked questions

**How do I get access?**

Sign up free, open ERPNext in the console and press Request access. Then you create your API key and connect ERPNext there.

**Do I need to be technical?**

No. You sign in to ERPNext once in your Cloud Browser, a normal Chrome you open from the console, and paste one command into your agent, or one URL into n8n. Your agent can walk you through it. There is no server to install, update or fix.

**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.

**Is a hosted server safer than a local one? My ERPNext sign-in would leave my computer.**

On Cotlet you sign in inside your own Cloud Browser, which only you open, and its profile is stored encrypted with AES-256-GCM in the EU. Agents get only the apps you enable, and every background request is listed. A local server keeps your ERPNext cookie in a plain file on your computer, readable by any program you run, and stops when your computer is off.

**Why does Cotlet send requests instead of clicking in my browser?**

To be fast, Cotlet doesn't click through ERPNext's pages. It sends the same requests your browser would, from your browser's IP with its cookies, without opening a window. ERPNext sees the same browser and IP you signed in with, and every request is listed in your Background activity.

**What if someone gets my Cotlet API key?**

The key holds no ERPNext login or cookies, it only asks Cotlet to run a tool. It can call only the apps and tools you gave it, and a read-only key changes nothing. Anything that reaches other people, like posts, comments or messages, waits for your OK in the dashboard by default, so a leaked key cannot post or message as you. When you switch approval off for a scheduled job, give that job its own key limited to that one tool. Every call is in your activity log, and deleting the key ends access at once.

**Why a signed-in browser and not OAuth, like other integration platforms?**

ERPNext offers no OAuth token you can simply grant for these tools: its official API leaves them out or needs a developer app, a plan or an approval first (see the official API section above). That is why Cotlet sets the limits itself: per key, per tool, with your approval before anything reaches other people. Cotlet is run by Take Group sp. z o.o., an EU company (VAT PL6342984273).

**Can my agent edit an invoice after it is submitted?**

No. ERPNext does not let you edit submitted or cancelled documents. Your agent cancels the invoice with cancel_sales_invoice and creates a new draft, after you have handled linked payments, returns and stock transactions as the Sales Invoice guide says.

**What can the agent do if my ERPNext user has limited roles?**

Only what that user can do. ERPNext checks the roles of the signed-in user, for the official API and for the browser alike, so a user who may create drafts but not submit gets an error from submit_sales_invoice. Sign in as the user whose rights you want the agent to have.

**Can my agent post or send messages in ERPNext without asking me?**

No. Every call to submit_sales_invoice, create_payment_entry, submit_payment_entry or cancel_sales_invoice waits for your OK by default. For scheduled automations you can switch confirmation off per tool in your dashboard, for example only for approvals. create_customer, create_sales_invoice runs without asking, because it sends nothing to anyone and one call undoes it.

**Can I use the ERPNext API in n8n?**

Yes. Add https://cotlet.dev/mcp/v1 with your API key in n8n's MCP Client node, or call its endpoints under https://cotlet.dev/api/v1/erpnext from the HTTP Request node.

---

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.
