biz/erp/erpnext

ERPNEXT

ERPNext integration expert.

production Any HTTP client, Python, or Cloudflare Workers
improves: biz/erp

ERPNext Integration

ERPNext is an open-source ERP built on the Frappe framework. It exposes a comprehensive REST API for every doctype, plus an RPC API for server-side methods.

Docs: https://frappeframework.com/docs/user/en/api

Authentication

API Key + Secret (recommended for integrations)

Authorization: token api_key:api_secret

Basic Auth

Authorization: Basic base64(user:password)

Session (cookie-based)

curl -X POST https://site.example.com/api/method/login \
  -d 'usr=user@example.com&pwd=password'
# Use returned cookies for subsequent requests

Never hardcode credentials. Use environment variables or secrets.

API Patterns

Base URL

https://<site>/api/resource/<DocType>
https://<site>/api/method/<dotted.path>

List records

GET /api/resource/Item?filters=[["item_group","=","Finished Goods"]]&fields=["name","item_name","item_group","stock_uom"]&limit_page_length=50&order_by=item_name asc

Get single record

GET /api/resource/Item/ITEM-CODE-001

Create record

POST /api/resource/Item
Content-Type: application/json

{"item_code":"ITEM-001","item_name":"Item Name","item_group":"Finished Goods","stock_uom":"Nos"}

Update record

PUT /api/resource/Item/ITEM-001
Content-Type: application/json

{"description":"Updated description"}

Filters

Filters are JSON arrays: [field, operator, value]

OperatorMeaningExample
=Equals["item_group","=","Raw Material"]
!=Not equals["status","!=","Cancelled"]
>, >=, <, <=Comparison["qty",">",0]
likeWildcard match["item_name","like","%Oak%"]
inIn list["status","in",["Open","In Process"]]
betweenRange["posting_date","between",["2026-01-01","2026-03-31"]]

Multiple filters: [["item_group","=","Raw Material"],["stock_uom","=","Nos"]]

Core Doctypes

Item                      — Products, raw materials, sub-assemblies
BOM (Bill of Materials)   — Recipe for manufacturing a product
Work Order                — Production order
Job Card                  — Per-operation tracking
Workstation               — Machine or station
Operation                 — Manufacturing step
Stock Entry               — Inventory movements (issue, receipt, manufacture)
Quality Inspection        — QC checks
Sales Order               — Customer orders
Purchase Order            — Supplier orders
Warehouse                 — Storage locations

Manufacturing Flow

Sales Order
  → Work Order (from BOM)
    → Job Card (per operation)
      → Stock Entry (material transfer)
      → Stock Entry (manufacture — finished goods in)
    → Quality Inspection
  → Delivery Note
  → Sales Invoice

RPC Methods

POST /api/method/erpnext.manufacturing.doctype.work_order.work_order.make_stock_entry
Content-Type: application/json

{"work_order":"WO-00045","purpose":"Material Transfer for Manufacture","qty":30}

Useful RPC methods

MethodPurpose
frappe.client.get_countCount documents matching filters
frappe.client.get_listList with server-side aggregation
erpnext.stock.utils.get_stock_balanceReal-time stock balance
erpnext.manufacturing.doctype.bom.bom.get_bom_itemsExplode BOM
erpnext.manufacturing.doctype.work_order.work_order.make_stock_entryCreate stock entry from WO
erpnext.selling.doctype.sales_order.sales_order.make_work_orderCreate WO from SO

Common Gotchas

See Also