Skip to main content

Crate fiocz_rs

Crate fiocz_rs 

Source
Expand description

Async Rust client for the Fio banka API.

Provides typed access to account movements, statements, transaction imports, and merchant card data. Handles rate limiting (30s between requests), multipart file uploads, and multiple export formats.

§Quick start

use fiocz_rs::Fio;

#[tokio::main]
async fn main() {
    let fio = Fio::new("your-api-token");

    match fio.movements_in_period("2025-01-01", "2025-01-31").await {
        Ok(statement) => {
            let txns = &statement.account_statement.transaction_list.transaction;
            println!("Got {} transactions", txns.len());
        }
        Err(e) => eprintln!("Error: {e:?}"),
    }
}

§API methods

Each method has a JSON-parsed variant and a _raw variant that returns the response body as a String in any supported types::ExportFormat.

MethodDescription
Fio::movements_in_periodAccount movements for a date range
Fio::movements_in_period_rawSame, in any export format
Fio::movements_since_lastMovements since last download
Fio::movements_since_last_rawSame, in any export format
Fio::statementsOfficial statement by year/ID
Fio::statements_rawSame, in any export format (incl. PDF, MT940)
Fio::last_statement_idLast created statement number
Fio::set_last_idSet download bookmark by movement ID
Fio::set_last_dateSet download bookmark by date
Fio::import_transactionsImport payments via type-safe builder
Fio::import_rawImport via raw ABO/pain.001/pain.008 payload
Fio::merchant_transactions_rawPOS/gateway card transactions (XML)

§Rate limiting

The FIO API allows one request per 30 seconds per token. The client enforces this automatically — if you call an API method too soon, it sleeps until the interval has passed. The rate limiter is shared across clones of the same Fio instance via Arc.

§Error handling

All methods return Result<T, error::Error>. HTTP status codes are mapped to typed variants:

Modules§

error
Error types
types
This module contains all the types used in the application.

Structs§

Fio
Fiocz API client