diff --git a/libs/teller-api/src/teller-api.ts b/libs/teller-api/src/teller-api.ts index 598985c5..46670971 100644 --- a/libs/teller-api/src/teller-api.ts +++ b/libs/teller-api/src/teller-api.ts @@ -8,6 +8,7 @@ import type { GetTransactionsResponse, DeleteAccountResponse, GetAccountDetailsResponse, + GetInstitutionsResponse, } from './types' import axios from 'axios' import * as fs from 'fs' @@ -104,6 +105,16 @@ export class TellerApi { return this.get(`/identity`) } + /** + * Get list of supported institutions + * + * https://teller.io/docs/api/identity + */ + + async getInstitutions(): Promise { + return this.get(`/institutions`) + } + private async getApi(): Promise { const cert = fs.readFileSync('../../../certs/teller-certificate.pem', 'utf8') const key = fs.readFileSync('../../../certs/teller-private-key.pem', 'utf8') diff --git a/libs/teller-api/src/types/index.ts b/libs/teller-api/src/types/index.ts index 2e99eb68..f3b60309 100644 --- a/libs/teller-api/src/types/index.ts +++ b/libs/teller-api/src/types/index.ts @@ -3,5 +3,6 @@ export * from './account-balance' export * from './account-details' export * from './authentication' export * from './identity' +export * from './institutions' export * from './transactions' export * from './webhooks' diff --git a/libs/teller-api/src/types/institutions.ts b/libs/teller-api/src/types/institutions.ts new file mode 100644 index 00000000..6f243375 --- /dev/null +++ b/libs/teller-api/src/types/institutions.ts @@ -0,0 +1,14 @@ +// https://api.teller.io/institutions +// Note: Teller says this is subject to change, specifically the `capabilities` field + +export type Institution = { + id: string + name: string + capabilities: Capability[] +} + +type Capability = 'detail' | 'balance' | 'transaction' | 'identity' + +export type GetInstitutionsResponse = { + institutions: Institution[] +}