Data fetching
Once the user has synchronized his bank account and an item has been created, you will be able to fetch his bank data.
At the end of the funnel, you will have access to at least 7 days of data. The synchronization of the entire history will need few minutes more. Depending from the bank, the history of the account can vary from 2 to 24 months.
The easiest way to exploit the data from our API is to store all the information you fetch from the users, the items, the accounts and the transactions at each refresh.
Firstly, your data structure remains updated if a user opens or closes a new account.
Secondly, the data fetch is incremental and optimized.
All the data you will receive with Bridge is really sensitive. It’s your responsibility to protect them with a high level of security.
That’s why we advise you to fetch the transactions with the call List updated transactions. It permits to only get the new or updated transactions.
curl 'https://sync.bankin.com/v2/transactions/updated?since=2019-06-21T18:44:09.523Z&limit=12' \
-X GET \
-H 'Bankin-Version: 2019-02-18' \
-H 'Client-Id: MY_CLIENT_ID' \
-H 'Client-Secret: MY_CLIENT_SECRET' \
-H 'Authorization: Bearer TOP_SECRET_ACCESS_TOKEN'
{
"resources": [
{
"id": 1000013123932,
"description": "Prelevement Spotify SA",
"raw_description": "Prlv 1512 Spotify SA",
"amount": -4.99,
"date": "2019-04-06",
"updated_at": "2019-08-08T09:19:14Z",
"is_deleted": false,
"category": {
"id": 1,
"resource_uri": "/v2/categories/1",
"resource_type": "category"
},
"account": {
"id": 2341498,
"resource_uri": "/v2/accounts/2341498",
"resource_type": "account"
},
"resource_uri": "/v2/transactions/1000013123932",
"resource_type": "transaction"
},
//...
],
"pagination": {
"previous_uri": null,
"next_uri": "/v2/transactions/updated?after=MjAxNS0xMS0xNjo0NTU3ODE1Mg%3D%3D&since=2019-06-21T18:44:09.523Z&limit=12"
}
}
For that, store the more recent “updated_at” from the transactions you already have fetched and use it as "since" parameter.
If you don’t have any transactions and your "since" is null, you will receive all the transactions already synchronized.
All the accounts are automatically refresh once or twice a day. You can fetch the data whenever you want in the day.
For some ressources more static, as the accounts, you can use the pagination to know if the user has opened or closed one.
Updated almost 5 years ago