Create a Plaid User for the Income actions
Skip this section if you do not use the Income actions. Income data belongs to a Plaid User (a person), not to the bank link, so create the User before the link token.
Create the Plaid User
From your backend, call POST https://production.plaid.com/user/create with your client_id, secret and a client_user_id you choose (a stable ID for this person, not personal data). Plaid returns a user_id such as usr_....
- Calling it again with the same
client_user_idreturns the sameuser_id. Plaid has no endpoint that lists Users, so this is also how you recover a lostuser_id. - If you already have a Plaid connection under the same Plaid client, you can run its Create User action instead.
Note the user_id for two fields
Pass the user_id to /link/token/create in the next section, and paste the same value into the Plaid User ID field in StackOne Hub.
- It must be the User the bank was linked under, otherwise the Income actions return
INCOME_VERIFICATION_NOT_FOUND.
Create a link token
Before opening Plaid Link, your backend creates a short-lived link_token for this user.
Create the link token
From your backend, never the browser, call POST https://production.plaid.com/link/token/create with at least these fields:
client_idandsecret: your Plaid keysuser.client_user_id: a stable ID for this person in your systemclient_name: your app name, shown to the user in Linkproducts: the products to enable, for example["transactions", "auth"]. Use only products this connection has actions for:transactions,auth,identity,investments,liabilities,assets,statements,income_verification,transferandsignal. Balance and Enrich need no entry here.country_codes: for example["US"]language: for example"en"user_id: theusr_...from the previous section. Plaid requires it whenproductsincludesincome_verification.income_verification:{ "income_source_types": ["bank"] }when you use the Income actionsstatements:{ "start_date": "YYYY-MM-DD", "end_date": "YYYY-MM-DD" }whenproductsincludesstatements. Plaid rejects the call without it.redirect_uri: only if Plaid requires one for your platform (see the Plaid Link OAuth guide)
Copy the link_token
Plaid responds with a link_token (link-production-...) that is valid for 4 hours. Pass it to Plaid Link in the next section.
Run Plaid Link in a browser
Plaid Link is the UI Plaid hosts. The user picks their bank, signs in and completes any MFA, and Plaid never shows you the bank password.
Open Plaid Link and get the public_token
Open Link with the link_token in one of two ways. Use only one of them: both end with a public_token after the user signs in.
- Your own app (recommended): add
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>to your page and callPlaid.create({ token: 'YOUR_LINK_TOKEN', onSuccess: (public_token, metadata) => console.log(public_token) }).open(). Thepublic_tokenarrives in theonSuccesscallback. Full reference: Plaid Link for web. - The Plaid Quickstart: a sample app that runs Link locally, useful for a quick test. Its backend exchanges the
public_tokenas soon as Link returns it, and a token works only once, so remove that exchange call before you use its token here.
Paste the public token and Plaid User ID
Paste the public_token into the Public Token field in StackOne Hub. Plaid expires it 30 minutes after Link issues it, so connect promptly.
- If you created a Plaid User, paste its
usr_...into the Plaid User ID field in StackOne Hub. Leave it empty if you do not use the Income actions. - When you connect, StackOne exchanges the
public_tokenfor a permanentaccess_tokenand stores it on the connection. The exchange uses up the token, so an expired or reused one fails and you must run Link again. - All actions for the products in your link token are then ready to run.
Limitations
Check these before you rely on this connection.
- If the bank link stops working (for example
ITEM_LOGIN_REQUIRED), the user signs in again through Plaid Link in update mode. Run Create Link Token withupdate_modeset totrue. - Only bank income is supported. The connection does not create the Plaid User, so create it yourself and paste its
user_idinto Plaid User ID.
Link the Account
Connect
- Click Connect.
- If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider’s authorization flow.
- Once authorization is successful, you will see a confirmation popup.
Use Actions