Fetch with Python
You can use the python package to fetch enriched data for an entity.
Part 1 of this article with details on installing the package, authentication, advanced settings, identity and uploading statements are listed on this page.
#
AccountsTo fetch accounts use the get_accounts
method. It returns an iterator to the account dictionary list, after fetching.
NOTE
If the value was not previously retrieved, it will poll and check for progress, and then fetch and cache the retrieved value for next usage.
#
ArgumentsThis method also has the following optional arguments:
| Argument | Type | Description | Default |
| - | - | - | - |
| reload | Boolean | If provided as True
, it will ignore the cached value, and again make an API call and re-fetch the values | False
|
#
ExceptionsIn case the
create
method was used while creating the entity instance and the entity object was not created on the server yet, it throwsValueError
.In case server could not be reached, it throws
ServiceTimeOutError
(finbox_bankconnect.custom_exceptions.ServiceTimeOutError
).In case
entity_id
cannot be found in our server, it throwsEntityNotFoundError
(finbox_bankconnect.custom_exceptions.EntityNotFoundError
)In case the account information could not be extracted by us, it will throw
ExtractionFailedError
(finbox_bankconnect.custom_exceptions.ExtractionFailedError
)
#
Account DictionarySample account dictionary:
Each of the account dictionary in the account list has the following keys:
months
: month and year for which data is available. Each of string in this list is of format"YYYY-MM"
statements
: list of statement unique identifiers under the accountaccount_id
: unique identifier for an accountbank
: name of the bank to which the account belongs
It also has some account level extracted fields like ifsc
, micr
, account_number
(which can be None
or could hold a string
value)
#
FraudTo fetch fraud information use the get_fraud_info
method. It returns an iterator to the fraud dictionary list, after fetching.
NOTE
If the value was not previously retrieved, it will poll and check for progress, and then fetch and cache the retrieved value for next usage.
#
ArgumentsThis method also has the following optional arguments:
| Argument | Type | Description | Default |
| - | - | - | - |
| reload | Boolean | If provided as True
, it will ignore the cached value, and again make an API call and re-fetch the values | False
|
#
ExceptionsIn case the
create
method was used while creating the entity instance and the entity object was not created on the server yet, it throwsValueError
.In case server could not be reached, it throws
ServiceTimeOutError
(finbox_bankconnect.custom_exceptions.ServiceTimeOutError
).In case
entity_id
cannot be found in our server, it throwsEntityNotFoundError
(finbox_bankconnect.custom_exceptions.EntityNotFoundError
)In case the statement could not be extracted by us, it will throw
ExtractionFailedError
(finbox_bankconnect.custom_exceptions.ExtractionFailedError
)
#
Fraud DictionarySample fraud dictionary:
Each of the fraud dictionaries includes the keys statement_id
and fraud_type
indicating a fraud of which type was found in which statement.
Optionally a key transaction_hash
may be present in some cases in this dictionary for transaction-level frauds indicating the transaction in which the fraud was found.
To know more about fraud_type
, refer to Fraud section in Basics.
#
TransactionsTo fetch transactions use the get_transactions
method. It returns an iterator to the transaction dictionary list, after fetching.
NOTE
If the value was not previously retrieved, it will poll and check for progress, and then fetch and cache the retrieved value for next usage.
#
ArgumentsThis method also has the following optional arguments:
| Argument | Type | Description | Default |
| - | - | - | - |
| reload | Boolean | If provided as True
, it will ignore the cached value, and again make an API call and re-fetch the values | False
|
| account_id | String | If provided, only the transactions of specific account_id
will be retrieved | - |
| from_date | datetime.date
object | If provided, only the transactions with a date greater than or equal to from_date
will be retrieved. | - |
| to_date | datetime.date
object | If provided, only the transactions with a date less than or equal to to_date
will be retrieved. | - |
An example for fetching transactions from last 10 days till today:
#
ExceptionsIn case there is any problem with arguments passed or if
create
method was used while creating the entity instance and the entity object was not created on the server yet, it throwsValueError
.In case server could not be reached, it throws
ServiceTimeOutError
(finbox_bankconnect.custom_exceptions.ServiceTimeOutError
).In case
entity_id
cannot be found in our server, it throwsEntityNotFoundError
(finbox_bankconnect.custom_exceptions.EntityNotFoundError
)In case the transactions could not be extracted by us, it will throw
ExtractionFailedError
(finbox_bankconnect.custom_exceptions.ExtractionFailedError
)
#
Transaction DictionarySample transaction dictionary:
Each of the transaction dictionary in the transaction list has the following keys:
transaction_note
: exact transaction note / description present in the statement PDFhash
: a unique identifying hash for each transactiondescription
: describes more information about thetransaction_channel
field. Refer to this list for possible values.account_id
: unique UUID4 identifier for the account to which the transaction belongs totransaction_type
: can bedebit
orcredit
amount
: indicates the transaction amountdate
: date of transactionmerchant_category
: the category of the merchant in case a transaction is with a merchant. Refer to this list of possible values.balance
: account balance just after this transactiontransaction_channel
: refer to this list for possible values.
#
SalaryTo fetch salary transactions use the get_salary
method. It returns an iterator to the salary dictionary list, after fetching.
NOTE
If the value was not previously retrieved, it will poll and check for progress, and then fetch and cache the retrieved value for next usage.
#
ArgumentsThis method also has the following optional arguments:
| Argument | Type | Description | Default |
| - | - | - | - |
| reload | Boolean | If provided as True
, it will ignore the cached value, and again make an API call and re-fetch the values | False
|
| account_id | String | If provided, only the salary of specific account_id
will be retrieved | - |
| from_date | datetime.date
object | If provided, only the salary with a date greater than or equal to from_date
will be retrieved. | - |
| to_date | datetime.date
object | If provided, only the salary with a date less than or equal to to_date
will be retrieved. | - |
#
ExceptionsIn case there is any problem with arguments passed or if
create
method was used while creating the entity instance and the entity object was not created on the server yet, it throwsValueError
.In case server could not be reached, it throws
ServiceTimeOutError
(finbox_bankconnect.custom_exceptions.ServiceTimeOutError
).In case
entity_id
cannot be found in our server, it throwsEntityNotFoundError
(finbox_bankconnect.custom_exceptions.EntityNotFoundError
)In case the transactions could not be extracted by us, it will throw
ExtractionFailedError
(finbox_bankconnect.custom_exceptions.ExtractionFailedError
)
#
Salary DictionarySample salary dictionary:
Each of the salary dictionary in the transaction list has the following keys:
balance
: account balance just after this transactionhash
: a unique identifying hash for each transactiondescription
: describes more information about thetransaction_channel
field. Refer to this list for possible values.clean_transaction_note
: Transaction note in clean English wordsaccount_id
: unique UUID4 identifier for the account to which the transaction belongs totransaction_type
: can bedebit
orcredit
date
: date of transactionamount
: indicates the transaction amountmonth_year
: month and year for which the salary ismerchant_category
: the category of the merchant in case a transaction is with a merchant. Refer to this list of possible values.transaction_channel
: refer to this list for possible values.transaction_note
: exact transaction note / description present in the statement PDF
#
Recurring TransactionsTo fetch recurring transactions use the get_credit_recurring
and get_debit_recurring
methods for credit and debit respectively. Both of these return an iterator to the recurring dictionary list, after fetching.
NOTE
If the value was not previously retrieved, it will poll and check for progress, and then fetch and cache the retrieved value for next usage.
#
ArgumentsBoth of these methods have the following optional arguments:
| Argument | Type | Description | Default |
| - | - | - | - |
| reload | Boolean | If provided as True
, it will ignore the cached value, and again make an API call and re-fetch the values | False
|
| account_id | String | If provided, only the recurring transactions of specific account_id
will be retrieved | - |
#
ExceptionsIn case there is any problem with arguments passed or if
create
method was used while creating the entity instance and the entity object was not created on the server yet, it throwsValueError
.In case server could not be reached, it throws
ServiceTimeOutError
(finbox_bankconnect.custom_exceptions.ServiceTimeOutError
).In case
entity_id
cannot be found in our server, it throwsEntityNotFoundError
(finbox_bankconnect.custom_exceptions.EntityNotFoundError
)In case the transactions could not be extracted by us, it will throw
ExtractionFailedError
(finbox_bankconnect.custom_exceptions.ExtractionFailedError
)
#
Recurring Transaction DictionarySample recurring transaction dictionary:
Each of the recurring transaction dictionary (both credit and debit) has the following keys:
account_id
: unique UUID4 identifier for the account to which transaction set belongs tostart_date
: the start date for the recurring transaction setend_date
: end date for the recurring transaction settransaction_channel
: transaction channel in upper case. Refer to this list for possible values.median
: median of the transaction amounts under the given recurring transaction settransactions
: list of transaction dictionary under the recurring transaction set. Each transaction dictionary here has the same keys as a transaction dictionary inget_transactions
(Refer here to know about the keys).
#
Lender TransactionsTo fetch lender transactions use the get_lender_transactions
method. It returns an iterator to the lender transaction dictionary list, after fetching.
NOTE
If the value was not previously retrieved, it will poll and check for progress, and then fetch and cache the retrieved value for next usage.
#
ArgumentsThis method also has the following optional arguments:
| Argument | Type | Description | Default |
| - | - | - | - |
| reload | Boolean | If provided as True
, it will ignore the cached value, and again make an API call and re-fetch the values | False
|
| account_id | String | If provided, only the lender transactions of specific account_id
will be retrieved | - |
| from_date | datetime.date
object | If provided, only the lender transactions with a date greater than or equal to from_date
will be retrieved. | - |
| to_date | datetime.date
object | If provided, only the lender transactions with a date less than or equal to to_date
will be retrieved. | - |
#
ExceptionsIn case there is any problem with arguments passed or if
create
method was used while creating the entity instance and the entity object was not created on the server yet, it throwsValueError
.In case server could not be reached, it throws
ServiceTimeOutError
(finbox_bankconnect.custom_exceptions.ServiceTimeOutError
).In case
entity_id
cannot be found in our server, it throwsEntityNotFoundError
(finbox_bankconnect.custom_exceptions.EntityNotFoundError
)In case the transactions could not be extracted by us, it will throw
ExtractionFailedError
(finbox_bankconnect.custom_exceptions.ExtractionFailedError
)
#
Lender Transaction DictionarySample lender transaction dictionary:
Each of the lender transaction dictionary in the transaction list has the following keys:
transaction_note
: exact transaction note / description present in the statement PDFhash
: a unique identifying hash for each transactiondescription
: describes more information about thetransaction_channel
field. Refer to this list for possible values.account_id
: unique UUID4 identifier for the account to which the transaction belongs totransaction_type
: can bedebit
orcredit
amount
: indicates the transaction amountdate
: date of transactionmerchant_category
: the category of the merchant in case a transaction is with a merchant. Refer to this list of possible values.balance
: account balance just after this transactiontransaction_channel
: refer to this list for possible values.