Data Sync
Data sync allows you to fetch new data (balance, transactions, and statements) of a connected financial account from an institution.
Depending on your product use case, there are two ways you can use the data sync feature:
- Automatic Refresh
- Manual Trigger
Automatic Refresh​
zeeh automatically refreshes all connected accounts to your business on a daily basis. After the automatic refresh, the data of all connected accounts will be automatically updated.
Manual Trigger​
If you need new data without waiting for an automatic refresh, you can manually trigger data sync through our Manual-Data-Sync. This will trigger a request to update the user's financial data.
What happens?​
For the manually triggered sync, the object response from the Data Sync endpoint when triggered is shown below:
{
"status": "successful",
"hasNewData": false,
"code": 0
}
For the manually triggered sync, the response from the Data Sync endpoint is shown below:
{
"status": "failed",
"code": "10",
"desc": "please re-authorize"
}
Handling Re-authorisation​
Re-authorising A User Account for Data Sync​
Make an API call to the Re-auth Endpoint with the accountId
returned from the connected-account's endpoint. If successful, this will return either a successful response or a failed response. A failed message is usually gotten back from the account's financial institution.
An example of a success json response:
{
"status": "success",
"code": 0,
"desc": "customer re-authorized"
}
Then you can pass the re-auth token
to the zeeh connect reauthorise()
function which will prompt the user to submit the required input as seen in this widget implementation.