Authorization: token <api_key>:<api_secret>, created per user under Settings > My Settings > API Access. Every ERPNext deployment is its own site, so a token only works on the site that issued it. When credentials are configured explicitly, set the matching baseUrl beside them. When credentials come from a connected account, that account must also store its matching base_url; requests do not fall back to the plugin option. The site URL must be an https URL (for example https://yourcompany.frappe.cloud); without one, Corsair raises AuthMissingError so the account can be connected with it.
Submitting, cancelling and workflow transitions cannot be undone, and stock entries made by erp.makeStockEntry are submitted unless do_not_submit is set, so those operations are destructive. So is desk.addComment: users @mentioned in a comment get an email.
This plugin implements the requested 51 operations over the generic Frappe REST surface. Inbound webhooks are not included.
What you get:
- 51 typed API operations
- 1 synced entity (
documents) for fast.search()/.list()
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the ERPNext API key before the first call: More: API Key
pnpm corsair setup --plugin=erpnext --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.A connected account needs three fields: api_key, api_secret and the site’s base_url. Store them together, for example pnpm corsair setup --plugin=erpnext --tenant=acme api_key=<your-key> api_secret=<your-secret> base_url=https://yourcompany.frappe.cloud, and call erpnext() with no options. baseUrl applies only to credentials passed in code, for that same site: erpnext({ apiKey: process.env.ERPNEXT_API_KEY, apiSecret: process.env.ERPNEXT_API_SECRET, baseUrl: 'https://yourcompany.frappe.cloud' }).4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Search customersQuery synced data
Synced entities supporttenant.erpnext.db.<entity>.search() and .list(): documents.
See Database for filters and operators.
What’s next
API reference
Every
erpnext.api.* operation with input and output types.Database
Synced entities, search filters, and operators.
Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.