You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Plaid新手技术咨询:使用更新模式后仍存在ITEM_LOGIN_REQUIRED错误的解决方法及后续操作指引

Hey there! I see you've correctly generated a link token for update mode, but you're still hitting the ITEM_LOGIN_REQUIRED error—let's fix that. The missing piece here is that you haven't completed the user-facing Link update flow yet. Here's exactly what you need to do next:

You've got the right link token, now you need to use it to launch Plaid Link so the user can re-verify their account credentials (or complete any required MFA). Add the linkHandler.open() call to your existing code—this is what opens the Link interface for the user:

// Initialize Link with your generated update-mode link_token
const linkHandler = Plaid.create({
  token: 'link-sandbox-xxxx-xxx-xxxx-xxx-xxx', // Your new link token here
  onSuccess: (public_token, metadata) => {
    // No need to exchange tokens! The existing access_token is still valid
    console.log('Item updated successfully—access_token remains the same');
    // Now you can safely call /accounts/get with your original access_token
  },
  onExit: (err, metadata) => {
    if (err != null) {
      // Handle errors like invalid credentials or MFA failures
      console.error('Link update failed:', err);
    } else {
      // User exited the flow voluntarily—you may want to prompt them to try again
      console.log('User exited Link update flow');
    }
    // Store metadata.request_id and metadata.link_session_id for support if needed
  },
});

// This line opens the Link interface for the user to complete verification
linkHandler.open();

When you call linkHandler.open(), the user will see a Plaid interface prompting them to log back into their financial institution account (or complete MFA if required). Once they successfully do this:

  • Plaid will automatically update the Item's status in their backend
  • Your original access-sandbox-xxxx-xxx-xxx-xxx-111111 access token will start working again

Why You Were Still Getting the Error

The ITEM_LOGIN_REQUIRED error means Plaid needs the user to re-authenticate to refresh the Item's connection. Generating the update-mode link token is just the setup step—the user must complete the Link flow to actually resolve the error. Until that happens, the Item remains in a locked state, so calls to /accounts/get will still fail.

Once the user completes the flow, you can immediately retry your /accounts/get request with the original access token, and it should work as expected.

内容的提问来源于stack exchange,提问作者Mia Mia

火山引擎 最新活动