Manage your transactions

Now that you manage the lifecycle of your connections it is important to manage your transactions updates.

In tracking your transactions, understanding the dates associated with each transaction is crucial. There are five different dates that may be relevant to your case study:

  • 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.
  • Updated Transaction Timestamp (updated_at): This timestamp represents the date and time when the transaction was last updated internally by Bridge.

📘

Please note that not all connectors will provide all of these dates. If a particular date cannot be found, it will not be included in the API response. However, the date field will always be filled and will correspond to one of the three other dates, depending on the connector.

These dates fields are available on these endpoints :

In order to prevent duplicated transactions the date and the updated_at 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",
            "booking_date": "2023-04-20",
            "transaction_date": "2023-04-20",
            "value_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",
            "booking_date": "2023-06-09",
            "transaction_date": "2023-06-09",
            "value_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.