import Finch from '@tryfinch/finch-api';
const client = new Finch({
clientId: process.env['FINCH_CLIENT_ID'], // This is the default and can be omitted
clientSecret: process.env['FINCH_CLIENT_SECRET'], // This is the default and can be omitted
});
const connection = await client.sandbox.connections.create({ provider_id: 'provider_id' });
console.log(connection.account_id);
{
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"authentication_type": "credential",
"products": [
"<string>"
],
"access_token": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token_type": "<string>"
}
Create a new connection (new company/provider pair) with a new account
import Finch from '@tryfinch/finch-api';
const client = new Finch({
clientId: process.env['FINCH_CLIENT_ID'], // This is the default and can be omitted
clientSecret: process.env['FINCH_CLIENT_SECRET'], // This is the default and can be omitted
});
const connection = await client.sandbox.connections.create({ provider_id: 'provider_id' });
console.log(connection.account_id);
{
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"authentication_type": "credential",
"products": [
"<string>"
],
"access_token": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token_type": "<string>"
}
Please use base64 encoded client_id:client_secret
OK
The response is of type object
.
Was this page helpful?