Python Library Reference
Disclaimer
Dapi's API request and response params are in
camelCase
, so while this library followsPEP8
standard and usessnake_case
for all arguments, all responses will be incamelCase
.
BaseResponse
All the responses extend BaseResponse class. Meaning all the responses described below in the document will have following fields besides the ones specific to each response.
Parameter | Type | Description |
---|---|---|
operationID | str | Unique ID generated to identify a specific operation. |
success | bool | Returns true if request is successful and false otherwise. |
status | str | The status of the job.done - Operation Completed.failed - Operation Failed.user_input_required - Pending User Input.initialized - Operation In Progress. |
userInputs | [dict] | Specifies the type of further information required from the user before the job can be completed. Note: It's only returned if operation status is user_input_required |
type | str | Type of error encountered. Note: It's only returned if operation status is failed . |
msg | str | Detailed description of the error. Note: It's only returned if operation status is failed . |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
query | str | Textual description of what is required from the user side. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Methods
auth.exchangeToken
Method is used to obtain user's permanent access token by exchanging it with access code received during the user authentication (user login).
Note
You can read more about how to obtain a permanent token on Obtain an Access Token..
Method Description
def exchangeToken(access_code, connection_id) -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
access_code REQUIRED | str | Unique code for a user’s successful login to Connect . Returned in the response of UserLogin . |
connection_id REQUIRED | str | The connectionIDz from a user’s successful log in to Connect`. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be returned if the status is done
:
Parameter | Type | Description |
---|---|---|
accessToken | str | A unique permanent token linked to the user. |
DapiApp.getIdentity
This method is used to retrieve personal details about the user.
Method Description
def getIdentity(access_token, user_secret, user_inputs=[], operation_id="") -> dict
Method Description
Parameter | Type | Description |
---|---|---|
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect . |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification onSpecify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be returned if the status is done
:
Parameter | Type | Description |
---|---|---|
identity | [dict] | An object containing the identity data of the user. |
DapiApp.getAccounts
Method is used to retrieve list of all the bank accounts registered on the user. The list will contain all types of bank accounts.
Method Description
def getAccounts(access_token, user_secret, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id REQUIRED | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be returned if the status is done
:
Parameter | Type | Description |
---|---|---|
accounts | [dict] | An array containing the accounts data of the user. |
DapiApp.getBalance
This method is used to retrieve balance on specific bank account of the user.
Method Description
def getBalance(access_token, user_secret, account_id, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
account_id REQUIRED | str | The bank account ID which its balance is requested. Retrieved from one of the accounts returned from the getAccounts method. |
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be valid if the status is done
:
Parameter | Type | Description |
---|---|---|
balance | [dict] | An object containing the account's balance information. |
DapiApp.getTransactions
Method is used to retrieve transactions that user has performed over a specific period of time from their bank account. The transaction list is unfiltered, meaning the response will contain all the transactions performed by the user (not just the transactions performed using your app).
Date range of the transactions that can be retrieved varies for each bank. The range supported by the users bank is shown in the response parameter transactionRange
of Get Accounts Metadata endpoint.
Method Description
def getTransactions(access_token, user_secret, account_id, from_date, to_date, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
account_id REQUIRED | String | The bank account ID which its transactions are requested. Retrieved from one of the accounts returned from the getAccounts method. |
from_date REQUIRED | str | The start date of the transactions wanted. |
to_date REQUIRED | str | The end date of the transactions wanted. |
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be valid if the status is done
:
Parameter | Type | Description |
---|---|---|
transactions | [dict] | Array containing the transactional data for the specified account within the specified period. |
DapiApp.getCategorizedTransactions
Method is used to retrieve transactions that user has performed over a specific period of time from their bank account. The transaction list is unfiltered, meaning the response will contain all the transactions performed by the user (not just the transactions performed using your app).
Every transaction in the response is categorized. Transaction categories stay the same across all banks.
Date range of the transactions that can be retrieved varies for each bank. The range supported by the users bank is shown in the response parameter transactionRange
of Get Accounts Metadata endpoint.
Method Description
def getCategorizedTransactions(access_token, user_secret, account_id, from_date, to_date, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
account_id REQUIRED | String | The bank account ID which its transactions are requested. Retrieved from one of the accounts returned from the getAccounts method. |
from_date REQUIRED | str | The start date of the transactions wanted. |
to_date REQUIRED | str | The end date of the transactions wanted. |
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be valid if the status is done
:
Parameter | Type | Description |
---|---|---|
transactions | [dict] | Array containing the transactional data for the specified account within the specified period, plus transaction category. |
DapiApp.getEnrichedTransactions
Method is used to retrieve transactions that user has performed over a specific period of time from their bank account. The transaction list is unfiltered, meaning the response will contain all the transactions performed by the user (not just the transactions performed using your app).
Every transaction in the response is categorized and has further details about the brand that the transfer is associated with. Transaction categories stay the same across all banks.
Date range of the transactions that can be retrieved varies for each bank. The range supported by the users bank is shown in the response parameter transactionRange
of Get Accounts Metadata endpoint.
Method Description
def getEnrichedTransactions(access_token, user_secret, account_id, from_date, to_date, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
account_id REQUIRED | String | The bank account ID which its transactions are requested. Retrieved from one of the accounts returned from the getAccounts method. |
from_date REQUIRED | str | The start date of the transactions wanted. |
to_date REQUIRED | str | The end date of the transactions wanted. |
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be valid if the status is done
:
Parameter | Type | Description |
---|---|---|
transactions | [dict] | Array containing the transactional data for the specified account within the specified period, plus transaction category & brand details. |
DapiApp.getBeneficiaries
This method is used to retrieve a list of all the beneficiaries already added for a user within a financial institution.
Method Description
def getBeneficiaries(access_token, user_secret, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be returned if the status is done
:
Parameter | Type | Description |
---|---|---|
beneficiaries | [dict] | An array containing the beneficiary information. |
DapiApp.createBeneficiary
This method is used to retrieve a list of all the beneficiaries already added for a user within a financial institution.
Method Description
def createBeneficiary(access_token, user_secret, beneficiary_data, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
beneficiary_data REQUIRED | dict | An object that contains info about the beneficiary that should be added. |
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
beneficiary_data Object
Parameter | Type | Description |
---|---|---|
name REQUIRED | str | Name of the beneficiary. |
nickname REQUIRED | str | Nickname of the beneficiary. |
accountNumber REQUIRED | str | Account number of the beneficiary. |
iban REQUIRED | str | Beneficiary's IBAN number. |
swiftCode REQUIRED | str | Beneficiary's financial institution's SWIFT code. |
type REQUIRED | str | Type of beneficiary. For further explanation see Beneficiary Types. |
address REQUIRED | dict | An object containing the address information of the beneficiary. |
country REQUIRED | str | Name of the country in all uppercase letters. |
branchAddress REQUIRED | str | Address of the financial institution’s specific branch. |
branchName REQUIRED | str | Name of the financial institution’s specific branch. |
phoneNumber OPTIONAL | str | Beneficiary's phone number. |
routingNumber OPTIONAL | str | Beneficiary's Routing number, needed only for US banks accounts. |
address Object
Parameter | Type | Description |
---|---|---|
line1 REQUIRED | str | Street name and number. Note: value should not contain any commas or special characters. |
line2 REQUIRED | str | City name. Note: value should not contain any commas or special characters. |
line3 REQUIRED | str | Country name. Note: value should not contain any commas or special characters. |
Response
Method returns only the fields defined in the BaseResponse.
payment.createTransfer
This method is used to initiate a new payment from one account to another account.
Note
We suggest you use
transferAutoflow
method instead to initiate a payment.transferAutoflow
abstracts all the validations and processing logic, required to initiate a transaction usingcreateTransfer
method.You can read about
transferAutoFlow
further in the document.
Method Description
def createTransfer(access_token, user_secret, transfer_data, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
transfer_data REQUIRED | dict | An object that contains info about the transfer that should be initiated, and any other details that's used to automate the operation. |
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
transfer_data Object
Parameter | Type | Description |
---|---|---|
senderID REQUIRED | str | The id of the account which the money should be sent from. Retrieved from one of the accounts array returned from the getAccounts method. |
amount REQUIRED | float | The amount of money which should be sent. |
receiverID OPTIONAL | str | The id of the beneficiary which the money should be sent to. Retrieved from one of the beneficiaries array returned from the getBeneficiaries method. Needed only when creating a transfer from a bank that requires the receiver to be already registered as a beneficiary to perform a transaction. |
name OPTIONAL | str | The name of receiver. Needed only when creating a transfer from a bank that handles the creation of beneficiaries on its own, internally, and doesn't require the receiver to be already registered as a beneficiary to perform a transaction. |
accountNumber OPTIONAL | str | The Account Number of the receiver's account. Needed only when creating a transfer from a bank that handles the creation of beneficiaries on its own, internally, and doesn't require the receiver to be already registered as a beneficiary to perform a transaction. |
iban OPTIONAL | str | The IBAN of the receiver's account. Needed only when creating a transfer from a bank that handles the creation of beneficiaries on its own, internally, and doesn't require the receiver to be already registered as a beneficiary to perform a transaction. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be returned if the status is done
:
Parameter | Type | Description |
---|---|---|
reference | String | Transaction reference string returned by the bank. |
DapiApp.transferAutoflow
This method is used to initiate a new payment from one account to another account, without having to care nor handle any special cases or scenarios.
Method Description
def transferAutoflow(access_token, user_secret, transfer_autoflow_data, user_inputs=[], operation_id="") -> dict
Input Parameters
Parameter | Type | Description |
---|---|---|
transfer_autoflow_data REQUIRED | dict | An object that contains info about the transfer that should be initiated, and any other details that's used to automate the operation. |
access_token REQUIRED | str | Access Token obtained using the exchangeToken method. |
user_secret REQUIRED | str | The userSecret from a user’s successful log in to Connect. |
operation_id OPTIONAL | str | The operationID from a previous call's response.Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
user_inputs OPTIONAL | [dict] | Array of UserInput object, that are needed to complete this operation.Required only if a previous call responded with user_input_required status.You can read more about user inputs specification on Specify User Input |
UserInput Object
Parameter | Type | Description |
---|---|---|
id | str | Type of input required. You can read more about user input types on User Input Types. |
index | int | Is used in case more than one user input is requested. Will always be 0 If only one input is requested. |
answer | str | User input that must be submitted. In the response it will always be empty. |
transfer_autoflow_data Object
Parameter | Type | Description |
---|---|---|
senderID REQUIRED | str | The id of the account which the money should be sent from. Retrieved from one of the accounts array returned from the getAccounts method. |
amount REQUIRED | float | The amount of money which should be sent. |
beneficiary REQUIRED | dict | An object that holds the info about the beneficiary which the money should be sent to. |
bankID REQUIRED | str | The bankID of the user which is initiating this transfer. |
beneficiary Object
Parameter | Type | Description |
---|---|---|
name REQUIRED | str | Name of the beneficiary. |
nickname REQUIRED | str | Nickname of the beneficiary. |
accountNumber REQUIRED | str | Account number of the beneficiary. |
iban REQUIRED | str | Beneficiary's IBAN number. |
swiftCode REQUIRED | str | Beneficiary's financial institution's SWIFT code. |
address REQUIRED | dict | An object containing the address information of the beneficiary. |
country REQUIRED | str | Name of the country in all uppercase letters. |
branchAddress REQUIRED | str | Address of the financial institution’s specific branch. |
branchName REQUIRED | str | Name of the financial institution’s specific branch. |
phoneNumber OPTIONAL | str | Beneficiary's phone number. |
routingNumber OPTIONAL | str | Beneficiary's Routing number, needed only for US banks accounts |
address Object
Parameter | Type | Description |
---|---|---|
line1 REQUIRED | str | Street name and number. Note: value should not contain any commas or special characters. |
line2 REQUIRED | str | City name. Note: value should not contain any commas or special characters. |
line3 REQUIRED | str | Country name. Note: value should not contain any commas or special characters. |
Response
In addition to the fields described in the BaseResponse, it has the following fields, which will only be returned if the status is done
:
Parameter | Type | Description |
---|---|---|
reference | String | Transaction reference string returned by the bank. |
ACH
ach.createPull
Method is used to create an ACH Pull transaction
Method Description
def createPull(self, access_token, user_secret, transfer_data, user_inputs=[], operation_id="")
Input Parameters
Name | Type | Description |
---|---|---|
accessToken REQUIRED | String | Access Token obtained using Exchange Token method. You can read more about how to obtain a permanent token on Obtain an Access Token |
userSecret REQUIRED | String | User secret returned during the successful authentication in Connect Layer |
transfer REQUIRED | Object<Transfer> | Details of the ACH transfer |
operationID OPTIONAL | String | The operationID from a previous call's response. Required only when resuming a previous call that responded with user_input_required status, to provided user inputs. |
userInputs OPTIONAL | Array<userInputs> | Array of UserInputs object, required only if initial request responded with user inputs specification. You can read more about user inputs specification on Specify User Input |
Transfer Object
Name | Type | Description |
---|---|---|
senderId | String | senderId of the Account from where the amount must be transferred. |
amount | Number | Amount of the transfer |
description | String | A message associated with the transfer. |
UserInputs Object
Name | Type | Description |
---|---|---|
id | Enum | Type of input required. Can be one of the following:otp secret_question captcha pin confirmation token You can read more about user input types on User Input Types |
query | String | Textual description of what is required from the user side |
index | Number | Is used in case more than one user input is requested. will always be 0 If only one input is requested. |
answer | String | User input that must be submitted. In the response it will always be empty. |
Response
Method returns standard Base Response. You can find description of standard response in the beginning of the document.
ach.getPull
Method is used to get an existing ACH Pull transaction
Method Description
def getPull(self, access_token, user_secret, operation_id, user_inputs=[])
Input Parameters
Name | Type | Description |
---|---|---|
accessToken REQUIRED | String | Access Token obtained using Exchange Token method. You can read more about how to obtain a permanent token on Obtain an Access Token |
userSecret REQUIRED | String | User secret returned during the successful authentication in Connect Layer |
operationID REQUIRED | String | The operationID from a previous call's response. Used to locate the ACH transaction. |
userInputs OPTIONAL | Array<userInputs> | Array of UserInputs object, required only if initial request responded with user inputs specification. You can read more about user inputs specification on Specify User Input |
Response
Name | Type | Description |
---|---|---|
transfer | Object<Transfer> | Details of the ACH transfer |
Transfer Object
Name | Type | Description |
---|---|---|
status | String | Status of the transfer (ENUM: 'pending', 'completed', 'returned', 'rejected') |
amount | Number | Amount of the transfer |
currency | Object<Currency> | Currency type of the transfer |
Currency Object
Name | Type | Description |
---|---|---|
Code | String | Currency code |
Name | String | Full name of the Currency |
Updated 11 months ago