Factorizer/Cluster ERP WikiCluster ERP Türkçe
Home / API reference

API

Procurement API: Critical materials endpoints (critical_materials)

HTTP endpoints of the critical_materials sub-module of procurement: 6 routes with permissions, schemas, status codes, and error codes.

This page lists the 6 endpoints of the critical_materials sub-module of the procurement module, under /api/v1/procurement. Scope: Critical material records. The module entry page is Procurement API.

Group facts

Item Value Source
Base path /api/v1/procurement src/cluster_erp/core/module_base.py:37-38, src/cluster_erp/modules/procurement/module.py:70
Routers 1 router objects in 1 files; listed in the section Endpoints src/cluster_erp/modules/procurement/module.py:35
Endpoints 6, counted from the route decorators and add_api_route calls of the routers that register_routes mounts src/cluster_erp/modules/procurement/critical_materials/routes.py
Authentication Bearer header or session cookie, resolved by get_current_user; see Authentication and headers src/cluster_erp/modules/auth/guards.py:85-167
Permission guard 6 of 6 routes declare require_permission src/cluster_erp/modules/auth/guards.py:205-240
App entitlement gate require_app("procurement") on every mounted router src/cluster_erp/modules/procurement/module.py:82
Error format JSON body {"error": {...}}; see Errors src/cluster_erp/server/error_handler.py:33-46

Endpoints

Method Path Handler Permission Request Query Response Status Source
GET /api/v1/procurement/critical-materials/ list_critical_materials critical_material.read none is_active, search, limit, offset dict 200 (default) src/cluster_erp/modules/procurement/critical_materials/routes.py:27
POST /api/v1/procurement/critical-materials/ create_critical_material critical_material.create CriticalMaterialCreate none CriticalMaterialRead 201 src/cluster_erp/modules/procurement/critical_materials/routes.py:53
GET /api/v1/procurement/critical-materials/{cm_id} get_critical_material critical_material.read none none CriticalMaterialRead 200 (default) src/cluster_erp/modules/procurement/critical_materials/routes.py:65
PUT /api/v1/procurement/critical-materials/{cm_id} update_critical_material critical_material.update CriticalMaterialUpdate none CriticalMaterialRead 200 (default) src/cluster_erp/modules/procurement/critical_materials/routes.py:79
DELETE /api/v1/procurement/critical-materials/{cm_id} delete_critical_material critical_material.delete none none none 204 src/cluster_erp/modules/procurement/critical_materials/routes.py:94
POST /api/v1/procurement/critical-materials/bulk-delete bulk_delete_critical_materials critical_material.bulk_delete BulkDeleteRequest none BulkDeleteResponse 200 (default) src/cluster_erp/modules/procurement/critical_materials/routes.py:106

Error codes

The table lists the error codes that code under src/cluster_erp/modules/procurement/critical_materials/ raises, found by a syntax-tree scan for AppError(...), the factories in src/cluster_erp/core/errors.py (not_found, conflict, protected, permission_denied, privilege_escalation, check_version), and HTTPException(...). A status of 400 is the AppError default (src/cluster_erp/core/errors.py:23). Guard errors (401, 403), the entitlement codes, and validation errors (422) apply to every route and are listed on Errors.

Code HTTP status Raised in First site
CONCURRENCY_VERSION_CONFLICT 409 services src/cluster_erp/modules/procurement/critical_materials/services.py:127
CRITICAL_MATERIAL_ALREADY_EXISTS 409 services src/cluster_erp/modules/procurement/critical_materials/services.py:86
RESOURCE_NOT_FOUND 404 routes src/cluster_erp/modules/procurement/critical_materials/routes.py:75

Verified against commit 92f8051 on 2026-11-13.

Verified against commit 92f8051 · 2026-11-13