Typed Plaid error struct with retry classification, suggested actions, and structured metadata for logging and observability.
Every error that can come from Plaid is classified into:
- An
error_typematching Plaid's taxonomy - A
suggested_actionfor your application code - A
retryableflag for the HTTP client's retry logic
Plaid error taxonomy
Plaid categorises errors into these types (from their API reference):
INVALID_REQUEST— malformed request parametersINVALID_RESULT— Plaid returned an unexpected resultINVALID_INPUT— semantically invalid input (e.g., wrong access token)INSTITUTION_ERROR— institution outage, timeout, or maintenanceRATE_LIMIT_EXCEEDED— API rate limit hitAPI_ERROR— Plaid internal errorITEM_ERROR— item-level errors (login required, no accounts, etc.)ASSET_REPORT_ERROR— asset report specific errorsRECAPTCHA_ERROR— CAPTCHA challenge requiredOAUTH_ERROR— OAuth flow errorsPAYMENT_ERROR— payment initiation errorsBANK_TRANSFER_ERROR— bank transfer errorsINCOME_VERIFICATION_ERROR— income verification errorsMICRODEPOSITS_ERROR— micro-deposit verification errors
Handling errors
case PlaidEx.API.Transactions.sync(config, access_token: token) do
{:ok, page} ->
process(page)
{:error, %PlaidEx.Error{code: "ITEM_LOGIN_REQUIRED"}} ->
# Send user back through Link to reconnect
redirect_to_link_update_mode(item_id)
{:error, %PlaidEx.Error{retryable: true} = error} ->
# Safe to retry after delay
schedule_retry(error)
{:error, %PlaidEx.Error{} = error} ->
# Non-retryable — needs human attention
alert_on_call(error)
end
Summary
Functions
Constructs an Error from an Elixir/network exception.
Constructs an Error from a Plaid HTTP response.
Returns true if this is an institution-side problem (not user or developer error).
Returns true if this error requires the user to re-authenticate via Link.
Returns true if this error should trigger an automatic retry.
Returns a loggable map with sensitive fields removed.
Types
@type error_type() ::
:invalid_request
| :invalid_result
| :invalid_input
| :institution_error
| :rate_limit_exceeded
| :api_error
| :item_error
| :asset_report_error
| :recaptcha_error
| :oauth_error
| :payment_error
| :bank_transfer_error
| :income_verification_error
| :microdeposits_error
| :unknown
@type suggested_action() ::
:retry
| :retry_with_delay
| :reauthenticate
| :contact_support
| :no_action
| :update_item
| :check_institution
| :check_plaid_status
@type t() :: %PlaidEx.Error{ causes: [map()], code: String.t(), display_message: String.t() | nil, institution_id: String.t() | nil, message: String.t(), request_id: String.t() | nil, requires_reauthentication: boolean(), retryable: boolean(), status: integer(), suggested_action: suggested_action(), type: error_type() }
Functions
Constructs an Error from an Elixir/network exception.
Constructs an Error from a Plaid HTTP response.
Returns true if this is an institution-side problem (not user or developer error).
Returns true if this error requires the user to re-authenticate via Link.
Returns true if this error should trigger an automatic retry.
Returns a loggable map with sensitive fields removed.