superfaktura.bank_account module

Bank Account Module.

This module provides classes and functions for working with bank accounts in the SuperFaktura API. It allows for retrieving, creating, updating, and deleting bank accounts.

Classes:
  • BankAccountModel: Dataclass representing a bank account.

  • BankAccount: Class for interacting with bank accounts.

Exceptions:
  • NoDefaultBankAccountException: Exception for when no default bank account is found.

Functions:
  • (none)

Usage:

import superfaktura.bank_account

# Create an instance of BankAccount bank = superfaktura.bank_account.BankAccount()

# Retrieve a list of bank accounts accounts = bank.list()

# Get the default bank account default_account = bank.default()

# Create or update a bank account data = {“account”: “1234567890”, “bank_code”: “1234567890”, “default”: True} bank.post(data)

class superfaktura.bank_account.BankAccount

Bases: SuperFakturaAPI

Bank Account Class.

This class provides methods for interacting with bank accounts in the SuperFaktura API. It allows for retrieving, creating, updating, and deleting bank accounts.

- list

Retrieves a list of bank accounts.

- default

Retrieves the default bank account.

- post

Creates or updates a bank account.

Usage:

bank = BankAccount() accounts = bank.list() default_account = bank.default() data = {“account”: “1234567890”, “bank_code”: “1234567890”, “default”: True} bank.post(data)

default() BankAccountModel | None

Retrieves the default bank account.

list() dict

Retrieves a list of bank accounts.

class superfaktura.bank_account.BankAccountModel(account: str | None, bank_code: str | None, bank_name: str | None, default: int | None, iban: str | None, show: int | None, swift: str | None, id: int | None)

Bases: object

Dataclass representing a bank account.

account: str | None
as_dict() dict

Returns a dictionary representation of the BankAccountModel.

bank_code: str | None
bank_name: str | None
default: int | None
static from_dict(data: dict) BankAccountModel

Creates a BankAccountModel from a dictionary.

iban: str | None
id: int | None
show: int | None
swift: str | None
exception superfaktura.bank_account.NoDefaultBankAccountException

Bases: Exception

Exception for when no default bank account is found.