Handling OTP reconnects
When making a call to accounts
, balance
, identity
and transactions
endpoints, user verification may be required before the request can be completed (for example, an OTP or updated user credentials may be required).
When this happens, a RECONNECT_REQUIRED
response will be returned:
{
"status": "RECONNECT_REQUIRED",
"payload": {
"reconnect_id": "20afcfd3-7ee3-44b8-9d6e-bf74b259fb90",
"type": "reconnect"
},
"results_id": "fae0ff1b-b0b7-481d-9c0a-533e0abfc798",
"message": "User input is required to reconnect with the bank",
"timestamp": "2020-12-30T16:40:49.779695Z"
}
When this happens the reconnect_id
should be passed to your front-end and initialised like so:
Lean.reconnect({
app_token: "2c9a80897169b1dd01716a0339e30003",
reconnect_id: "20afcfd3-7ee3-44b8-9d6e-bf74b259fb90",
sandbox: "false"
});
Once the user has successfully reconnected their account, a webhook notifying you of successful reconnection will be sent, as well as a results.ready
webhook allowing you to pick up the originally requested data.
{
"type": "entity.reconnected",
"payload": {
"id": "a2533394-6fcb-4407-989d-c35e96f34aa3" // the entity_id
"reconnect_id": "6222a07e-3aa8-42ba-87df-0ef989f36d19"
}
"message": "The entity was successfully reconnected.",
"timestamp": "2021-01-08T18:05:19.244672Z"
}
{
"type": "results.ready",
"payload": {
"id": "9b8ab652-cc95-4fb2-9340-59b0164c8fb2", // results_id
}
"message": "Your results are ready.",
"timestamp": "2021-01-08T18:05:19.244672Z"
}
Updated 6 months ago