Skip to main content

POST budget_save_batch

Saves several budget lines in one call. Each item has the same fields as budget_save and is written the same way.

Endpoint​

POST /api/method/konsol.api.budget_save_batch

Declared methods=["POST"].

Authentication: logged-in user; entity, account and dimension write scope are checked per item.

Request body​

A JSON array of budget_save objects. The body must be an array, otherwise Expected a JSON array (HTTP 417).

[
{
"scenario_id": "BUDGET_2025",
"data_area_id": "USMF",
"fiscal_year": 2025,
"main_account": "6100",
"periods": [{"period": 1, "amount": 10000, "layer": "base"}]
},
{
"scenario_id": "BUDGET_2025",
"data_area_id": "USMF",
"fiscal_year": 2025,
"main_account": "6200",
"periods": [{"period": 1, "amount": 5000, "layer": "base"}]
}
]

Response​

{
"message": {
"results": [
{"name": "BSHT-bcyc-budget-2025-2025-usmf-base-1a2b3c4d", "sheets": ["BSHT-bcyc-budget-2025-2025-usmf-base-1a2b3c4d"], "index": 0},
{"name": "BSHT-bcyc-budget-2025-2025-usmf-base-1a2b3c4d", "sheets": ["BSHT-bcyc-budget-2025-2025-usmf-base-1a2b3c4d"], "index": 1}
]
}
}

Each result carries the Budget Sheets the item touched (sheets), the first of them (name) and the item's index.

Items that fail​

Items are independent: a failed item does not stop the others. results[i] is null for a failed item and errors is added, with null for the items that succeeded.

{
"message": {
"results": [
{"name": "BSHT-bcyc-budget-2025-2025-usmf-base-1a2b3c4d", "sheets": ["BSHT-bcyc-budget-2025-2025-usmf-base-1a2b3c4d"], "index": 0},
null
],
"errors": [
null,
{"index": 1, "error": "Not permitted to access entity 'DEMF'"}
]
}
}
error textCause
The PermissionError messageEntity, account or dimension outside the caller's write scope; surfaced per item so the client can flag exactly which lines were blocked
Save failed — check server logsAny other failure (a missing field, a bad layer, a locked cycle, a database error). The detail is in the Frappe Error Log, not in the response.

Unlike budget_save, a locked cycle does not set HTTP 423 here; it is reported as Save failed — check server logs for that item and the call returns 200.