Skip to Content
ERPX Documentation — Your complete guide to the ERPX platform

REST API

Complete reference for the ERPX REST API endpoints.

Common Endpoints

All document types follow the same CRUD pattern:

MethodEndpointDescription
GET/api/v1/{resource}List all records
GET/api/v1/{resource}/{id}Get a single record
POST/api/v1/{resource}Create a new record
PUT/api/v1/{resource}/{id}Update a record
DELETE/api/v1/{resource}/{id}Delete a record

Items API

List Items

GET /api/v1/items?page=1&perPage=20&category=Electronics

Query Parameters:

ParameterTypeDescription
pageintegerPage number (default: 1)
perPageintegerItems per page (default: 20, max: 100)
searchstringSearch in name/code
categorystringFilter by category
itemTypestringFilter: Product, Service, Consumable
sortstringSort field (default: createdAt)
orderstringSort order: asc, desc

Response:

{ "success": true, "data": [ { "id": "itm_001", "itemCode": "LAPTOP-001", "itemName": "Business Laptop 15\"", "category": "Electronics", "itemType": "Product", "uom": "pcs", "sellingPrice": 999.99, "costPrice": 650.0, "currentStock": 45, "reorderLevel": 10, "isActive": true, "createdAt": "2024-01-01T00:00:00Z", "updatedAt": "2024-01-15T10:30:00Z" } ], "meta": { "page": 1, "perPage": 20, "total": 150, "totalPages": 8 } }

Create Item

POST /api/v1/items Content-Type: application/json
{ "itemCode": "MOUSE-001", "itemName": "Wireless Mouse", "category": "Electronics", "itemType": "Product", "uom": "pcs", "sellingPrice": 29.99, "costPrice": 12.0, "reorderLevel": 50, "reorderQty": 200, "description": "Ergonomic wireless mouse with USB receiver", "images": ["https://storage.erpx.io/items/mouse-001.jpg"] }

Customers API

List Customers

GET /api/v1/customers

Create Customer

POST /api/v1/customers
{ "name": "Acme Corporation", "email": "billing@acme.com", "phone": "+1-555-0123", "type": "Company", "address": { "street": "123 Business Ave", "city": "San Francisco", "state": "CA", "zipCode": "94105", "country": "US" }, "creditLimit": 50000, "paymentTerms": "Net 30", "taxId": "12-3456789" }

Sales Orders API

Create Sales Order

POST /api/v1/sales-orders
{ "customer": "cust_001", "orderDate": "2024-01-15", "deliveryDate": "2024-01-30", "items": [ { "item": "itm_001", "quantity": 10, "rate": 999.99, "discount": 5 }, { "item": "itm_002", "quantity": 20, "rate": 29.99 } ], "paymentTerms": "Net 30", "notes": "Deliver to main office" }

Update Order Status

PUT /api/v1/sales-orders/{id}/status
{ "status": "submitted" }

Invoices API

Generate Invoice from Sales Order

POST /api/v1/invoices/from-order
{ "salesOrder": "so_001", "invoiceDate": "2024-01-20" }

Search API

GET /api/v1/search?q=laptop&types=items,customers&limit=10

Response:

{ "success": true, "data": { "items": [ { "id": "itm_001", "name": "Business Laptop 15\"", "score": 0.95 } ], "customers": [ { "id": "cust_042", "name": "Laptop World Inc.", "score": 0.72 } ] } }

Pagination

All list endpoints support cursor-based and offset pagination:

GET /api/v1/items?page=2&perPage=50

Filtering

Use query parameters for filtering:

# Multiple filters GET /api/v1/items?category=Electronics&sellingPrice[gte]=100&sellingPrice[lte]=500 # Date range GET /api/v1/sales-orders?orderDate[gte]=2024-01-01&orderDate[lte]=2024-01-31 # Status filter GET /api/v1/invoices?status=unpaid

Filter Operators

OperatorDescriptionExample
eqEqual (default)status=active
neNot equalstatus[ne]=cancelled
gtGreater thanprice[gt]=100
gteGreater than or equalprice[gte]=100
ltLess thanprice[lt]=500
lteLess than or equalprice[lte]=500
inIn liststatus[in]=draft,submitted
likePattern matchname[like]=laptop

All API responses include X-Request-Id headers for debugging and support purposes.