stripe-paymentsfinanceplaidplaidmlplaid-cursor

How can I restrict account selection in Plaid Link update mode on Sandbox?


Hi I'm building an API that uses Plaid, and something isn’t working as I expected. When a user links a new financial institution (for example, Chase) and selects two accounts (e.g., banking and savings), then I test the LOGIN_ITEM_REQUIRED webhook (via /sandbox/item/reset_login endpoint). When I trigger this webhook, I need the user to re-link that item. So, I create a new link token like this:

request = LinkTokenCreateRequest(
    client_name=CLIENT_NAME,
    language=PLAID_LANGUAGE,
    country_codes=COUNTRY_CODES,
    user=LinkTokenCreateRequestUser(client_user_id=user_id),
    access_token=access_token,
    webhook=WEBHOOK_URL,
    update={"account_selection_enabled": False},
)

The issue is that when I open Plaid Link in Sandbox (I’m still developing in Sandbox), it still lists all Chase accounts available for selection. My expectation is that the user should only be able to select the original accounts, otherwise I’d need to handle additional cases. I’ve tried both:

update={"account_selection_enabled": False}, and

update={"account_selection_enabled": True},

but in Sandbox, it always lists all available accounts.

Does anyone know how to restrict the selection to only the originally linked accounts in update mode? Is this just a Sandbox limitation and will production behave as expected?

Thanks in advance!


Solution

  • If you do not enable account selection, the account selection screen will be skipped as long as the bank does not have an OAuth account selection screen. If the bank has its own OAuth account selection screen, the Plaid account selection screen will also be shown, in order to handle the scenario in which the user makes different selections in the bank-owned OAuth account selection flow than they did the first time through. In Sandbox, all OAuth banks show an account selection screen. In Production, most OAuth banks do, but not all of them. See https://plaid.com/docs/api/link/#link-token-create-request-update-account-selection-enabled