Rest API Description
Maintainer: Tomting
iDempiere REST API Practical Guide
Introduction: Why iDempiere API is "Not Quite RESTful"
Typical RESTful API vs iDempiere API
Typical RESTful API Design Logic
Update order status: PATCH /orders/12345 { "description": "Export Order" }
Delete order:
DELETE /orders/12345
iDempiere API Reality
❌ PATCH /models/c_order/1000567 { "DocStatus": "CO" }
✅ POST /processes/processes/c_order-process
{
"table-id": 259,
"record-id":1000567
}
Why?
Validates inventory availability
Locks prices
Reserves inventory
Generates accounting entries
Triggers subsequent processes
Updates related statistics
Key Understanding
iDempiere REST API is not a modern API designed from scratch It exposes a 20-year-old ERP system as HTTP endpoints
API Overview and Tools
Swagger UI
Online: https://hengsin.github.io/idempiere-rest-swagger-ui
Structure:
/api/v1/
├── /auth
├── /models/*
├── /processes/*
├── /windows/*
└── /uploads/*
API Endpoints and iDempiere System Mapping
/models/* → AD_Table
C_Order → /models/c_order
C_OrderLine → /models/c_orderline
M_InOut → /models/m_inout
/processes/* → AD_Process
C_Order_Process → /processes/c_order-process
M_InOut_Process → /processes/m_inout-process
Practical Example: Complete Sales Order Flow
Step 1: Create Order Header
POST /api/v1/models/c_order
{
"C_BPartner_ID": 1000001,
"M_Warehouse_ID": 103,
"DateOrdered": "2025-01-22",
"C_DocType_ID": 1000030,
"IsSOTrx": "Y"
}
Step 2: Add Order Line
POST /api/v1/models/c_orderline
{
"C_Order_ID": 1000567,
"M_Product_ID": 1000050,
"QtyOrdered": 10
}
Step 3: Complete Order
POST /api/v1/processes/c_order-process
{
"table-id": 259,
"record-id":1000567
}
How to Find the Correct Process
Query Process via Workflow
AD_Table → AD_Workflow → AD_WF_Node → AD_Process
GET /api/v1/models/ad_table?$filter=TableName eq 'C_Order'
GET /api/v1/models/ad_workflow?$filter=AD_Table_ID eq 259
GET /api/v1/models/ad_process?$filter=AD_Workflow_ID eq 116
Query Parameters
GET /api/v1/models/ad_process_para?$filter=ad_process_id eq 104&$expand=AD_Process_Para
How to Recreate Any UI Screen with API
List Screen
GET /api/v1/models/c_order?$filter=C_BPartner_ID eq 1000001&$orderby=DateOrdered desc
Master Detail
GET /api/v1/models/c_order/1000567?$expand=C_OrderLine
Dropdown
GET /api/v1/models/c_bpartner?$select=C_BPartner_ID,Name
Best Practices Summary
1. Learn from ZK UI
2. Use Swagger
3. Query AD System
4. Create Master first
5. Always use Process
Learning Path
Stage 1
CRUD Swagger Master-Detail
Stage 2
Order Flow Shipment Flow Process
Stage 3
AD Metadata Workflow Custom UI
Additional Resources
https://bxservice.github.io/idempiere-rest-docs/
https://hengsin.github.io/idempiere-rest-swagger-ui
https://groups.google.com/g/idempiere
https://github.com/tm731531/tw.idempiere.UI.customer.theme/tree/main/iDempiere-Resource-UI-main
Summary
API mirrors UI
Learn UI first
Always use Process
Query AD system
Practice
Final Note
iDempiere API mirrors internal ERP behavior.
Understand UI → then automate with API
