Connect ERPNext to other applications
If no ready-made app connects ERPNext to the system you use, a developer can build the connection with the Frappe REST API. This page explains the approach. It is for a system manager or a developer.
Why ERPNext is open to integration
Almost every business record in ERPNext is a document of a DocType: Customer, Item, Sales Order, Sales Invoice, Payment Entry, Stock Entry, and so on. The Frappe Framework gives every DocType the same REST endpoints. An external system can list, read, create, update, and delete documents, within the permissions of the API user.
Custom fields become part of the DocType. They are available through the same API as the standard fields. For example, you can add a marketplace_order_id field to Sales Order and let the external system read and write it.
Common integration patterns
| Pattern | Example |
|---|---|
| Read from ERPNext | Fetch item prices, stock levels, or invoice payment status |
| Write to ERPNext | Create Leads, Customers, Sales Orders, or Issues from another system |
| Update ERPNext | Send tracking numbers, bank references, or fulfillment status back |
| React to ERPNext events | Use a webhook to notify another system when a document is created, submitted, or cancelled |
Plan an integration
- List the DocTypes involved, for example Customer, Item, Sales Order, and Sales Invoice.
- Map the fields between ERPNext and the other system. Add custom fields for the external IDs and statuses that you need.
- Create a dedicated integration user. Give it only the roles that the integration needs.
- Generate an API key and an API secret for that user. The external system sends them with each request.
- Call the REST endpoints to create, read, update, or delete documents.
- Use webhooks or background jobs for event-driven sync and retries.
Good practices
- Do not use the Administrator account for an integration.
- Store the ID of the external record in a custom field. Matching and troubleshooting become easier.
- Make each request idempotent: a retry must not create a duplicate document.
- Use webhooks or queues for high volumes instead of synchronous calls.
- Log request IDs, external references, and error messages.
- Keep ERPNext as the source of truth for stock and accounting.
- Test on a staging site before you go live.