View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
perlancar > Finance-Bank-ID-BPRKS > Finance::Bank::ID::BPRKS



Annotate this POD



Open  0
View/Report Bugs
Module Version: 0.06   Source  


Finance::Bank::ID::BPRKS - Check your BPR KS accounts from Perl


This document describes version 0.06 of Finance::Bank::ID::BPRKS (from Perl distribution Finance-Bank-ID-BPRKS), released on 2017-07-10.


    use Finance::Bank::ID::BPRKS;

    # FBI::BPRKS uses Log::Any. to show logs using, e.g., Log4perl:
    use Log::Log4perl qw(:easy);
    use Log::Any::Adapter;

    my $ibank = Finance::Bank::ID::BPRKS->new(
        username => 'ABCDEFGH1234', # opt if only using parse_statement()
        password => '123456',       # idem
        verify_https => 1,          # default is 0
        #https_ca_dir => '/etc/ssl/certs', # default is already /etc/ssl/certs

    eval {
        $ibank->login(); # dies on error

        my @cards = $ibank->list_cards();

        my $bal = $ibank->check_balance($card); # $card is optional

        my $stmt = $ibank->get_statement(
            card       => ..., # opt, default card will be used if undef
            days       => 30,  # opt
            start_date => DateTime->new(year=>2012, month=>6, day=>1),
                               # opt, takes precedence over 'days'
            end_date   => DateTime->today, # opt, takes precedence over 'days'

        print "Transactions: ";
        for my $tx (@{ $stmt->{transactions} }) {
            print "$tx->{date} $tx->{amount} $tx->{description}\n";

    # remember to call this, otherwise you will have trouble logging in again
    # for some time
    if ($ibank->logged_in) { $ibank->logout() }

    # utility routines
    my $res = $ibank->parse_statement($html);

Also see the examples/ subdirectory in the distribution for a sample script using this module.


RELEASE NOTE: This is an early release. Only parse_statement() for a single statement page is implemented.

This module provide a rudimentary interface to the web-based online banking interface of the Indonesian BPR Karyajatnika Sadaya (BPR KS, BPRKS) at You will need either Crypt::SSLeay or IO::Socket::SSL installed for HTTPS support to work (and strictly Crypt::SSLeay to enable certificate verification). WWW::Mechanize is required but you can supply your own mech-like object.

This module can only login to the individual edition of the site. I haven't checked out the other versions.

Warning: This module is neither offical nor is it tested to be 100% safe! Because of the nature of web-robots, everything may break from one day to the other when the underlying web interface changes.


This warning is from Simon Cozens' Finance::Bank::LloydsTSB, and seems just as apt here.

This is code for online banking, and that means your money, and that means BE CAREFUL. You are encouraged, nay, expected, to audit the source of this module yourself to reassure yourself that I am not doing anything untoward with your banking data. This software is useful to me, but is provided under NO GUARANTEE, explicit or implied.


Most methods die() when encountering errors, so you can use eval() to trap them.

Full response headers and bodies are dumped to a separate logger. See documentation on new() below and the sample script in examples/ subdirectory in the distribution.


skip_NEXT => BOOL

If set to true, then statement with NEXT status will be skipped.



Create a new instance. %args keys:


Login to the net banking site. You actually do not have to do this explicitly as login() is called by other methods like check_balance() or get_statement().

If login is successful, logged_in will be set to true and subsequent calls to login() will become a no-op until logout() is called.

Dies on failure.


Logout from the net banking site. You need to call this at the end of your program, otherwise the site will prevent you from re-logging in for some time (e.g. 10 minutes).

If logout is successful, logged_in will be set to false and subsequent calls to logout() will become a no-op until login() is called.

Dies on failure.


Return an array containing all account numbers that are associated with the current net banking login.


Return balance for specified account, or the default account if $account is not specified.


List ATM cards. Not yet implemented.

get_statement(%args) => $stmt

Get account statement. %args keys:

See parse_statement() on structure of $stmt.

parse_statement($html, %opts) => $res

Given the HTML text of the account statement results page, parse it into structured data:

 $stmt = {
    start_date     => $start_dt, # a DateTime object
    end_date       => $end_dt,   # a DateTime object
    account_holder => STRING,
    account        => STRING,    # account number
    currency       => STRING,    # 3-digit currency code
    transactions   => [
        # first transaction
          date        => $dt,  # a DateTime obj, book date ("tanggal pembukuan")
          seq         => INT,  # a number >= 1 which marks the sequence of
                               # transactions for the day
          amount      => REAL, # a real number, positive means credit (deposit),
                               # negative means debit (withdrawal)
          description => STRING,
          #is_pending  => BOOL,
          branch      => STRING, # a 4-digit branch/ATM code
          balance     => REAL,
        # second transaction

$html is the HTML text. Since there can be multiple pages, $html can also be an arrayref of HTML texts (this is not yet implemented).


 [$status, $err_details, $stmt]

$status is 200 if successful or some other 3-digit code if parsing failed. $stmt is the result (structure as above, or undef if parsing failed).

Options (%opts):

Additional notes:

The method can also handle some copy-pasted text from the GUI browser, but this is no longer documented or guaranteed to keep working.


Please visit the project's homepage at


Source repository is at


Please report any bugs or feature requests on the bugtracker website

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.


perlancar <>


This software is copyright (c) 2017, 2015, 2014, 2012 by

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: