API routes¶
Every route DjangoERP serves — method, path, view or viewset action, the DRF permission classes it enforces, and its summary — read from Django's URL resolver.
Paths are relative to the host (http://localhost:8000 in development). Every /api/ route needs a JWT bearer token from POST /api/auth/login/ unless its Access column says public. DRF's DefaultRouter also serves each route with a format suffix (for example .json); those copies are not listed. Collection routes take the filters, search and ordering their viewset declares — see the viewset in each app's views.py.
Site, admin and API docs¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| ANY | /admin/ |
Django admin | staff session | The Django admin site. |
| GET | /swagger{format}/ |
SchemaView |
AllowAny |
Provided by drf_yasg. |
| GET | /swagger/ |
SchemaView |
AllowAny |
Provided by drf_yasg. |
| GET | /redoc/ |
SchemaView |
AllowAny |
Provided by drf_yasg. |
/api/auth/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/auth/users/ |
UserViewSet.list/create |
IsAuthenticated, IsAdminOrSelf |
API endpoint for user management |
| GET PUT PATCH DELETE | /api/auth/users/{pk}/ |
UserViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAdminOrSelf |
— |
| GET POST | /api/auth/roles/ |
UserRoleViewSet.list/create |
IsAuthenticated, IsAdmin |
API endpoint for user roles |
| GET PUT PATCH DELETE | /api/auth/roles/{pk}/ |
UserRoleViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAdmin |
— |
| GET | /api/auth/audit-logs/ |
AuditLogViewSet.list |
IsAuthenticated, IsAdmin |
API endpoint for audit logs (read-only) |
| GET | /api/auth/audit-logs/{pk}/ |
AuditLogViewSet.retrieve |
IsAuthenticated, IsAdmin |
— |
| GET | /api/auth/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
| POST | /api/auth/login/ |
CustomTokenObtainPairView |
public | Custom token view that uses our enhanced JWT serializer |
| POST | /api/auth/refresh/ |
TokenRefreshView |
public | Provided by rest_framework_simplejwt. |
/api/coa/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/coa/accounts/ |
AccountViewSet.list/create |
IsAuthenticated |
API endpoint for chart of accounts |
| GET | /api/coa/accounts/hierarchy/ |
AccountViewSet.hierarchy |
IsAuthenticated |
Returns accounts in hierarchical structure |
| GET PUT PATCH DELETE | /api/coa/accounts/{pk}/ |
AccountViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET POST | /api/coa/account-types/ |
AccountTypeViewSet.list/create |
IsAuthenticated |
API endpoint for account types (Asset, Liability, Equity, etc.) |
| GET PUT PATCH DELETE | /api/coa/account-types/{pk}/ |
AccountTypeViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET | /api/coa/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/journal/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/journal/entries/ |
JournalEntryViewSet.list/create |
IsAuthenticated, IsAccountant |
API endpoint for journal entries |
| GET PUT PATCH DELETE | /api/journal/entries/{pk}/ |
JournalEntryViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountant |
— |
| POST | /api/journal/entries/{pk}/reverse/ |
JournalEntryViewSet.reverse_entry |
IsAuthenticated, IsAccountant |
Post a reversing entry for this posted manual entry: the same lines with debits and credits swapped, linked through reverses. 201 the first time; a repeat call returns the same reversal with 200. Optional body: {"date": "YYYY-MM-DD", "description": "..."}. |
| GET | /api/journal/lines/ |
JournalLineViewSet.list |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
API endpoint for journal lines (read-only) |
| GET | /api/journal/lines/{pk}/ |
JournalLineViewSet.retrieve |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
— |
| GET | /api/journal/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/invoices/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/invoices/invoices/ |
InvoiceViewSet.list/create |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
— |
| GET PUT PATCH DELETE | /api/invoices/invoices/{pk}/ |
InvoiceViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
— |
| POST | /api/invoices/invoices/{pk}/post/ |
InvoiceViewSet.post_to_ledger |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
Post the invoice to the general ledger (Dr partner receivable, Cr revenue). Optional body: {"posting_date": "YYYY-MM-DD"}. |
| GET POST | /api/invoices/payments/ |
PaymentViewSet.list/create |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
— |
| GET PUT PATCH DELETE | /api/invoices/payments/{pk}/ |
PaymentViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
— |
| POST | /api/invoices/payments/{pk}/post/ |
PaymentViewSet.post_to_ledger |
IsAuthenticated, IsAccountantOrAuditorReadOnly |
Post the payment to the general ledger (Dr deposit account, Cr partner receivable). |
| GET | /api/invoices/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/reports/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/reports/templates/ |
ReportTemplateViewSet.list/create |
GET IsAuthenticated; POST IsAuthenticated, IsAccountant |
API endpoint for report templates |
| GET PUT PATCH DELETE | /api/reports/templates/{pk}/ |
ReportTemplateViewSet.retrieve/update/partial_update/destroy |
GET IsAuthenticated; PUT IsAuthenticated, IsAccountant; PATCH IsAuthenticated, IsAccountant; DELETE IsAuthenticated, IsAccountant |
— |
| GET POST | /api/reports/saved-reports/ |
SavedReportViewSet.list/create |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for saved reports |
| GET PUT PATCH DELETE | /api/reports/saved-reports/{pk}/ |
SavedReportViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| POST | /api/reports/saved-reports/{pk}/regenerate/ |
SavedReportViewSet.regenerate |
IsAuthenticated, IsAccountantOrReadOnly |
Regenerate a report with the same parameters |
| GET | /api/reports/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/partners/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/partners/partners/ |
BusinessPartnerViewSet.list/create |
IsAuthenticated |
API endpoint for business partners (customers and suppliers) |
| GET PUT PATCH DELETE | /api/partners/partners/{pk}/ |
BusinessPartnerViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET | /api/partners/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/products/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/products/products/ |
ProductViewSet.list/create |
IsAuthenticated |
API endpoint for the item master |
| GET PUT PATCH DELETE | /api/products/products/{pk}/ |
ProductViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET POST | /api/products/categories/ |
ProductCategoryViewSet.list/create |
IsAuthenticated |
API endpoint for product categories and their GL posting defaults |
| GET PUT PATCH DELETE | /api/products/categories/{pk}/ |
ProductCategoryViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET POST | /api/products/uoms/ |
UnitOfMeasureViewSet.list/create |
IsAuthenticated |
API endpoint for units of measure |
| GET PUT PATCH DELETE | /api/products/uoms/{pk}/ |
UnitOfMeasureViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET | /api/products/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/inventory/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/inventory/warehouses/ |
WarehouseViewSet.list/create |
IsAuthenticated |
API endpoint for warehouses |
| GET PUT PATCH DELETE | /api/inventory/warehouses/{pk}/ |
WarehouseViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET POST | /api/inventory/stock-moves/ |
StockMoveViewSet.list/create |
IsAuthenticated, IsAccountant |
API endpoint for the stock ledger. Creates drafts (mainly manual adjustments); business documents create their own moves through services. |
| GET PUT PATCH DELETE | /api/inventory/stock-moves/{pk}/ |
StockMoveViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountant |
— |
| POST | /api/inventory/stock-moves/{pk}/cancel/ |
StockMoveViewSet.cancel |
IsAuthenticated, IsAccountant |
— |
| POST | /api/inventory/stock-moves/{pk}/complete/ |
StockMoveViewSet.complete |
IsAuthenticated, IsAccountant |
— |
| GET | /api/inventory/stock-levels/ |
StockLevelViewSet.list |
IsAuthenticated |
API endpoint for cached on-hand quantities (read-only; derived from moves) |
| GET | /api/inventory/stock-levels/{pk}/ |
StockLevelViewSet.retrieve |
IsAuthenticated |
— |
| GET | /api/inventory/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/purchasing/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/purchasing/orders/ |
PurchaseOrderViewSet.list/create |
IsAuthenticated, IsAccountant |
API endpoint for purchase orders. State transitions are actions (confirm, receive, cancel) backed by purchasing.services, never direct status writes. |
| GET PUT PATCH DELETE | /api/purchasing/orders/{pk}/ |
PurchaseOrderViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountant |
— |
| POST | /api/purchasing/orders/{pk}/cancel/ |
PurchaseOrderViewSet.cancel |
IsAuthenticated, IsAccountant |
— |
| POST | /api/purchasing/orders/{pk}/confirm/ |
PurchaseOrderViewSet.confirm |
IsAuthenticated, IsAccountant |
— |
| POST | /api/purchasing/orders/{pk}/receive/ |
PurchaseOrderViewSet.receive |
IsAuthenticated, IsAccountant |
Receive goods. Body: {} to receive everything open, or {"receipts": {" |
| GET | /api/purchasing/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/sales/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/sales/orders/ |
SalesOrderViewSet.list/create |
IsAuthenticated, IsAccountant |
API endpoint for sales orders. State transitions are actions (confirm, ship, invoice, cancel) backed by sales.services, never direct status writes. |
| GET PUT PATCH DELETE | /api/sales/orders/{pk}/ |
SalesOrderViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountant |
— |
| POST | /api/sales/orders/{pk}/cancel/ |
SalesOrderViewSet.cancel |
IsAuthenticated, IsAccountant |
— |
| POST | /api/sales/orders/{pk}/confirm/ |
SalesOrderViewSet.confirm |
IsAuthenticated, IsAccountant |
— |
| POST | /api/sales/orders/{pk}/invoice/ |
SalesOrderViewSet.invoice |
IsAuthenticated, IsAccountant |
— |
| POST | /api/sales/orders/{pk}/ship/ |
SalesOrderViewSet.ship |
IsAuthenticated, IsAccountant |
Ship goods. Body: {} to ship everything open, or {"shipments": {" |
| GET | /api/sales/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/manufacturing/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/manufacturing/boms/ |
BillOfMaterialsViewSet.list/create |
IsAuthenticated |
API endpoint for bills of materials |
| GET PUT PATCH DELETE | /api/manufacturing/boms/{pk}/ |
BillOfMaterialsViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated |
— |
| GET POST | /api/manufacturing/work-orders/ |
WorkOrderViewSet.list/create |
IsAuthenticated, IsAccountant |
API endpoint for work orders. State transitions are actions (confirm, start, complete, cancel) backed by manufacturing.services. |
| GET PUT PATCH DELETE | /api/manufacturing/work-orders/{pk}/ |
WorkOrderViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountant |
— |
| GET | /api/manufacturing/work-orders/{pk}/availability/ |
WorkOrderViewSet.availability |
IsAuthenticated, IsAccountant |
Preview component availability for completing this work order. |
| POST | /api/manufacturing/work-orders/{pk}/cancel/ |
WorkOrderViewSet.cancel |
IsAuthenticated, IsAccountant |
— |
| POST | /api/manufacturing/work-orders/{pk}/complete/ |
WorkOrderViewSet.complete |
IsAuthenticated, IsAccountant |
Consume components, receive the finished good at rolled-up cost, and post the production journal entry. Optional body: {"completion_date": "YYYY-MM-DD"}. |
| POST | /api/manufacturing/work-orders/{pk}/confirm/ |
WorkOrderViewSet.confirm |
IsAuthenticated, IsAccountant |
— |
| POST | /api/manufacturing/work-orders/{pk}/start/ |
WorkOrderViewSet.start |
IsAuthenticated, IsAccountant |
— |
| GET | /api/manufacturing/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/mrp/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/mrp/runs/ |
MRPRunViewSet.list/create |
IsAuthenticated, IsAccountant |
API endpoint for MRP runs. Creating a run dispatches the planning engine asynchronously (same pattern as saved reports); runs are snapshots and are never edited, only re-created. |
| GET DELETE | /api/mrp/runs/{pk}/ |
MRPRunViewSet.retrieve/destroy |
IsAuthenticated, IsAccountant |
— |
| POST | /api/mrp/runs/{pk}/convert/ |
MRPRunViewSet.convert |
IsAuthenticated, IsAccountant |
Convert planned orders into draft purchase orders (grouped per supplier) and work orders. Optional body: {"planned_order_ids": [1, 2, ...]} to convert a subset. |
| GET | /api/mrp/planned-orders/ |
PlannedOrderViewSet.list |
IsAuthenticated, IsAccountant |
API endpoint for planned orders (engine output; read-only except cancel) |
| GET | /api/mrp/planned-orders/{pk}/ |
PlannedOrderViewSet.retrieve |
IsAuthenticated, IsAccountant |
— |
| POST | /api/mrp/planned-orders/{pk}/cancel/ |
PlannedOrderViewSet.cancel |
IsAuthenticated, IsAccountant |
— |
| GET | /api/mrp/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/company/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/company/companies/ |
CompanyViewSet.list/create |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for the legal entity/entities this installation keeps books for |
| GET PUT PATCH DELETE | /api/company/companies/{pk}/ |
CompanyViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| GET | /api/company/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/simulation/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET POST | /api/simulation/scenarios/ |
ScenarioViewSet.list/create |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for the agent simulation sandbox's scenario (one per database) |
| GET PUT PATCH DELETE | /api/simulation/scenarios/{pk}/ |
ScenarioViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| POST | /api/simulation/scenarios/{pk}/advance/ |
ScenarioViewSet.advance |
IsAuthenticated, IsAccountantOrReadOnly |
Run the economy forward: body {"ticks": 1..120}. Each tick is one transaction; returns the KPI snapshots compiled after each tick. |
| GET | /api/simulation/scenarios/{pk}/dashboard/ |
ScenarioViewSet.dashboard |
IsAuthenticated, IsAccountantOrReadOnly |
Everything the console's cockpit shows: KPIs, series, lines, agents, decisions, stock, jobs. |
| GET | /api/simulation/scenarios/{pk}/design/ |
ScenarioViewSet.design |
IsAuthenticated, IsAccountantOrReadOnly |
The system map: agent roles, parameter catalogue, posting matrix, invariants and flows, live. |
| GET | /api/simulation/scenarios/{pk}/financials/ |
ScenarioViewSet.financials |
IsAuthenticated, IsAccountantOrReadOnly |
Trial balance, balance sheet and income statements from the report generators, cost drivers, unit economics and reconciliations. Query: as_of, from (YYYY-MM-DD). |
| GET | /api/simulation/scenarios/{pk}/ledger/ |
ScenarioViewSet.ledger |
IsAuthenticated, IsAccountantOrReadOnly |
General ledger for one account: ?account=&from=&to=. |
| POST | /api/simulation/scenarios/{pk}/resume/ |
ScenarioViewSet.resume |
IsAuthenticated, IsAccountantOrReadOnly |
Clear a guardrail halt so the scenario can advance again (the halted tick was rolled back). |
| GET | /api/simulation/scenarios/{pk}/trace/ |
ScenarioViewSet.trace |
IsAuthenticated, IsAccountantOrReadOnly |
Agent decisions and journal entries behind a document reference: ?reference=SO-00012. |
| GET POST | /api/simulation/lines/ |
ProductionLineViewSet.list/create |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for production lines |
| GET PUT PATCH DELETE | /api/simulation/lines/{pk}/ |
ProductionLineViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| POST | /api/simulation/lines/{pk}/retire/ |
ProductionLineViewSet.retire |
IsAuthenticated, IsAccountantOrReadOnly |
Retire the line: queued jobs move to a sister line, the asset is disposed of at book value. |
| GET | /api/simulation/agents/ |
AgentViewSet.list |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for simulation agents (the roster is created with the scenario) |
| GET PUT PATCH | /api/simulation/agents/{pk}/ |
AgentViewSet.retrieve/update/partial_update |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| GET | /api/simulation/decisions/ |
AgentDecisionViewSet.list |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for agent decisions (read-only): what each agent saw, chose and why, which brain decided, what it cost, and the documents it produced |
| GET | /api/simulation/decisions/{pk}/ |
AgentDecisionViewSet.retrieve |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| GET | /api/simulation/snapshots/ |
TickSnapshotViewSet.list |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for per-tick KPI snapshots compiled from the ledger (read-only) |
| GET | /api/simulation/snapshots/{pk}/ |
TickSnapshotViewSet.retrieve |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| GET POST | /api/simulation/experiments/ |
ExperimentViewSet.list/create |
IsAuthenticated, IsAccountantOrReadOnly |
API endpoint for what-if experiments |
| GET PUT PATCH DELETE | /api/simulation/experiments/{pk}/ |
ExperimentViewSet.retrieve/update/partial_update/destroy |
IsAuthenticated, IsAccountantOrReadOnly |
— |
| GET | /api/simulation/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/api/workspace/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| GET | /api/workspace/flow/{resource}/{object_id}/ |
WorkspaceViewSet.flow |
IsAuthenticated |
Document flow for one business object: related documents, the journal entries and stock moves it caused, and its audit trail — each section only where the user's role may read it. |
| GET | /api/workspace/overview/ |
WorkspaceViewSet.overview |
IsAuthenticated |
Home page: work queues, record counts and recent activity, for what this user may read. |
| GET | /api/workspace/registry/ |
WorkspaceViewSet.registry |
IsAuthenticated |
Every module and business object the shell shows: navigation groups, endpoints, field types, filters, lifecycles, actions and the roles that may read and write each, introspected from the live viewsets. |
| GET | /api/workspace/search/ |
WorkspaceViewSet.search |
IsAuthenticated |
Global search (?search=) across every resource this user may list, using each viewset's search fields. |
| GET | /api/workspace/statements/ |
WorkspaceViewSet.statements |
IsAuthenticated |
A live financial statement from reports.report_generators: ?report=trial_balance|balance_sheet|income_statement|general_ledger with as_of, from, to and (for the general ledger) account. |
| GET | /api/workspace/ |
APIRootView |
IsAuthenticated |
Provided by rest_framework. |
/app/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| ANY | /app/ |
workspace.views.shell |
public | The workspace single-page app: one shell, every module, deep-linkable at /app/ |
| ANY | /app/{path} |
workspace.views.shell |
public | The workspace single-page app: one shell, every module, deep-linkable at /app/ |
/console/¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| ANY | /console/ |
simulation.views.console |
public | The simulation console: a page of the common workspace shell that drives /api/simulation/. |
Site root (company/urls_web.py)¶
| Method | Path | View | Access | Summary |
|---|---|---|---|---|
| ANY | / |
company.views.home |
public | Public landing page: shows the company charter once one is recorded. |
| ANY | /healthz |
company.views.healthz |
public | Liveness probe (hub UPS-BE-10): 200 {"status": "ok"} from a live process; touches no dependency. |
| ANY | /readyz |
company.views.readyz |
public | Readiness probe (hub UPS-BE-10): 200 when the database and the Celery broker answer, else 503 "degraded". |
| ANY | /health/ |
company.views.health |
public | Liveness probe for CI smoke tests and deployment healthchecks. |
| ANY | /version |
company.views.version |
public | Build identity: the release version and the commit and build time of the running image. |