List budgets of a scenario
const url = 'https://app.commitly.com/api/scenarios/12459/budgets/?budget_type=single&page_size=100';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://app.commitly.com/api/scenarios/12459/budgets/?budget_type=single&page_size=100' \ --header 'Authorization: Bearer <token>'Returns the budgets of the given scenario. The list contains only the scenario’s own budgets, not the forecast budgets it is based on.
Note the response shape: results is an object containing the total and the
budgets array, not an array.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Scenario ID (id of a plan with type SCENARIO from GET /plans/).
Example
12459Query Parameters
Section titled “Query Parameters”Category ID; includes its subcategories. Repeat the parameter for several categories.
Earliest settlement_date.
Latest settlement_date.
Minimum amount.
Maximum amount.
Substring match on external_source. Several comma-separated values are
combined with OR.
Kind of budget.
Boolean filter on recurring budgets.
Boolean filter on open budgets.
Boolean filter on contract budgets.
true: budgets without tags.
Comma-separated internal budget IDs.
Comma-separated tags.
Searches name, description and tags.
Sort order. Allowed fields: start_date, settlement_date, amount,
end_date. Prefix a field with - for descending order.
Page number, starting at 1. When paging through results, read this value
from the next link and send it to the documented base URL.
Number of records per page. Default 100, maximum 1000; larger values are reduced to 1000.
Responses
Section titled “Responses”Paginated list of budgets with total.
object
Total number of matching records.
URL of the next page, or null on the last page. The host name may differ
from the documented base URL; read page from it and call the documented
base URL.
URL of the previous page, or null on the first page.
Sum of the amounts of all matching budgets.
Total and the budgets of the current page.
object
Total amount of all matching budgets.
Budget as returned by the API.
object
Internal budget ID; used in the /budgets/{id}/ paths.
Short form of a category, embedded in transactions and budgets.
object
Category of the linked budget in the other company.
Name of inter_category.
Categories the budget depends on.
Stored dependency categories (set via depending_categories).
Summary of the recurrence settings; null if the budget is not recurring.
object
Bank account ID.
The linked budget in the other company of an intercompany budget, or null.
Negative for outflows, positive for inflows.
FS forecast and scenario, S scenario, F forecast.
Your own ID for the budget.
Free-text name of the system that created the budget.
Company ID for an intercompany budget.
ID of the budget this one was copied from, or null. Not related to external_source.
Examples
Budget list
{ "count": 1, "sum": 125, "next": null, "previous": null, "results": { "total": 125, "budgets": [ { "id": 9001, "category": { "id": 1002, "name": "Revenue", "description": "" }, "inter_category": null, "inter_category_name": null, "depending_categories": [], "recurring_budget": null, "settlement_date": "2023-01-15", "start_date": null, "end_date": null, "account": null, "tags": [], "integration_tags": null, "is_adjusted": false, "inter_budget": null, "name": "Consulting project", "description": "", "amount": 125, "rate": 0, "base": "FS", "time_lags": [], "frequency": "", "frequency_multiplier": 1, "sequence_type": "", "sequence_term_size": 1, "d": 0, "r": 1, "is_indefinite": false, "external_id": "123456", "external_source": "my-integration", "inter_company": null, "source": null } ] }}The access token is invalid or has expired. Request a new token. The message is
localized (see Accept-Language).
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "Invalid token."}Headers
Section titled “Headers”Authentication scheme, Bearer.
Example
BearerNo access token was sent, or the credentials are not allowed to call this
endpoint. If the company’s COMMITLY edition does not include the requested
function, the body additionally contains
"code": "billing_plan_permission_denied".
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "User must be authenticated to access this resource."}The resource does not exist or is not accessible with these credentials.
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Examplegenerated
{ "detail": "example", "code": "example"}
