Skip to content

Replace a plan budget by external ID

PUT
/plans/{plan_id}/budgets/external/{external_id}/
curl --request PUT \
--url https://app.commitly.com/api/plans/2001/budgets/external/ext-123457/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "category": 1002, "name": "Consulting project", "description": "", "amount": 150, "settlement_date": "2024-01-20", "external_id": "123456", "external_source": "my-integration" }'

Replaces the budget with the given external_id in the given plan. Send the complete budget; name, category and settlement_date are required. Fields not sent are reset to their defaults. Prefer PATCH to change single fields.

external_id in the body is not required. If it differs from the path, the budget’s external_id is changed to the new value.

Note: Budgets of a committed plan cannot be updated or deleted (403). Other checks that the COMMITLY app applies may not apply to the API. Only change budgets that your integration created, for example by filtering on external_source (list parameter source).

plan_id
required
integer

Plan ID (id from GET /plans/).

Example
2001
external_id
required
string

The external_id set when the budget was created. Budgets whose external_id contains . or / cannot be addressed by this path. The trailing slash after the external_id is required.

Example
ext-123457

The complete budget. name, category and settlement_date are required.

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": 1002,
"name": "Consulting project",
"description": "",
"amount": 150,
"settlement_date": "2024-01-20",
"external_id": "123456",
"external_source": "my-integration"
}

Budget updated. The response contains the complete budget.

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
ExampleBudget

Plan budget

{
"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
}

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

The resource does not exist or is not accessible with these credentials.

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
Examplegenerated
{
"detail": "example",
"code": "example"
}