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 |
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.
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.