Create transactions in an account
const url = 'https://app.commitly.com/api/accounts/4003/transactions/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"counterpart_name":"Example Provider GmbH","purpose":"Transaction created via API","value_date":"2024-07-11","amount":-12500.01,"tags":["my-integration"]}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.commitly.com/api/accounts/4003/transactions/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "counterpart_name": "Example Provider GmbH", "purpose": "Transaction created via API", "value_date": "2024-07-11", "amount": -12500.01, "tags": [ "my-integration" ] } ]'Creates one or more transactions in the given bank account. The body is a single transaction object or an array of up to 1000 transactions.
- Required:
value_date(on or after 2000-01-01) andamount. - Optional:
purpose,counterpart_name,tags. categorycannot be set on create; COMMITLY assigns a default category. Change it afterwards withPATCH /transactions/orPATCH /transactions/{id}/.
Only offline accounts accept new transactions. Accounts linked to a bank
connection and accounts with status API or DISCONNECTED are refused with 403.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Bank account ID (id from GET /accounts/).
Example
4003Request Bodyrequired
Section titled “Request Bodyrequired”object
Value date, on or after 2000-01-01.
Negative for outflows, positive for inflows. A JSON number or a numeric string.
object
Value date, on or after 2000-01-01.
Negative for outflows, positive for inflows. A JSON number or a numeric string.
Example
[ { "counterpart_name": "Example Provider GmbH", "purpose": "Transaction created via API", "value_date": "2024-07-11", "amount": -12500.01, "tags": [ "my-integration" ] }]Responses
Section titled “Responses”Transactions created. The response contains the created transaction, or a list of the created transactions if a list was sent.
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.
Value date (YYYY-MM-DD).
Value time (HH:MM:SS), or null. Most banks supply only the date of a
transaction, not the time, so expect null in most cases and do not rely
on this field for ordering within a day.
Booking date as reported by the bank (YYYY-MM-DD), or null.
Negative for outflows, positive for inflows. In the currency of the account.
amount converted to the company currency. Equal to amount for accounts in
the company currency.
Present in list responses.
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.
Value date (YYYY-MM-DD).
Value time (HH:MM:SS), or null. Most banks supply only the date of a
transaction, not the time, so expect null in most cases and do not rely
on this field for ordering within a day.
Booking date as reported by the bank (YYYY-MM-DD), or null.
Negative for outflows, positive for inflows. In the currency of the account.
amount converted to the company currency. Equal to amount for accounts in
the company currency.
Present in list responses.
Example
[ { "id": 8001, "account": { "id": 4003, "bank": "Offline", "name": "API account", "alias": "", "currency": "EUR" }, "category": { "id": 1004, "name": "Uncategorized outflows", "description": "" }, "predicted_category": null, "invoice": null, "parent": null, "value_date": "2024-07-11", "value_time": null, "bank_booking_date": null, "amount": -12500.01, "reporting_amount": -12500.01, "purpose": "Transaction created via API", "counterpart_name": "Example Provider GmbH", "counterpart_iban": "", "is_adjusting_entry": false, "is_payment": true, "is_leaf_node": true, "tags": [ "my-integration" ] }]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, or the account does not accept new transactions (linked to
a bank connection, or status API or DISCONNECTED).
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"}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"}
