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

API

Procurement API: MRP endpoints (mrp)

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

This page lists the 44 endpoints of the mrp sub-module of the procurement module, under /api/v1/procurement. Scope: MRP runs (foreground and background) with items, summary, item actions, PR creation, time-phased and pegging reads, firming, conversion to production orders, comparison, and materialisation; plus KPI, planned independent requirements, netting groups, stock requirements, planning file, analyses, buffers, safety time periods, quotas, and ATP. 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 44, counted from the route decorators and add_api_route calls of the routers that register_routes mounts src/cluster_erp/modules/procurement/mrp/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 44 of 44 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/mrp/runs list_runs mrp_run.read none status, limit, offset dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:57
POST /api/v1/procurement/mrp/runs execute_run mrp_run.create MrpRunCreate none MrpRunRead 201 src/cluster_erp/modules/procurement/mrp/routes.py:105
POST /api/v1/procurement/mrp/runs/background execute_run_background mrp_run.create MrpRunCreate none MrpRunRead 202 src/cluster_erp/modules/procurement/mrp/routes.py:121
GET /api/v1/procurement/mrp/runs/{run_id} get_run mrp_run.read none none MrpRunRead 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:140
GET /api/v1/procurement/mrp/runs/{run_id}/items get_run_items mrp_run.read none exception_only, planned_order_only, product_id, project_id, mrp_controller, limit, offset dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:156
GET /api/v1/procurement/mrp/runs/{run_id}/summary get_run_summary mrp_run.read none none MrpRunSummary 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:193
GET /api/v1/procurement/mrp/runs/{run_id}/items/{item_id} get_run_item mrp_run.read none none MrpRunItemRead 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:205
PATCH /api/v1/procurement/mrp/runs/{run_id}/items/{item_id}/action action_item mrp_run.create MrpItemActionRequest none MrpRunItemRead 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:223
POST /api/v1/procurement/mrp/runs/{run_id}/items/bulk-action bulk_action_items mrp_run.create MrpBulkActionRequest none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:240
POST /api/v1/procurement/mrp/runs/{run_id}/create-pr create_pr_from_items mrp_run.create CreatePrFromMrpRequest none dict 201 src/cluster_erp/modules/procurement/mrp/routes.py:255
DELETE /api/v1/procurement/mrp/runs/{run_id} delete_run mrp_run.delete none none none 204 src/cluster_erp/modules/procurement/mrp/routes.py:274
GET /api/v1/procurement/mrp/runs/{run_id}/products/{product_id}/time-phased get_time_phased mrp_run.read none none TimePhasedResponse 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:286
GET /api/v1/procurement/mrp/runs/{run_id}/products/{product_id}/pegging get_pegging mrp_run.read none none PeggingResponse 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:302
POST /api/v1/procurement/mrp/runs/{run_id}/items/firm firm_items mrp_run.create MrpFirmRequest none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:318
POST /api/v1/procurement/mrp/runs/{run_id}/items/unfirm unfirm_items mrp_run.create MrpFirmRequest none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:334
POST /api/v1/procurement/mrp/runs/{run_id}/items/{item_id}/convert-to-order convert_item_to_production_order mrp_run.create none force dict 201 src/cluster_erp/modules/procurement/mrp/routes.py:359
GET /api/v1/procurement/mrp/runs/{run_id}/compare/{other_run_id} compare_runs mrp_run.read none none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:448
POST /api/v1/procurement/mrp/runs/{run_id}/materialize materialize_simulation mrp_run.create none none MrpRunRead 201 src/cluster_erp/modules/procurement/mrp/routes.py:545
GET /api/v1/procurement/mrp/kpi mrp_kpi mrp_run.read none runs_window dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:594
GET /api/v1/procurement/mrp/pirs list_pirs mrp_run.read none product_id, limit, offset dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:725
POST /api/v1/procurement/mrp/pirs create_pir mrp_run.create PirCreate none PirRead 201 src/cluster_erp/modules/procurement/mrp/routes.py:768
PUT /api/v1/procurement/mrp/pirs/{pir_id} update_pir mrp_run.create PirUpdate none PirRead 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:816
DELETE /api/v1/procurement/mrp/pirs/{pir_id} delete_pir mrp_run.create none none none 204 src/cluster_erp/modules/procurement/mrp/routes.py:850
GET /api/v1/procurement/mrp/netting-groups list_netting_groups mrp_run.read none none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:872
POST /api/v1/procurement/mrp/netting-groups create_netting_group mrp_run.create NettingGroupCreate none dict 201 src/cluster_erp/modules/procurement/mrp/routes.py:918
POST /api/v1/procurement/mrp/netting-groups/{group_id}/projects assign_netting_group_project mrp_run.create NettingGroupAssign none dict 201 src/cluster_erp/modules/procurement/mrp/routes.py:933
GET /api/v1/procurement/mrp/stock-requirements get_stock_requirements mrp_run.read none product_id dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:976
GET /api/v1/procurement/mrp/planning-file list_planning_file mrp_run.read none product_id, include_processed, limit, offset dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:991
POST /api/v1/procurement/mrp/analysis/xyz analyze_xyz mrp_run.create XyzAnalysisRequest none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1047
GET /api/v1/procurement/mrp/analysis/lead-time analyze_lead_time mrp_run.read none product_id dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1197
GET /api/v1/procurement/mrp/runs/{run_id}/products/{product_id}/pegging-chain get_pegging_chain mrp_run.read none max_depth dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1328
POST /api/v1/procurement/mrp/analysis/buffer-suggestions buffer_suggestions mrp_run.read XyzAnalysisRequest none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1347
POST /api/v1/procurement/mrp/ddmrp/apply-buffers apply_buffers mrp_run.create ApplyBuffersRequest none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1499
GET /api/v1/procurement/mrp/analysis/decoupling-candidates decoupling_candidates mrp_run.read none limit dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1554
GET /api/v1/procurement/mrp/safety-time-periods list_safety_time_periods mrp_run.read none product_id, limit, offset dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1696
POST /api/v1/procurement/mrp/safety-time-periods create_safety_time_period mrp_run.create StpCreate none StpRead 201 src/cluster_erp/modules/procurement/mrp/routes.py:1732
PUT /api/v1/procurement/mrp/safety-time-periods/{stp_id} update_safety_time_period mrp_run.create StpUpdate none StpRead 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1766
DELETE /api/v1/procurement/mrp/safety-time-periods/{stp_id} delete_safety_time_period mrp_run.create none none none 204 src/cluster_erp/modules/procurement/mrp/routes.py:1806
GET /api/v1/procurement/mrp/quotas list_quotas mrp_run.read none product_id, limit, offset dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1834
POST /api/v1/procurement/mrp/quotas create_quota mrp_run.create QuotaCreate none QuotaRead 201 src/cluster_erp/modules/procurement/mrp/routes.py:1871
PUT /api/v1/procurement/mrp/quotas/{quota_id} update_quota mrp_run.create QuotaUpdate none QuotaRead 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:1955
DELETE /api/v1/procurement/mrp/quotas/{quota_id} delete_quota mrp_run.create none none none 204 src/cluster_erp/modules/procurement/mrp/routes.py:1997
GET /api/v1/procurement/mrp/atp/{product_id} get_atp mrp_run.read none horizon_days dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:2214
POST /api/v1/procurement/mrp/atp/check atp_check mrp_run.read AtpCheckRequest none dict 200 (default) src/cluster_erp/modules/procurement/mrp/routes.py:2231

