![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@dapi-co/dapi-node
Advanced tools
The DAPI Node is a library that runs as part of your backend and handles communication between your backend and the Dapi API (https://api.dapi.com).
This repo contains the source code of the library. To build the library, run the below script:
npm run build
This will create a folder called lib
in the folder.
I have included an example folder to make it wasy for any developer to play with this library. But since this example is in ts
, you will have to compile the ts
to js
and then run the js output file. To do this run the below script
tsc ./example/Client.ts && node ./example/Client.js
Note: For the above script to work, you need to install
typescript
globally on your system.
sh npm install -g typescript
A list of all options on the DAPI Node that your backend can call to perform some operations.
Auth Product:
auth.exchangeToken
Data Product:
data.getIdentity
data.getAccounts
data.getCompleteAccounts
data.getAccountBalance
data.getAccountTransactions
data.getCards
data.getCardBalance
data.getCardTransactions
Payment Product:
payment.getBeneficiaries
payment.createBeneficiary
payment.createTransfer
payment.transferAutoFlow
Metadata Product:
metadata.getAccounts
All the responses have the fields described here. Meaning all the responses described below in the document will have following fields besides the ones specific to each response.
Parameter | Type | Description |
---|---|---|
operationID | string | Unique ID generated to identify a specific operation. |
success | boolean | Returns true if request is successful and false otherwise." |
status | string | The status of the job. done - Operation Completed. failed - Operation Failed. user_input_required - Pending User Input. initialized - Operation In Progress. For further explanation see Operation Statuses. |
userInputs | IUserInput[] | Array of IUserInput objects, that are needed to complete this operation. 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 | string | Type of error encountered. Note: It's only returned if operation status is failed |
msg | string | Detailed description of the error. Note: It's only returned if operation status is failed |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. 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. |
Method is used to obtain user's permanent access token by exchanging it with access code received during the user authentication (user login).
You can read more about how to obtain a permanent token on Obtain an Access Token.
async exchangeToken(accessCode: string, connectionID: string): Promise<IExchangeTokenResponse>
Parameter | Type | Description |
---|---|---|
accessCode REQUIRED | string | Unique code for a user’s successful login to Connect. Returned in the response of UserLogin. |
connectionID REQUIRED | string | The connectionID from a user’s successful log in to Connect. |
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 | string | A unique permanent token linked to the user. |
Method is used to retrieve personal details about the user.
async getIdentity(accessToken: string, userSecret: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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 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 | IIdentity | An object containing the identity data of the user. For the exact schema of the identity object, see Identity schema. |
Method is used to retrieve list of all the bank accounts registered on the user. The list will contain all types of bank accounts.
async getAccounts(accessToken: string, userSecret: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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 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 | IAccount[] | An array containing the accounts data of the user. For the exact schema of the accounts array, see Account schema. |
Method is used to retrieve list of all the bank accounts registered on the user, with the balance of each account inside it. The list will contain all types of bank accounts.
async getCompleteAccounts(accessToken: string, userSecret: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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 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 | IAccount[] | An array containing the accounts data of the user. For the exact schema of the accounts array, see Account schema. |
Method is used to retrieve balance on specific bank account of the user.
async getAccountBalance(accessToken: string, userSecret: string, accountID: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
accountID REQUIRED | string | The bank account ID which its balance is requested. Retrieved from one of the accounts returned from the GetAccounts method. |
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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 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 | IBalance | An object containing the account's balance information. For the exact schema of the balance object, see Balance schema. |
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.
async getTransactions(accessToken: string, userSecret: string, accountID: string, fromDate: Date, toDate: Date, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
accountID REQUIRED | string | The bank account ID which its balance is requested. Retrieved from one of the accounts returned from the GetAccounts method. |
fromDate REQUIRED | Date | The start date of the transactions wanted. It should be in this format YYYY-MM-DD . |
toDate REQUIRED | Date | The end date of the transactions wanted. It should be in this format YYYY-MM-DD . |
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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 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 | ITransaction[] | Array containing the transactional data for the specified account within the specified period. For the exact schema of the transactions array, see Transaction schema. |
Method is used to retrieve list of all the beneficiaries already added for a user within a financial institution.
async getBeneficiaries(accessToken: string, userSecret: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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 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 | IBeneficiary[] | An array containing the beneficiary information. For the exact schema of the beneficiaries array, see Beneficiary schema. |
Method is used to create a Beneficiary for a user within a financial institution.
async createBeneficiary(beneficiary: ICBBeneficiary, accessToken: string, userSecret: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
beneficiary REQUIRED | ICBBeneficiary | An object that contains info about the beneficiary that should be added. |
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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. |
Method returns only the fields defined in the BaseResponse.
Method is used to initiate a new payment from one account to another account.
We suggest you use transferAutoflow
method instead to initiate a payment. transferAutoflow
abstracts all the validations and processing logic, required to initiate a transaction using createTransfer
method.
You can read about transferAutoflow
further in the document.
async createTransfer(transfer: ITransfer, accessToken: string, userSecret: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
transfer REQUIRED | ITransfer | An object that contains info about the transfer that should be initiated. |
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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. |
Parameter | Type | Description |
---|---|---|
senderID REQUIRED | string | 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 | number | The amount of money which should be sent. |
receiverID OPTIONAL | string | 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 | string | 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 | string | 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 | string | 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. |
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. |
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.
async transferAutoFlow(transfer: ITransferAutoflow, accessToken: string, userSecret: string, operationID?: string, userInputs?: IUserInputs[])
Parameter | Type | Description |
---|---|---|
transfer REQUIRED | ITransferAutoflow | An object that contains info about the transfer that should be initiated, and any other details that's used to automate the operation. |
accessToken REQUIRED | string | Access Token obtained using the exchangeToken method. |
userSecret REQUIRED | string | The userSecret from a user’s successful log in to Connect. |
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 | IUserInputs[] | Array of IUserInputs objects, 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 |
Parameter | Type | Description |
---|---|---|
id | string | Type of input required. You can read more about user input types on User Input Types. |
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. |
Parameter | Type | Description |
---|---|---|
senderID REQUIRED | string | 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 | number | The amount of money which should be sent. |
beneficiary REQUIRED | IBeneficiary | An object that holds the info about the beneficiary which the money should be sent to. |
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. |
FAQs
NodeJS library to talk to the dapi api
The npm package @dapi-co/dapi-node receives a total of 18 weekly downloads. As such, @dapi-co/dapi-node popularity was classified as not popular.
We found that @dapi-co/dapi-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.