BexioApiClient.Banking (bexio_api_client v2.0.0)

Copy Markdown

Bexio API for the banking part of the API.

Bank accounts are served by the bexio API v3 (/3.0/banking/accounts), payments by the bexio API v4 (/4.0/banking/payments). The docs model IBAN and QR payments as separate payload variants (type: iban or qr) of the same payments resource.

Summary

Functions

Cancel an existing payment. Please note that a payment can only be cancelled when the status is "downloaded", "transferred" or "error".

Create a payment. The type of the payment (:iban or :qr) determines which fields are required — see the Payment struct. The account_id is the uuid of the bank account the payment is sent from.

Permanently delete an existing payment. It cannot be undone.

Update a payment (the update payload has no account_id and no type — the type of a payment cannot be changed).

Fetch a single bank account which is shown on the banking component page.

Fetch a list of all bank accounts which are shown on the banking component page.

Get a single payment. The payment id is the uuid of the payment.

Fetch a list of all payments.

Types

api_error_type()

@type api_error_type() :: BexioApiClient.Helpers.api_error_type()

payment_list_opt()

@type payment_list_opt() ::
  {:filter_by, String.t()}
  | {:page, non_neg_integer()}
  | {:per_page, pos_integer()}

Functions

cancel_payment(req, payment_id)

@spec cancel_payment(req :: Req.Request.t(), payment_id :: String.t()) ::
  {:ok, BexioApiClient.Banking.Payment.t()} | api_error_type()

Cancel an existing payment. Please note that a payment can only be cancelled when the status is "downloaded", "transferred" or "error".

create_payment(req, payment)

@spec create_payment(
  req :: Req.Request.t(),
  payment :: BexioApiClient.Banking.Payment.t()
) ::
  {:ok, BexioApiClient.Banking.Payment.t()} | api_error_type()

Create a payment. The type of the payment (:iban or :qr) determines which fields are required — see the Payment struct. The account_id is the uuid of the bank account the payment is sent from.

delete_payment(req, payment_id)

@spec delete_payment(req :: Req.Request.t(), payment_id :: String.t()) ::
  {:ok, boolean()} | api_error_type()

Permanently delete an existing payment. It cannot be undone.

edit_payment(req, payment)

@spec edit_payment(
  req :: Req.Request.t(),
  payment :: BexioApiClient.Banking.Payment.t()
) ::
  {:ok, BexioApiClient.Banking.Payment.t()} | api_error_type()

Update a payment (the update payload has no account_id and no type — the type of a payment cannot be changed).

fetch_bank_account(req, bank_account_id)

@spec fetch_bank_account(req :: Req.Request.t(), bank_account_id :: pos_integer()) ::
  {:ok, BexioApiClient.Banking.BankAccount.t()} | api_error_type()

Fetch a single bank account which is shown on the banking component page.

fetch_bank_accounts(req, opts \\ [])

Fetch a list of all bank accounts which are shown on the banking component page.

fetch_payment(req, payment_id)

@spec fetch_payment(req :: Req.Request.t(), payment_id :: String.t()) ::
  {:ok, BexioApiClient.Banking.Payment.t()} | api_error_type()

Get a single payment. The payment id is the uuid of the payment.

fetch_payments(req, opts \\ [])

@spec fetch_payments(req :: Req.Request.t(), opts :: [payment_list_opt()]) ::
  {:ok, [BexioApiClient.Banking.Payment.t()]} | api_error_type()

Fetch a list of all payments.

Options:

  • :filter_by - filters can be used in range _, separated by ;, example: filter_by: "amount:11.16_16.11;execution_date:2025-11-16_2025-12-16"
  • :page - skip over a number of elements by specifying a page
  • :per_page - limit the number of results (max is 2000)