In this guide, you’ll learn how to define and manage multi-account, multi-provider, and multi-entity connections based on your customers’ needs.
connection_id
. A connection exists once an access token is obtained.
There are three types of scenarios to keep in mind when thinking about connections:
provider_id
is different for each access token.
In the 3) Multi-Entity scenario, a new connection may be created for every company “entity” connected.
connection_id
.
provider_id
= the payroll provider associated with the access token.customer_id
= a unique identifier that you create to manage your customers internallyYou define thecustomer_id
; Finch defines theconnection_id
(more on this below).
access_token
.
1:1
connection association. It can be represented by a single database table with columns for customer_id
and the associated access_token
. You can use a unique constraint on the customer_id
column to ensure that each user can have only one associated access_token
.
1:Many
relationship.
This can be represented by two database tables: the Customers table one stores the customer_id
and the Connections table stores the connection_id
which references back to a customer_id
.
connection_id
represents the unique finch variables that define a connection.connection_id
values which means that while each of these connections can contain the same values individually, the combination of these values must be unique (hence a unique connection).connection_id
is unique for each row, while the access_token
inherently remains unique for each row as well. The connection_id
(when combined with data from the Finch /company endpoint) is going to be able to tell you which employers are attached to each customer.