Change the category of a transaction
const url = 'https://app.commitly.com/api/transactions/7003/';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"category":1003}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Transaction ID (id in transaction responses).
Example
7003Request Bodyrequired
Section titled “Request Bodyrequired”object
ID of a leaf category of the same company.
Example
{ "category": 1003}Responses
Section titled “Responses”The updated transaction.
object
Short form of a bank account, embedded in transactions.
object
Bank name. Present in the create-transactions response only.
Present in the create-transactions response only.
Extended category representation, embedded as predicted_category in transactions.
object
AG aggregating, EX expenses, IN incomes.
Display position.
Internal; can be ignored.
Internal; can be ignored.
Internal; can be ignored.
Internal; can be ignored.
ID of the parent category.
Invoice linked to the transaction, or null.
Negative for outflows, positive for inflows.
Present in list responses.
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).
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
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
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).
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"}
