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 |
| PUT | /bank-accounts/{id} | Update a bank account |
| DELETE | /bank-accounts/{id} | Delete a bank account |
Attributes
| Attribute | Type | Description |
|---|---|---|
| id | string | The ID of the bank account |
| created_at | string | The date and time when the bank account was created |
| created_by_id | integer | The ID of the user that created the bank account |
| updated_at | string | The date and time when the bank account was last updated |
| updated_by_id | integer | The ID of the user that last updated the bank account |
| client_account_id | string | The client account ID of the bank account. Relation to: ClientAccount |
| business_partner_id | string | 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 |
| bban | string | The BBAN account number of the bank account |
| iban | string | The IBAN account number of the bank account |
| 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) |
Relationships
| Relationship | Type | Description |
|---|---|---|
| client_account | ClientAccount | The client account of the bank account |
| business_partner | BusinessPartner | The business partner of the bank account |
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
Dflag for the same purpose are automatically updated toY - 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:
- Client has Bank Account A with
is_payment_account: "D"(current default) - When updating Bank Account B to
is_payment_account: "D" - System automatically changes Bank Account A to
is_payment_account: "Y" - Bank Account B becomes the new default payment account
Multiple flag updates:
- If both
is_payment_accountandis_invoice_accountare set toDon 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.