Create an offline account
const url = 'https://app.commitly.com/api/accounts/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"bank":{"name":"ERP cash accounts","bic":""},"name":"Petty cash","currency":"EUR"}'};
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/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "bank": { "name": "ERP cash accounts", "bic": "" }, "name": "Petty cash", "currency": "EUR" }'Creates an offline bank account, i.e. an account without a bank connection that you fill with transactions through the API (see Create transactions).
bank.nameandbank.bicare required.- If an account with the same IBAN and currency already exists in the company, that account is returned instead of a new one.
- The limits of your COMMITLY edition on the number of accounts apply; above the limit the API answers 403.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Name of the bank or of the source system.
BIC of the bank; may be an empty string for non-bank sources.
Account name shown in COMMITLY.
ISO 4217 code, e.g. EUR.
Example
{ "bank": { "name": "ERP cash accounts", "bic": "" }, "name": "Petty cash", "currency": "EUR"}Responses
Section titled “Responses”Account created (or the existing account with the same IBAN and currency).
object
Bank data embedded in an account.
object
Present in GET /accounts/ only.
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.
ISO 4217 currency code.
Account type as supplied by the bank provider (free text, e.g. Checking). Empty for offline accounts.
Account status. Only offline accounts accept transactions via
POST /accounts/{account_id}/transactions/; accounts with status API or
DISCONNECTED, and accounts linked to a bank connection, do not.
Example
{ "status": "UPDATED"}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."}
