figo Node.js SDK
figo Node.js SDK is a package that contains a set of wrappers for figo Connect API and enables you to start creating applications in a Node.js environment immediately.
figo Connect API
figo Connect API allows you easily access bank accounts including payments submitting and transaction history. Our main goal is to provide banking applications with rich user experience and seamless integration.
For more information please check our website.
Get an API key
To get started with figo Connect you have to register your application first. Request your personal credentials using our online application form or just email us and we will be more than happy to provide you with a client ID and a secret without any bureaucracy.
The Latest Version
The latest version of this SDK can be found in GitHub repository.
Documentation
Detailed API reference is available online on our website.
Installation
Using npm
To install the SDK via npm use following command:
npm install figo@latest
Manually
Just clone our repository with your preferred method. For example:
git clone git://github.com/figo-connect/node-figo.git
Usage
Make a connection:
var figo = ; // Demo clientvar client_id = 'CaESKmC8MAhNpDe5rvmWnSkRE_7pkkVIIgMwclgzGcQY'; // Demo client IDvar client_secret = 'STdzfv0GXtEj_bwYn7AgCVszN1kKq5BdgEIKOM_fzybQ'; // Demo client secret var connection = client_id client_secret;
where client_id
and client_secret
are your application's credentials obtained from figo.
And create the first figo user:
// User personal datavar name = 'John Doe';var email = 'john.doe@example.com';var password = 'Swordfish';var language = 'en'; connection;
Authentication
From the figo Connect API reference:
“In order to access any information belonging to a user, a client has to authenticate with a token linking itself to the user. This token is called an access token and contains information on the client, the user and the level of access the client has to the users data.”
Log in to obtain such access token:
var access_token = ''; connection;
Once you have an access token you can perform the rest of operations with the API.
Session
But first create a session using the access token from the previous step:
var session = access_token;
Examples
Accounts
Retrieve all bank accounts
To get all the bank accounts user has chosen to share with your application use get_accounts
function:
session;
Transactions
Retrieve transactions of one or all accounts
session;
Standing Orders
Retrieve standing orders of one or all accounts
session;
Securities
Retrieve securities of one or all accounts
session;
Payments
Retrieve all or one payment(s)
// Retrieve all available paymentssession;
Create a single payment
figo Connect API allows you not only to get an information related to bank accounts, but also to submit wire transfers on behalf of the account owner which is a two-step process:
- First, you have to compile a payment object and submit it to the figo Connect API.
- Second, you need to submit the newly created payment to the bank itself via the figo Connect API. Although any interaction with the API is done live, customer bank's servers might take some time to reply. In order to handle this figo Connect API will create a background task and will return a task token to your application on step two. Using this task token you can later poll the result of the task execution.
Tests
Running the Unit Tests
Make sure you have all the necessary dependencies:
npm install
You need to set the following environment variables:
FIGO_CLIENT_ID
FIGO_CLIENT_SECRET
FIGO_API_ENDPOINT
(optional, defaults tohttps://staging.figo.me/v3
)
npm test
License
figo Node.js SDK is released under the MIT License.
Changelog and New Features
3.1.2
- updated dependencies to current stable versions
3.1.1
- Dropped support for node.js 4.0
- removed cert-pinning to support new figo infrastructure
1.6.0
- Use SHA-256 to validate certificate fingerprint (
5496e58
) - Node.js versions 0.10 and older are no longer supported (
afeb565
)
1.5.1
- Create a
.stack
property onFigoError
object: https://github.com/figo-connect/node-figo/pull/27
1.5.0
- Minor feature
1.4.4
- Minor bugfix
- Code beautified
1.4.3
- Minor bugfix
1.4.2
- Minor bugfix
1.4.1
- Certificate fingerprint update
1.4.0
- Errors are now instances of JavaScript standard built-in
Error
object
1.2.0
-
Added wrappers for the following API calls
- Authentication: Credential Login, Unlock a figo account;
- User Management: Start forgot password process, Re-send unlock code, Re-send verification email;
- Accounts: Set bank account sort order;
- Account setup & synchronization: Retrieve list of supported banks, credit cards, other payment services, Retrieve list of supported credit cards and other payment services, Retrieve list of all supported banks, Retrieve login settings for a bank or service, Setup new bank account;
- Transactions: Modify a transaction, Modify all transactions of one or all accounts, Delete a transaction;
- Standing Orders: Retrieve standing_orders of one or all accounts;
- Securities: Retrieve a security, Retrieve securities of one or all accounts, Modify a security, Modify all securities of one or all;
- Payments: Retrieve payment proposals;
- Task Processing: Begin task, Poll task state, Cancel a task;
- Business Process System: Begin process, Create a process;
-
Minor fixes
1.1.1
Previous release which was done before starting to maintain the above changelog.
Contributing and Bug Reporting
Please submit bug reports and your suggestions to the GitHub issue tracker. Feel free to add pull requests as well.