Error codes

The table lists the error codes that code under src/cluster_erp/modules/procurement/mrp/ 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 routes src/cluster_erp/modules/procurement/mrp/routes.py:832
MRP_ITEMS_ALREADY_ACTIONED 409 services src/cluster_erp/modules/procurement/mrp/services.py:370
MRP_ITEMS_ALREADY_FIRMED 409 services src/cluster_erp/modules/procurement/mrp/services.py:1314
MRP_ITEM_OUTSIDE_OPENING_PERIOD 422 routes src/cluster_erp/modules/procurement/mrp/routes.py:399
MRP_RUN_FAILED 400, 500 engine, services src/cluster_erp/modules/procurement/mrp/engine.py:3931
MRP_RUN_IN_PROGRESS 409 services src/cluster_erp/modules/procurement/mrp/services.py:172
MRP_RUN_NOT_COMPLETED 409 services src/cluster_erp/modules/procurement/mrp/services.py:341
MRP_RUN_STALE 409 services src/cluster_erp/modules/procurement/mrp/services.py:347
RESOURCE_NOT_FOUND 404 routes, services src/cluster_erp/modules/procurement/mrp/routes.py:102
VALIDATION_ERROR 409, 422 routes, services src/cluster_erp/modules/procurement/mrp/routes.py:386

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

Verified against commit 92f8051 · 2026-11-13