# Data Synchronization
source: https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-data/data-sync/index.md

Keeping end-user data up-to-date is important to offer a good service. Mastercard Open Finance in Europe does this in multiple ways.

### Initial synchronization {#initial-synchronization}

Once end-users have allowed your service to fetch financial data from their account, an initial data synchronization is performed in which two years of transaction data is fetched. All transactions older than two years are deleted due to PSD2 legislation.

Our recommendation is to use [webhooks](https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-data/event-notifications/index.md) and wait for the [SyncDoneWebhook](https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-data/event-notifications/event-types/index.md) notification, which is triggered once the data synchronisation is complete.

When using the Mastercard's license, the transaction data is fetched by Aiia Data from the ASPSP and stored on our servers.

### Automatic synchronization {#automatic-synchronization}

To automatically keep end-user data up-to-date, it is updated every six hours. The exception to this is [transaction details](https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-data/transactions/index.md), which are limited to fetching once in a 24 hour period.

### Manual synchronization {#manual-synchronization}

If required, a client can initiate a manual data synchronization, by calling the update endpoint:

API Reference: `POST /v1/update`

```shell
curl -X POST \
  https://api-sandbox.aiia.eu/v1/update \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json'  \
  -d '{"redirectUrl": "{redirect url}"}' 
```

Note: 24 hour rule for [transaction details](https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-data/transactions/index.md) still applies for manual synchronization. If transaction details were fetched in last 24 hours, they will not be updated.

#### Parameters {#parameters}

|   **Name**    | **Required** | **Type** |                                                   **Description**                                                    |
|---------------|--------------|----------|----------------------------------------------------------------------------------------------------------------------|
| `redirectUrl` | Yes          | `string` | Where the user should be redirected to, if a supervised login is needed                                              |
| `culture`     | No           | `string` | Two letter ISO code specifying a language which the App should use (for example, `en`,`da`, `se`,`fi`) if supported. |

#### Result {#result}

The call will return a JSON object in this format:

```json
{
    "authUrl": "https://app-sandbox.aiia.eu/#/update?id=e9f5abd8-3290-4a19-8353-e1fbee3705d"
}
```

If `authUrl` is empty, all connections have been successfully scheduled for a data synchronization. If it is not, one or more connections require supervised login by the end-user who will be redirected to `authUrl`. After the end-user has authenticated those connections, they are redirected at `redirectUrl` as specified earlier.
Note: Do not store `authUrl` for later use, as it is designed to be used immediately.
