Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Nordigen

Unofficial Nordigen API for JavaScript

author

vantezzen (https://github.com/vantezzen)

license

MIT License

Hierarchy

  • Nordigen

Index

Constructors

constructor

  • new Nordigen(accessToken: string, endpoint?: string): Nordigen
  • Create a new instance of the Nordigen API

    Example (es module)

    import Nordigen from 'nordigen'
    const nordigen = new Nordigen();
    

    Parameters

    • accessToken: string

      Access Token for the Nordigen API

    • Default value endpoint: string = "https://ob.nordigen.com/api"

      Endpoint URL for the Nordigen API

    Returns Nordigen

Properties

Private Readonly accessToken

accessToken: string

Access Token for the Nordigen API

Readonly endpoint

endpoint: string

Endpoint URL to use

Methods

createEndUserAgreement

  • createEndUserAgreement(enduser_id: string, aspsp_id: string, max_historical_days?: number): Promise<EndUserAgreement>
  • Create a new end user agreement for a user. Use this step only if you want to specify the length of transaction history you want to retrieve. If you skip this step, by default 90 days of transaction history will be retrieved

    Parameters

    • enduser_id: string

      A unique end-user ID of someone who's using your services, it has to be unique within your solution. Usually, it's UUID;

    • aspsp_id: string

      ASPSP ID (Bank ID) to use

    • Default value max_historical_days: number = 90

      The length of the transaction history to be retrieved

    Returns Promise<EndUserAgreement>

    End user agreement

createRequisition

  • createRequisition(enduser_id: string, redirect: string, reference: string, agreements?: readonly EndUserAgreement[], user_language?: string | undefined): Promise<Requisition>
  • Create a requisition for a user

    Parameters

    • enduser_id: string

      A unique end-user ID of someone who's using your services, it has to be unique within your solution. Usually, it's a UUID. If you have an end user agreement it has to be the ID of that user

    • redirect: string

      URI where the end user will be redirected after finishing authentication in ASPSP

    • reference: string

      Additional layer of unique ID defined by you

    • Default value agreements: readonly EndUserAgreement[] = []

      As an array of end user agreement IDs or an empty array if you don't have one

    • Default value user_language: string | undefined = undefined

      To enforce a language for all end user steps hosted by Nordigen passed as a two-letter country code (ISO 3166). If user_language is not defined a language set in browser will be used to determine language

    Returns Promise<Requisition>

    Requisition answer

getASPSPsForCountry

  • getASPSPsForCountry(countryCode: string): Promise<readonly ASPSP[]>
  • Get a list of ASPSPs (Banks) for a given country

    Parameters

    • countryCode: string

      Country code to use, e.g. "gb" for Great Britain

    Returns Promise<readonly ASPSP[]>

    Array of ASPSPs

getAccountBalances

  • getAccountBalances(account_id: string): Promise<BalanceData>
  • Get a list of all balances an account ID holds

    Parameters

    • account_id: string

      Account ID to check

    Returns Promise<BalanceData>

    Balances for the account

getAccountDetails

getAccountTransactions

  • Get a list of all transactions an account ID holds

    Parameters

    • account_id: string

      Account ID to check

    Returns Promise<TransactionData>

    Transactions for the account

getRequisitionInfo

  • getRequisitionInfo(requisition_id: string): Promise<Requisition>
  • Get information about a user requisition. This can be used to get a list of all user accounts by getting requisition.accounts

    Parameters

    • requisition_id: string

      Requisition ID of an existing requistion

    Returns Promise<Requisition>

    Requisition info

getRequisitionLink

  • getRequisitionLink(requsition: Requisition, aspsp_id: string): Promise<string | false>
  • Get the link for the user requisition

    Parameters

    • requsition: Requisition

      Requisition as returned by createRequisition

    • aspsp_id: string

      ID for the user's ASPSP (Bank)

    Returns Promise<string | false>

    Link for "false" if Nordigen didn't return one

makeRequest

  • makeRequest(path: string, method?: string, body?: Record<string, unknown> | false): Promise<any>
  • Make an authenticated request to the Nordigen API

    Parameters

    • path: string

      Relative path to the requested endpoint

    • Default value method: string = "GET"

      Method to use

    • Default value body: Record<string, unknown> | false = false

      Message Body

    Returns Promise<any>

    JSON Response

Generated using TypeDoc