Bank Accounts

A bank account is a bank account. It is used to record bank transactions and reconcile bank statements. You can create what is called “house bank accounts” in Snapbooks. These are bank accounts that’s owned by the client account. You can also create bank accounts that are owned by business partners.

When you create a bank account, you need to specify the bank account type. The bank account type determines how the bank account is used in Snapbooks. You also need to specify the either bank account number (BBAN) and bank country, or IBAN account number. The rest of the bank account information is then fetched from the bank.

Endpoints

Method Endpoint Description
GET /bank-accounts List bank accounts
POST /bank-accounts Create a bank account
GET /bank-accounts/{id} Get a bank account
POST/PUT /bank-accounts/{id} Update a bank account
DELETE /bank-accounts/{id} Deactivate a bank account

Query Parameters

The GET /bank-accounts endpoint supports the following query parameters:

Parameter Type Required Description
client_account_id integer No Filter by client account ID. If not provided, returns bank accounts for all eligible client accounts
business_partner_id integer No Filter by business partner ID
is_active boolean No Filter by active status (default: true). Pass null to include all
order_by string No Sort order for results
page integer No Page number for pagination (default: 1)
per_page integer No Number of items per page (default: 100)

Attributes

Attribute Type Description
id integer The ID of the bank account
client_account_id integer The client account ID of the bank account. Relation to: ClientAccount
business_partner_id integer The business partner ID of the bank account. Relation to: BusinessPartner
name string The name of the bank account
type enum The type of the bank account. Possible values: CURRENT, SAVINGS, LOAN, TAX, INVESTMENT
bban string The BBAN account number of the bank account
iban string The IBAN account number of the bank account
bank_code string The bank code
bank_country string The country code of the bank account
bank_name string The name of the bank
bank_zip string The zipcode of the bank
bank_city string The city of the bank
bic string The BIC code of the bank
routing_number string The routing number of the bank
currency_code string The currency of the bank account
is_active boolean Whether the bank account is active or not
is_payment_account string Payment account flag. Possible values: N (not a payment account), Y (payment account), D (default payment account)
is_invoice_account string Invoice account flag. Possible values: N (not an invoice account), Y (invoice account), D (default invoice account)
autonomy_level string Autonomy level override for automated processing. Possible values: NONE, DRAFT, FULL, or null to inherit company default
last_balance decimal The most recent account balance
last_balance_date date The date of the most recent balance

Relationships

Relationship Type Description
statistics object Statistical information about the bank account
organization Organization The bank organization (resolved from BIC)

Deactivation Validation

When attempting to deactivate a bank account using the DELETE endpoint, the system performs validation to ensure data integrity:

  • Balance Checking: The system checks if any accounting accounts with mandatory bank account dimensions have non-zero balances for this specific bank account.
  • Validation Failure: If any accounts have non-zero balances, the deactivation is denied with a 400 Bad Request error.
  • Error Details: The error message includes specific account codes and their balances to help identify which transactions need to be resolved.

Example Error Response

{
    "error": "Cannot deactivate bank account: account 1910: 5000.00, account 1920: -1250.00",
    "status": 400
}

This validation ensures that bank accounts cannot be deactivated while they still have outstanding balances, maintaining the integrity of your accounting records.

Default Account Logic

Bank accounts can be designated as default accounts for payments or invoicing using the is_payment_account and is_invoice_account flags:

Flag Values

Value Description
N Not designated for this purpose
Y Designated for this purpose
D Default account for this purpose

Default Account Behavior

When setting either is_payment_account or is_invoice_account to D (default):

  • Automatic Updates: All other active bank accounts within the same client account that currently have the D flag for the same purpose are automatically updated to Y
  • Single Default: This ensures only one default payment account and one default invoice account can exist per client account
  • Scope: The default logic applies only within each client account - different client accounts can each have their own default accounts

Example Scenarios

Setting a new default payment account:

  1. Client has Bank Account A with is_payment_account: "D" (current default)
  2. When updating Bank Account B to is_payment_account: "D"
  3. System automatically changes Bank Account A to is_payment_account: "Y"
  4. Bank Account B becomes the new default payment account

Multiple flag updates:

  • If both is_payment_account and is_invoice_account are set to D on the same account, the system will update other accounts’ corresponding flags independently
  • An account can be both the default payment account and default invoice account

Notes

  • The DELETE endpoint deactivates the bank account (sets is_active to false) rather than permanently deleting the record.
  • Bank accounts with outstanding balances in mandatory dimension accounts cannot be deactivated until those balances are resolved.
  • Either BBAN or IBAN must be provided when creating a bank account.
  • The system automatically validates and enriches bank account information using IBAN/BBAN validation services.