How to handle multiple connections for one connector

Edited

Sometimes, our customers want to allow their customers to link multiple connections of the same type by, for example, linking multiple Salesforce accounts per consumer.

At the moment, one consumer can only link to one connection of the same connector as visualized below:

A possible workaround would be to have multiple consumer IDs per user because connections are scoped to consumers.

To facilitate the use of multiple consumer IDs per user, it is necessary to link a user on your platform to two (or more) consumer IDs, as connections are specific to consumers.

When initiating a vault session, ensure that you transmit the unique consumers associated with the user. Consequently, the user object in your system would be structured as follows:

ID: 123 
UserName: Joe Doe 
ApideckConsumerIds: [123-salesforce-1, 123-salesforce-2]

When you wish to incorporate multiple connections for the same consumer, consider indexing them during the initiation of a new connection.

For instance, if your internal user IDs follow the pattern test_user_id, you can include an index when sending them.
Example Consumer ID: test_user_id:0 or 123-salesforce-1

Multiple companies through one connection

Some connectors reach several companies through a single connection. On Xero, Sage Business Cloud Accounting, Sage Intacct, Microsoft Dynamics 365 Business Central and Exact Online, one connection can access multiple tenants, businesses, entities, companies or divisions, and you pick one per request with the x-apideck-company-id header. Those companies do not need extra consumers.

QuickBooks Online, Zoho Books and FreshBooks need a separate connection for each company, so each company needs its own consumer. See Multi-Company Support in Accounting Integrations.

How extra consumers are billed

Each consumer is counted separately. A consumer becomes an active consumer for the month once it has a connection and makes at least one successful API call (Unify or Proxy) or receives a successfully delivered webhook event. So a user with two consumer IDs, for example 123-salesforce-1 and 123-salesforce-2, counts as two active consumers in a month where both make successful calls.

For more on how consumers map to your customers, see Understanding Consumers.

Is it possible to limit the number of connections per API per consumer?

It is currently not possible to limit the amount of connections in Vault. You could build some logic using the Vault API to decide if a consumer is allowed to open Vault if they already have enabled connections.

Learn more in the Get Started guide on the Apideck Developer Portal.

Was this article helpful?

Sorry about that! Care to tell us more?

Thanks for the feedback!

There was an issue submitting your feedback
Please check your connection and try again.