Plaid will return an INVALID_ACCOUNT_ID
error when a call includes an account_id
in the account_ids
options
object that is either invalid or does not exist on the Plaid Item. This article will first cover an example call and response for this error, the most common causes for this error, and provide recommendations on how to handle this error when you encounter it.
Example call
curl -X POST https://sandbox.plaid.com/auth/get \
-H 'Content-Type: application/json' \
-d '{
"client_id": String,
"secret": String,
"access_token": String,
"options": {
"account_ids": [
"vokyE5Rn6vHKqDLRXEn5fne7LwbKPLIXGK98d" // This account_id is invalid
]
}
}'
Example response
{
"display_message": null,
"documentation_url": "https://plaid.com/docs/?ref=error#invalid-input-errors",
"error_code": "INVALID_ACCOUNT_ID",
"error_message": "One or more account_id(s) missing or deleted",
"error_type": "INVALID_INPUT",
"request_id": "1Br8SdrSXJSP4Kg",
"suggested_action": null
}
Common causes for this error and how to handle them
The most common cause for this error is that the account in question has been closed at the bank, and thus removed from our API. If this is the case, we recommend either repeating the call you made without the account_ids
options
object, or making a call to our /item/get
endpoint to retrieve all currently active accounts on the Item, and then presenting them to your user so that they may select an up-to-date account that they would like to use with your app.
You will also receive this error if your integration passes in an account_id
that is in the correct Plaid account_id
format*, but is invalid for the Item in question. This could occur if your integration has somehow associated one Item's account_id
s with another Item's identifiers. If this is happening for you, make sure to double check your integration's flow for preserving and associating Plaid Item identifiers, e.g. item_id
s, account_id
s, etc, with the corresponding access_token
.
It is also possible that an account_id
was erroneously removed from our API, either completely missing or a new account_id
was assigned to the same underlying bank account. We call this "account churn" because we expect the underlying account and account_id
relationship in our API to be immutable so long as the underlying account remains open. If this happens, we suggest a similar(or the same) flow to the account closure case described above, make a call to retrieve all current account data for the Item and present the up-to-date list to the user. You may also consider implementing logic within your integration to reconcile potentially churned accounts; in cases where you encounter potential account churn, you may call /item/get
to retrieve the Item's current accounts and compare it to the data you already have stored, if one or more of the accounts has matching data, e.g. the mask
, name
, and balance are very similar, you may consider either presenting the accounts to the user for manual matching or reconcile them silently yourself. We do our best to limit account churn wherever possible, but if you do encounter potential account churn please raise a Missing account data ticket with Plaid Support and we can investigate what happened.
* If you include a string in the account_ids
list that is not in the accepted Plaid account_id
format, e.g. you pass in a list like ["teststring123"]
, you will receive a INVALID_FIELD
error code with the following message, options.account_ids
must be a non-empty array of valid account ids
.