Skip to main content
POST
/
sandbox
/
connections
/
accounts
JavaScript
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 account = await client.sandbox.connections.accounts.create({
  company_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  provider_id: 'provider_id',
});

console.log(account.account_id);
import os
from finch import Finch

client = Finch(
client_id=os.environ.get("FINCH_CLIENT_ID"), # This is the default and can be omitted
client_secret=os.environ.get("FINCH_CLIENT_SECRET"), # This is the default and can be omitted
)
account = client.sandbox.connections.accounts.create(
company_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
provider_id="provider_id",
)
print(account.account_id)
package main

import (
"context"
"fmt"

"github.com/Finch-API/finch-api-go"
"github.com/Finch-API/finch-api-go/option"
)

func main() {
client := finchgo.NewClient(
option.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),
option.WithClientSecret("My Client Secret"),
)
account, err := client.Sandbox.Connections.Accounts.New(context.TODO(), finchgo.SandboxConnectionAccountNewParams{
CompanyID: finchgo.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
ProviderID: finchgo.F("provider_id"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", account.AccountID)
}
package com.tryfinch.api.example;

import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.AccountCreateResponse;
import com.tryfinch.api.models.SandboxConnectionAccountCreateParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.fromEnv();

SandboxConnectionAccountCreateParams params = SandboxConnectionAccountCreateParams.builder()
.companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.providerId("provider_id")
.build();
AccountCreateResponse account = client.sandbox().connections().accounts().create(params);
}
}
package com.tryfinch.api.example

import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.AccountCreateResponse
import com.tryfinch.api.models.SandboxConnectionAccountCreateParams

fun main() {
val client: FinchClient = FinchOkHttpClient.fromEnv()

val params: SandboxConnectionAccountCreateParams = SandboxConnectionAccountCreateParams.builder()
.companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.providerId("provider_id")
.build()
val account: AccountCreateResponse = client.sandbox().connections().accounts().create(params)
}
require "finch_api"

finch = FinchAPI::Client.new(client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", client_secret: "My Client Secret")

account = finch.sandbox.connections.accounts.create(
company_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
provider_id: "provider_id"
)

puts(account)
curl --request POST \
--url https://api.tryfinch.com/sandbox/connections/accounts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_id": "<string>",
"products": [
"<string>"
]
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/sandbox/connections/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'provider_id' => '<string>',
'products' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
  "connection_id": "a237a1c3-1a5e-44ae-a8fd-81f76fd715c2",
  "entity_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
  "company_id": "b2e6a1c3-1a5e-44ae-a8fd-81f76fd715cf",
  "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
  "provider_id": "gusto",
  "authentication_type": "credential",
  "products": [
    "company"
  ],
  "access_token": "7eb55bcf-6593-4040-afac-252ee1f78e20"
}

Authorizations

Authorization
string
header
required

Please use base64 encoded client_id:client_secret

Body

application/json
company_id
string<uuid>
required
provider_id
string
required

The provider associated with the access_token

authentication_type
enum<string>
Available options:
credential,
api_token,
oauth,
assisted
products
string[]

Optional, defaults to Organization products (company, directory, employment, individual)

Response

200 - application/json

OK

connection_id
string<uuid>
required

The ID of the new connection

entity_id
string<uuid>
required

The ID of the entity for this connection

company_id
string<uuid>
required

The Finch UUID of the company associated with the access_token.

provider_id
string
required

The ID of the provider associated with the access_token

account_id
string<uuid>
required
deprecated

[DEPRECATED] Use connection_id to associate a connection with an access token

authentication_type
enum<string>
required
Available options:
credential,
api_token,
oauth,
assisted
products
string[]
required
access_token
string<uuid>
required