Manage your transactions
Now that you manage the lifecycle of your connections it is important to manage your transactions updates.
A transaction has 4 types of date :
- Transaction Date (date)
- Value Date (valueDate): The value date is the reference date used by the bank to record the transaction as either a credit or a debit.
- Transaction Date (transactionDate): This date signifies when the banking transaction is carried out, but the balance is not affected.
- Booking Date (bookingDate): The booking date is the actual date when the transaction is posted to the account.
And an the Updated Transaction Timestamp (updated_at): This timestamp represents the date and time when the transaction was last updated internally by Bridge. For more informations regarding those dates please refer to our guide : Manage your transactions dates.
In order to prevent duplicated transactions these two parameters are important to manage correctly.
The first step is to use the endpoint : List updated transactions and to a GET without the parameter since
and to store the field updated_at
in your database.
curl"<https://api.bridgeapi.io/v2/transactions/updated>"/
-X GET/
-H 'Bridge-Version: 2021-06-01'/
-H 'Client-Id: MY_CLIENT_ID'/
-H 'Client-Secret: MY_CLIENT_SECRET'/
-H 'Authorization: Bearer TOP_SECRET_ACCESS_TOKEN
{
"resources": [
{
"id": 36000051006608,
"clean_description": "To The Royal British Legion",
"bank_description": "To The Royal British Legion",
"amount": -0.35,
"date": "2023-04-20",
"updated_at": "2023-06-08T13:18:31.408Z",
"currency_code": "GBP",
"is_deleted": false,
"category_id": 294,
"account_id": 36284908,
"is_future": false,
"show_client_side": true
},
Then after receiving the webhook item refresh or account refresh
{
"content": {
"full_refresh": true,
"item_id": 7984384,
"status_code": 0,
"status_code_info": "OK",
"user_uuid": "806eda23-a648-426d-b4b1-615035fc60be"
},
"timestamp": 1686230311473,
"type": "item.refreshed"
}
Make a second GET with the parameter since
with the date : updated_at
stored previously
curl"<https://api.bridgeapi.io/v2/transactions/updated?since=2023-05-30T12%3A46%3A18.971Z>"/
-X GET/
-H 'Bridge-Version: 2021-06-01'/
-H 'Client-Id: MY_CLIENT_ID'/
-H 'Client-Secret: MY_CLIENT_SECRET'/
-H 'Authorization: Bearer TOP_SECRET_ACCESS_TOKEN'/
{
"resources": [
{
"id": 37000050461471,
"clean_description": "Cb Franprix",
"bank_description": "Cb Franprix Fact 080623",
"amount": -0.85,
"date": "2023-06-09",
"updated_at": "2023-06-09T11:18:31.408Z",
"currency_code": "EUR",
"is_deleted": false,
"category_id": 273,
"account_id": 36260235,
"is_future": true,
"show_client_side": true
},
…
}
By doing so, you'll avoid any is_deleted
= true
and prevents any duplicate transactions without having to create too many checks.
Updated 23 days ago