2.0.1 • Published 3 years ago

@appsaloon/ponto v2.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
3 years ago

ponto-nodejs

JavaScript Style Guide

Ponto API Nodejs client

Based on their REST API

Features

  • Authentication and accessToken management
  • Accounts
  • Synchronisation of account details

Install

npm install ponto

Usage

Initialize

const Ponto = require('ponto')
const sandboxMode = true
const ponto = new Ponto()('<ponto_client_id>', '<ponto_client_secret>', sandboxMode)

Notes:

  • Ponto can be initialised in sandbox mode for testing purpose.

ponto.listFinancialInstitutions (production & sandbox)

const pagingParameters = {
  limit: 2, // Defaults :100
  before: '<financialInstitutionId>', // cursor for pagination
  after: '<financialInstitutionId>', // cursor for pagination
} 
const response = await ponto.listFinancialInstitutions(pagingParameters)
const { meta, data, links, next, previous } = response

if (response.next) {
  const nextPageResponse = await response.next()
}

Notes :

  • pagingParameters.before & pagingParameters.after cannot be used together
  • All list functions return a paging result. If they have a next or previous page a next or previous async function will be present.

more info

ponto.getFinancialInstitution (production & sandbox)

const response = await ponto.getFinancialInstitution('<financialInstitutionId>')
const { data } = response

more info

ponto.listFinancialInstitutionAccounts (sandbox only)

const pagingParameters = {
  limit: 2, // Defaults :100
  before: '<financialInstitutionId>', // cursor for pagination
  after: '<financialInstitutionId>', // cursor for pagination
} 
const response = await ponto.listFinancialInstitutionAccounts('<financialInstitutionId>', pagingParameters)
const { meta, data, links, next, previous } = response

if (response.next) {
  const nextPageResponse = await response.next()
}

Notes :

  • pagingParameters.before & pagingParameters.after cannot be used together
  • All list functions return a paging result. If they have a next or previous page a next or previous async function will be present.

more info

ponto.getFinancialInstitutionAccount (sandbox only)

const response = await ponto.getFinancialInstitutionAccount('<financialInstitutionId>', '<financialInstitutionAccountId>')
const { data } = response

more info

ponto.listFinancialInstitutionTransactions (sandbox only)

const pagingParameters = {
  limit: 2, // Defaults :100
  before: '<financialInstitutionId>', // cursor for pagination
  after: '<financialInstitutionId>', // cursor for pagination
} 
const response = await ponto.listFinancialInstitutionTransactions('<financialInstitutionId>', '<financialInstitutionAccountId>', pagingParameters)
const { meta, data, links, next, previous } = response

if (response.next) {
  const nextPageResponse = await response.next()
}

Notes :

  • pagingParameters.before & pagingParameters.after cannot be used together
  • All list functions return a paging result. If they have a next or previous page a next or previous async function will be present.

more info

ponto.getFinancialInstitutionTransaction (sandbox only)

const response = await ponto.getFinancialInstitutionTransaction('<financialInstitutionId>', '<financialInstitutionAccountId>', '<financialInstitutionTransactionId>')
const { data } = response

more info

ponto.listAccounts (production only)

const pagingParameters = {
  limit: 2, // Defaults :100
  before: '<accountId>', // cursor for pagination
  after: '<accountId>', // cursor for pagination
} 
const response = await ponto.listAccounts(pagingParameters)
const { meta, data, links, next, previous } = response

if (response.next) {
  const nextPageResponse = await response.next()
}

Notes :

  • pagingParameters.before & pagingParameters.after cannot be used together
  • All list functions return a paging result. If they have a next or previous page a next or previous async function will be present.

more info

ponto.getAccount (production only)

const response = await ponto.getAccount('<accountId>')
const { data } = response

more info

ponto.syncAccount (production only)

const response = await ponto.syncAccount('<accountId>')
const { data } = response

more info

ponto.getSynchronization (production only)

const response = await ponto.getSynchronization('<synchronizationId>')
const { data } = response

more info

ponto.listTransactions (production only)

const pagingParameters = {
  limit: 2, // Defaults :100
  before: '<accountId>', // cursor for pagination
  after: '<accountId>', // cursor for pagination
} 
const response = await ponto.listAccounts('<accountId>', pagingParameters)
const { meta, data, links, next, previous } = response

if (response.next) {
  const nextPageResponse = await response.next()
}

Notes :

  • pagingParameters.before & pagingParameters.after cannot be used together
  • All list functions return a paging result. If they have a next or previous page a next or previous async function will be present.

more info

ponto.getTransaction (production only)

const response = await ponto.getTransaction('<accountId>', t'<ransactionId>')
const { data } = response

more info