Skip to content

Change the category of a transaction

PATCH
/transactions/{id}/
curl --request PATCH \
--url https://app.commitly.com/api/transactions/7003/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "category": 1003 }'

Changes the category of a single transaction. category must be a leaf category of the same company.

id
required
integer

Transaction ID (id in transaction responses).

Example
7003
Media typeapplication/json
object
category
required

ID of a leaf category of the same company.

integer
Example
{
"category": 1003
}

The updated transaction.

Media typeapplication/json
object
id
integer
account

Short form of a bank account, embedded in transactions.

object
id
integer
name
string
alias
string
bank

Bank name. Present in the create-transactions response only.

string
currency

Present in the create-transactions response only.

string
category
One of:

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

object
id
integer
name
string
description
string
predicted_category
One of:

Extended category representation, embedded as predicted_category in transactions.

object
id
integer
name
string
slug
string
description
string
type

AG aggregating, EX expenses, IN incomes.

string
Allowed values: AG EX IN
order

Display position.

integer
date_created
string format: date-time
is_default
boolean
is_obsolete
boolean
lft

Internal; can be ignored.

integer
rght

Internal; can be ignored.

integer
tree_id

Internal; can be ignored.

integer
level

Internal; can be ignored.

integer
tenant
integer
company
integer
parent

ID of the parent category.

integer | null
source
integer | null
invoice

Invoice linked to the transaction, or null.

parent
One of:
object recursive
value_date
string format: date-time
bank_booking_date
string | null format: date-time
amount

Negative for outflows, positive for inflows.

number
purpose
string
counterpart_name
string
counterpart_iban
string
is_adjusting_entry
boolean
is_payment
boolean
is_leaf_node
boolean
tags
Array<string> | null
comment_count

Present in list responses.

integer
Example
{
"predicted_category": {
"type": "AG"
}
}

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