POST run_allocation¶
Create and execute an Allocation Run for a given fiscal period.
Endpoint¶
POST /api/method/konsol.api.run_allocation
Authentication: Required (Frappe session cookie)
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
fiscal_year |
integer | Yes | Fiscal year (e.g., 2025) |
fiscal_period |
integer | Yes | Fiscal period (1–12) |
What Happens¶
- Creates a new Allocation Run document
- Submits it (triggers
before_submit):allocation_run_idset to the document namerun_byset to the current userrun_atset to the current timestampstatusset to "Active"
- Syncs to ClickHouse (
epm_staging.allocation_runs) - dbt model
gold_allocation_resultsincludes this run (filtersstatus = 'Active')
Response¶
{
"message": {
"name": "ARUN-2025-P6-0001",
"allocation_run_id": "ARUN-2025-P6-0001",
"status": "Active",
"run_by": "admin@example.com",
"run_at": "2025-06-09 14:30:00"
}
}
Example¶
curl -X POST http://localhost:8069/api/method/konsol.api.run_allocation \
-H "Content-Type: application/json" \
-b "cookies.txt" \
-d '{"fiscal_year": 2025, "fiscal_period": 6}'
Workflow Context¶
Draft ──[Run Allocation]──→ Running ──[Complete]──→ Active ──[Reverse]──→ Reversed
See also: reverse_allocation, allocation_history