# Smart Data and Loyalty
source: https://developer.mastercard.com/open-finance-data/documentation/use-cases/smart-data-and-loyalty/index.md

In today's digital world, understanding your customers is key to building lasting relationships. With Mastercard's Open Finance solutions, you can harness raw transaction data to uncover deep behavioural insights---transforming how you engage, reward, and retain your customers.

By analysing real-time purchase history and usage patterns, your business can:

* Identify preferences and habits to offer subscription plans and exclusive content that truly resonate.
* Tailor experiences based on individual needs, increasing satisfaction and long-term loyalty.

Use behavioural data to deliver rewards that matter:

* Cashback and points aligned with actual spending habits.
* Increased redemption rates through relevant and timely offers.
* Enhanced satisfaction by making every reward feel personal.
This Figma diagram demonstrates a typical user flow.
For the best viewing experience, click the **full screen** option.

### How it works {#how-it-works}

We fetch transaction data directly from the user's bank (with their consent).

You use the returned transaction data to power your application for your consumer

#### What does the flow look like for an End User? {#what-does-the-flow-look-like-for-an-end-user}

This Figma diagram shows the user flow from the merchant, through Mastercard Open Finance, and the bank to successful data sharing.

#### Data flow {#data-flow}

Diagram smart-data

\* Payment Service User  

\* Account Servicing Payment Service Provider

1. The end user interacts with the customer's website or app, and wishes to use features or services enabled by Open Finance data.
2. The customer calls the `Create consent` and `Create managed flow` endpoints, to request a URL to start a consent flow which will guide the end user through the steps to authorize their consent.
3. Mastercard returns the Flow URL.
4. The customer redirects the end user to the Flow URL.
5. The end user is guided through steps at Mastercard and at their bank app or website to give consent, authenticate themselves using Strong Customer Authentication (SCA), and authorize data access.
6. The bank redirects the end user back to Mastercard, where they complete the final steps of the flow to authorize sharing their data with the customer.
7. Mastercard requests the end user's account information from the bank (limited to the data scopes specified for the customer's use case).
8. The bank returns the requested information.
9. Mastercard redirects the end user back to the customer's website or app.
10. The customer calls the `Get accounts` endpoint, indicating the data elements that they require by specifying the parameter `include=additionalInformation,identifiers` in the request.
11. Mastercard returns the requested information to the customer.
12. Mastercard requests the end user's transaction history from the bank.
13. The bank returns the requested information.
14. Mastercard sends a webhook to the customer to notify them that the end user's transactions history data is ready to retrieve.
15. The customer calls the `Get transactions` endpoint to request the end user's transaction history, optionally indicating the period of time that they require by specifying date parameters in the request.
16. Mastercard returns the requested transaction history to the customer.
17. The customer uses the information they have received from the end user's bank to offer **smart data** features and services to the end user.

### Endpoints used {#endpoints-used}

The customer calls the `Create consent` and `Create managed flow` endpoints to request a URL to start a consent flow which will guide the end user through the steps to authorize their consent.

API Reference: `POST /consents`


API Reference: `POST /consents/{consent_id}/managed-flows`

The customer calls the `Get accounts` endpoint, indicating the data elements that they require by specifying the parameter `include=additionalInformation,identifiers` in the request.

API Reference: `GET /accounts`

The customer calls the `Get transactions` endpoint to request the end user's transaction history, optionally indicating the period of time that they require by specifying date parameters in the request.

API Reference: `GET /accounts/{account_id}/transactions`

