Skip to content

Create a forecast budget

POST
/forecast/budgets/
curl --request POST \
--url https://app.commitly.com/api/forecast/budgets/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "category": 1006, "settlement_date": "2024-04-08", "tags": [ "my-integration", "direct-API" ], "name": "Tax prepayment", "description": "Created via API", "amount": -78700, "external_id": "ext-123457", "external_source": "my-integration" }'

Creates a budget directly in the forecast. The forecast is the central planning view in COMMITLY; use with care.

  • Required: name, category (ID of a leaf category), settlement_date.
  • external_id must be unique within the forecast; a duplicate returns 400 {"external_id": ["This field must be unique."]}. Create never updates an existing budget.
Media typeapplication/json

Budget for create (POST) and full update (PUT). name, category and settlement_date are required; all other fields are optional or have a default. Recurring budgets are set with frequency, frequency_multiplier and, for series, sequence_type, sequence_term_size, d and r.

object
category
required

ID of a leaf category (a category without subcategories). A numeric string is also accepted.

integer
name
required
string
description
string
amount

Decimal with at most 12 digits and 2 decimal places. Negative for outflows, positive for inflows. A JSON number or a numeric string.

number | string
settlement_date
required
string format: date
tags
Array<string>
external_id

Your own ID for the budget; used in the /external/{external_id}/ paths. Unique per plan: the forecast and each scenario count as separate plans. Creating a budget with an external_id that already exists in the same plan returns 400. Do not use . or /. In an update, a value different from the current one changes the budget’s external_id.

string
external_source

Free-text name of the system that created the budget. Filter with the list parameter source.

string
account

Bank account ID.

integer | null
rate

Decimal rate with 4 decimal places. Default 0.

number | string
base

FS forecast and scenario (default), S scenario, F forecast.

string
Allowed values: FS S F
frequency

Recurrence period. Empty for a one-time budget.

string
Allowed values: daily weekly monthly quarterly yearly ""
frequency_multiplier

Repeat every N periods. Default 1.

integer
sequence_type

Series type of a recurring budget; AP arithmetic, GP geometric, HP harmonic, empty for none.

string
Allowed values: AP GP HP ""
sequence_term_size

Term size of the series. Default 1.

integer
d

Common difference of an arithmetic series. Default 0.

number
r

Common ratio of a geometric series. Default 1.

number
time_lags
Array<integer>
depending_categories

IDs of the categories the budget depends on.

Array<integer>
is_adjusted
boolean
is_indefinite

The recurring budget runs indefinitely.

boolean
inter_company

Company ID for an intercompany budget.

integer | null
inter_category

Category of the linked budget in the other company. Only valid together with inter_company.

integer | null
integration_tags

Tag list for integrations.

Array<string> | null
Example
{
"category": 1006,
"settlement_date": "2024-04-08",
"tags": [
"my-integration",
"direct-API"
],
"name": "Tax prepayment",
"description": "Created via API",
"amount": -78700,
"external_id": "ext-123457",
"external_source": "my-integration"
}

Budget created.

Media typeapplication/json

Budget as returned by the API.

object
id

Internal budget ID; used in the /budgets/{id}/ paths.

integer
category

Short form of a category, embedded in transactions and budgets.

object
id
integer
name
string
description
string
inter_category

Category of the linked budget in the other company.

integer | null
inter_category_name

Name of inter_category.

string | null
depending_categories

Categories the budget depends on.

Array
base_categories

Stored dependency categories (set via depending_categories).

Array
recurring_budget

Summary of the recurrence settings; null if the budget is not recurring.

object
frequency
string
frequency_multiplier
integer
sequence_type
string
sequence_term_size
integer
d
number
r
number
settlement_date
string format: date
start_date
string | null format: date
end_date
string | null format: date
account

Bank account ID.

integer | null
tags
Array<string>
integration_tags
Array<string> | null
is_adjusted
boolean
inter_budget

The linked budget in the other company of an intercompany budget, or null.

name
string
description
string
amount

Negative for outflows, positive for inflows.

number
rate
number
base

FS forecast and scenario, S scenario, F forecast.

string
Allowed values: FS S F
time_lags
Array<integer>
frequency
string
Allowed values: daily weekly monthly quarterly yearly ""
frequency_multiplier
integer
sequence_type
string
Allowed values: AP GP HP ""
sequence_term_size
integer
d
number
r
number
is_indefinite
boolean
external_id

Your own ID for the budget.

string | null
external_source

Free-text name of the system that created the budget.

string | null
inter_company

Company ID for an intercompany budget.

integer | null
source

ID of the budget this one was copied from, or null. Not related to external_source.

integer | null
Examples
ExampleForecastBudget

Forecast budget

{
"id": 9003,
"category": {
"id": 1006,
"name": "Other taxes and fees",
"description": ""
},
"inter_category_name": null,
"depending_categories": [],
"recurring_budget": null,
"settlement_date": "2024-04-08",
"start_date": null,
"end_date": null,
"account": null,
"tags": [
"my-integration",
"direct-API"
],
"integration_tags": null,
"is_adjusted": false,
"name": "Tax prepayment",
"description": "Created via API",
"amount": -78700,
"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": "ext-123457",
"external_source": "my-integration",
"inter_company": null,
"source": null,
"inter_budget": null,
"base_categories": []
}

Invalid request body or parameters. The body lists the errors per field; errors not tied to a field are listed under non_field_errors. For request bodies that are arrays, the body is a list with one error object per item. Messages are localized (see Accept-Language).

Media typeapplication/json
One of:

Validation errors. Each key is a field of the request body; its value is the list of messages for that field. Errors not tied to a field are listed under non_field_errors.

object
non_field_errors
Array<string>
key
additional properties
Array<string>
Example
{
"settlement_date": [
"This field is required."
]
}

The access token is invalid or has expired. Request a new token. The message is localized (see Accept-Language).

Media typeapplication/json
object
detail
required

Error message.

string
code

Present only if the company’s edition does not include the function; value billing_plan_permission_denied.

string
Example
{
"detail": "Invalid token."
}
WWW-Authenticate
string

Authentication scheme, Bearer.

Example
Bearer

No 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".

Media typeapplication/json
object
detail
required

Error message.

string
code

Present only if the company’s edition does not include the function; value billing_plan_permission_denied.

string
Example
{
"detail": "User must be authenticated to access this resource."
}