1.0.0 • Published 2 years ago
@rantalainen/prh-virre-api-client v1.0.0
prh-virre-api-client
PrhVirreApiClient is a third party PRH VIRRE API client for NodeJS.
Installation
Add to project's package.json:
npm install @rantalainen/prh-virre-api-clientImport
import { PrhVirreApiClient } from '@rantalainen/prh-virre-api-client';Setup client with options
Client id and secret + user and password are needed to access all API functions. Please contact PRH for api information.
const prhApiClient = new PrhVirreApiClient({
clientId: 'client_id',
clientSecret: 'client_secret',
userName: 'user',
password: 'password'
});Resources
The following api endpoints have been implemented:
financialPeriodsRetrieves a list of financial periods for the specified business.financialStatementsRetrieves financial statements for the specified businessId within the given date range. In response there will be a metadata containing financial period with record numbers referring to data files in attachments.
Example
const financialPeriods = await prhVirreApiClient.getFinancialPeriods('1234567-8', 'krek');
const financialStatements = await prhVirreApiClient.getFinancialStatements('1234567-8', 'krek', '2022-01-01', '2022-12-31');1.0.0
2 years ago