Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

basiqio/basiq-javascript-sdk

Repository files navigation

Basiq Javascript SDK

This SDK is here to accelerate your integration with the Basiq API. You can check out the full docs for this SDK at GitHub, or head to our website to learn more about Basiq.

Installation

Install this package using npm

npm install @basiq/basiq-javascript-sdk

Usage

  1. Create an instance of the Basiq API object
var BasiqApi = require('@basiq/basiq-javascript-sdk');

var defaultClient = BasiqApi.ApiClient.instance;
  1. Authenticate by setting your access token (see postToken method)
var application = defaultClient.authentications['application'];
application.accessToken = "YOUR_ACCESS_TOKEN"
  1. Create an instance of the API object you need and call the relevant method.

Make sure to pass the relevant parameters and a callback to handle the response data.

See the full breakdown of requests and methods.

var accountsApi = new BasiqApi.AccountsApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('Call made successfully! Basiq returned: ' + data);
  }
};

api.getAccount(userId, accountId, callback);

Documentation for API Endpoints

All URIs are relative to https://au-api.basiq.io

Class Method HTTP request Description
BasiqApi.AccountsApi getAccount GET /users/{userId}/accounts/{accountId} Use this to retrieve the details of a specific account. This request will return back an account object with the latest data since the last refresh. If you require the latest account details you will need to call the connection refresh resource.
BasiqApi.AccountsApi getAccounts GET /users/{userId}/accounts Use this collection to retrieve a list of accounts. Each entry in the array is a separate account object.
BasiqApi.AffordabilityApi getAffordability GET /users/{userId}/affordability/{snapshotId} Retrieves the details of an affordability summary. You need only supply the unique affordability identifier.
BasiqApi.AffordabilityApi getAffordabilitySnapshotTransactions GET /users/{userId}/affordability/{snapshotId}/transactions Returns a paginated list with a data property that contains an array of transactions from the affordability snapshot.
BasiqApi.AffordabilityApi postAffordability POST /users/{userId}/affordability Use this to create a new affordability report.
BasiqApi.AuthLinksApi deleteAuthLink DELETE /users/{userId}/auth_link Permanently deletes an auth_link resource. Once deleted the URL associated with the deleted object will no longer be valid.
BasiqApi.AuthLinksApi getAuthLink GET /users/{userId}/auth_link Use this to retrieve the latest/last auth_link generated for the specified user..
BasiqApi.AuthLinksApi postAuthLink POST /users/{userId}/auth_link An Auth Link object can be generated to securely capture data from a User. Using the URL allows data to be captured via the hosted Basiq Connect Consent workflow for a given User.
BasiqApi.ConnectionsApi deleteConnection DELETE /users/{userId}/connections/{connectionId} Permanently deletes a connection.
BasiqApi.ConnectionsApi getConnection GET /users/{userId}/connections/{connectionId} Use this to retrieve details of a specific connection.
BasiqApi.ConnectionsApi getConnections GET /users/{userId}/connections Use this to retrieve details of the connections.
BasiqApi.ConnectionsApi postConnection POST /users/{userId}/connections Use this to create a new connection.
BasiqApi.ConnectionsApi refreshConnection POST /users/{userId}/connections/{connectionId}/refresh Use this to retrieve the latest financial data.
BasiqApi.ConnectionsApi refreshConnections POST /users/{userId}/connections/refresh Use this to refresh of all connections.
BasiqApi.ConnectionsApi updateConnection POST /users/{userId}/connections/{connectionId} Use this to update the details of a specific connection.
BasiqApi.EnrichApi getEnrich GET /enrich The Enrich resource enables you to retrieve details by passing in a search query containing a bank transaction description.
BasiqApi.ExpensesApi getExpenses GET /users/{userId}/expenses/{snapshotId} Retrieves the details of an expenses summary. You need only supply the unique expenses identifier.
BasiqApi.ExpensesApi postExpenses POST /users/{userId}/expenses Use this to create a new expenses report.
BasiqApi.IncomeApi getIncome GET /users/{userId}/income/{snapshotId} Retrieves the details of an income summary. You need only supply the unique income identifier.
BasiqApi.IncomeApi postIncome POST /users/{userId}/income Use this to create a new income report.
BasiqApi.InstitutionsApi getInstitution GET /institutions/{institutionID} Retrieves data for single institution.
BasiqApi.InstitutionsApi getInstitutions GET /institutions Retrieves institutions list.
BasiqApi.InstitutionsApi getPublicInstitutions GET /public/institutions Retrieves publically availiable (no authentication required) institutions list.
BasiqApi.JobsApi getJobs GET /jobs/{jobId} Retrieves the details of an existing job. You need only supply the unique job identifier that was returned upon job creation.
BasiqApi.JobsApi getUserJobs GET /users/{userId}/jobs Retrieves the details of an existing jobs. You need only supply the unique user identifier.
BasiqApi.StatementsApi createStatement POST /users/{userId}/statements A user can choose to share their financial data by uploading official pdf bank statements instead of creating a bank connection. Once the statement object is successfully created you can use it to obtain the user's latest financial data extracted from the bank statement i.e. accounts and transactions.
BasiqApi.TokenApi postToken POST /token
BasiqApi.TransactionsApi getTransaction GET /users/{userId}/transactions/{transactionId} Retrieves the details of an existing transaction.
BasiqApi.TransactionsApi getTransactions GET /users/{userId}/transactions Use this collection to retrieve a paginated list of transactions.
BasiqApi.UsersApi createUser POST /users Use this to create a new user object.
BasiqApi.UsersApi deleteUser DELETE /users/{userId} Delete a user.
BasiqApi.UsersApi getUser GET /users/{userId} Retrieves the details of an existing user. You need only supply the unique user identifier that was returned upon user creation.
BasiqApi.UsersApi updateUser POST /users/{userId} Updates the specified user by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

application

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • SERVER_ACCESS: Must only be used when making server side calls. This will provide you an all access token so should be handled securely on the server side.
    • CLIENT_ACCESS: This token has restricted access and only allows the creation or update of a connection. If an attacker intercepts a request and steals your CLIENT_ACCESS token, the risk is mitigated as they will not be able to get your users' data.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published