How to use ChatGPT with ERPNext
Short answer
You can connect ChatGPT to ERPNext in three ways: paste or upload exports, give a custom GPT an action that calls a narrow API, or use an app or connector that fronts the Frappe API. Start read-only, scope the API user tightly, and consider a private model when the data is regulated.
Many ERPNext users already paste a Stock Ledger report into ChatGPT to ask why a valuation looks off, or ask it to write a Server Script. That works for one-off questions, but it is manual, goes stale quickly and puts business data into a chat window with whatever controls that account has.
The next step is live access, where ChatGPT calls your ERPNext site to answer a question about today's orders or stock. That is possible because Frappe exposes a clean REST API, but it needs a public, authenticated endpoint, and a person to decide exactly what that endpoint may return.
This page compares the three approaches, shows how a custom GPT action maps to ERPNext's API, and explains when a manufacturer should keep the model inside its own network instead.
What teams use it for
Explain a report
Export a Query Report such as Stock Balance or Accounts Receivable as CSV, upload it and ask for the ten items with the biggest movement and likely causes.
Draft Server Scripts and print formats
Ask ChatGPT for a Server Script validation, a Jinja print format for a delivery note or a Custom Field plan, then review and test it on a staging site.
Order status Q and A for sales
A custom GPT with a read-only action looks up a Sales Order and its Delivery Notes so account managers can ask where an order is without opening the desk.
Data import cleanup
Before a Data Import, paste a sample of supplier or item sheets and have ChatGPT normalise UOMs, spellings and tax templates, then import the corrected file yourself.
Translate and summarise
Summarise long supplier communications attached to a Purchase Order or translate a customer quotation, with a person reviewing before anything is sent.
ERPNext integration surface
- REST resource API at /api/resource/<DocType> with filters and fields parameters, suitable as the backing for a custom GPT action described by an OpenAPI file.
- Token authentication header (Authorization: token key:secret), which a GPT action can send as an API key style credential, or OAuth 2 where you need per-user access.
- Report Builder and Query Reports with CSV or Excel download, and Data Export, for the manual file-based route.
- Whitelisted server methods that you write in a small custom app, letting you expose one safe endpoint per question instead of the whole DocType API.
- Webhooks to push events outward, for example to a workflow that then asks a model to summarise a new Sales Order.
How it works
- 1
Decide file or live
If questions are occasional, exports are enough. If staff ask the same status questions daily, build a live action. Do not build live access for a question you ask twice a month.
- 2
Create a read-only API user
Give it roles limited to the DocTypes in scope, and use User Permissions to restrict by company or warehouse if relevant.
- 3
Publish a thin proxy
Do not expose the full site to the internet for ChatGPT. Put a small service in front that offers three or four endpoints, validates inputs and returns only needed fields.
- 4
Write the OpenAPI schema
Describe each proxy endpoint with clear parameter names and examples. The schema is what the GPT reads, so precise descriptions reduce wrong calls.
- 5
Configure the custom GPT
Add the action, set the authentication method, write instructions that say never to guess values and to quote document names, and share it only with the intended workspace.
- 6
Test with real questions
Check answers against the desk for a week, including questions with no data, to see that it says so instead of inventing numbers.
Example flows
Where is my order
Trigger: A salesperson asks the custom GPT about a customer PO number.
- The GPT calls the proxy endpoint order_status with the PO number.
- The proxy queries Sales Order by po_no and reads linked Delivery Notes and Sales Invoices.
- It returns status, dates and delivered quantities only.
- The GPT summarises and cites the Sales Order name.
Result: The salesperson gets a sourced answer in seconds without learning the filter screens.
Weekly variance commentary
Trigger: Finance exports the Profit and Loss Statement and Stock Ledger summary on Friday.
- Remove anything not needed, such as employee names or supplier bank fields.
- Upload the files to an approved workspace.
- Ask for the top five variances against the prior month with likely drivers.
- Verify each number in ERPNext before using the commentary.
Result: A faster first draft of management commentary, with the numbers still checked by finance.
Keeping data on-prem
ChatGPT is a hosted service, so a live action means your ERPNext data travels to it. For a self-hosted bench that is a real decision. If the data is export-controlled, customer confidential or covered by contract, keep the model local: serve an open-weight model on your own GPUs with vLLM or Ollama, and give it the same tool design described here. The OpenAPI-style action definition carries over, because the proxy is yours either way. Netray builds this private layer so users keep a chat experience while prompts, tool results and logs stay inside your network.
Security checklist
- Check your plan's data controls: whether inputs are used for training, retention periods and admin settings. These differ between consumer and business offerings, so verify them in current terms.
- Never expose the ERPNext desk or full /api/resource surface to the internet for this purpose. Publish a proxy with an allow-list.
- Strip personal and financial fields such as bank details and tax IDs from any export.
- Rotate the API secret on a schedule and revoke it when someone leaves the project.
- Log every action call at the proxy, including the user of the GPT where available.
Ways to get it done
Manual exports into ChatGPT
Effort: None to set up, but manual and not suited to daily operations.
Occasional analysis, drafting scripts and cleaning import files with no personal data.
Custom GPT action over a proxy
Effort: Days for a prototype; more for hardening, auth and logging.
Read-only status questions from a small team that accepts a hosted model.
Private model with a Netray-built tool layer
Effort: Scoped pilot, with GPU sizing and prompts tuned to your DocTypes.
Regulated data, on-prem benches or teams that want one assistant across ERPNext and documents.
Pitfalls
- !Pasting an entire Stock Ledger export that includes supplier names and prices into a personal account.
- !Trusting calculated totals from the model. Have it call a query or report and quote the figure instead of adding numbers itself.
- !Using one shared API key for everyone, which makes access and misuse impossible to trace.
- !Writing vague endpoint descriptions, which leads the GPT to guess filter values.
- !Expecting ChatGPT to know your custom fields. Include their names and meaning in the instructions.
Frequently asked questions
Does ChatGPT have a native ERPNext connector?
Do not assume one. Check the current ChatGPT apps and connectors list and the Frappe Marketplace. In many cases you will connect through a custom GPT action or an MCP style connector that you or a partner build over the Frappe REST API.
Is it safe to upload ERPNext reports to ChatGPT?
It depends on your plan, your contracts and the data. Remove personal, pricing and export-controlled fields first, use a business workspace with admin controls, and ask your compliance owner. For restricted data, use a private model instead.
Can ChatGPT update ERPNext records?
It can if you give an action write endpoints, but start read-only. If you add writes, limit them to creating Draft documents through a proxy and require a person to submit. Free-form edits of master data are risky.
Why not just use ERPNext's built-in features?
Reports, dashboards and the awesome bar cover many lookups. ChatGPT helps when the question spans several DocTypes or needs plain-language explanation. If your questions are already answered by a saved report, add nothing.
What about Frappe Cloud sites?
The API is reachable over HTTPS, so the same proxy pattern works. Confirm with your plan and host what API rate limits and IP restrictions apply, and keep the proxy as the only public entry point you control.
Want ChatGPT working on your ERPNext?
A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.
Get a free assessment