# Top-ups
source: https://developer.mastercard.com/ob-accept-payments/documentation/use-cases/top-ups/index.md

Mastercard's Open Finance solution enables users to seamlessly fund digital wallets, investment and savings accounts, prepaid accounts and other stored value services, directly from their bank account using secure account-to-account (A2A) payments.

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

When a user begins the payment process, your application offers the option of Open Finance alongside your existing payment methods, should you have any others. When the user chooses to pay by Open Finance, a payment initiation journey is requested through Mastercard Open Finance Pay.

We handle the communication with the user's bank, including user authentication using Strong Customer Authentication (SCA). Once the payment is initiated, the user is returned to your application to continue their journey.

Integrate one or both of the following features into your current solution for maximum flexibility.

## Single Immediate Payments {#single-immediate-payments}

### User flow {#user-flow}

1. **Merchant**   
   The merchant, in this case a travel wallet, offers the ability to add funds to the wallet by clicking 'Top up payment account'.
2. **Merchant**   
   After selecting the desired amount to top up the account, clicking 'Confirm and continue' initiates the creation of a Single Immediate Payment and the Consumer is sent to Mastercard Open Finance Pay.
3. **Mastercard Open Finance**   
   The Consumer can review the payment details and by selecting their bank gives permission to the Payment Initiation Service Provider (PISP) to initiate the payment with the bank.
4. **Bank**   
   The Consumer authenticates themselves using the bank's existing authentication methods.
5. **Bank**   
   The available accounts and balances are displayed and the Consumer selects their preferred account and confirms the payment details with the bank.
6. **Mastercard Open Finance**   
   The Consumer is automatically redirected to Mastercard Open Finance Pay where they can see that the payment was initiated successfully.
7. **Merchant**   
   The Consumer is redirected to the Merchant for next steps.
For the best viewing experience, click the **full screen** option.

### What does the Single Immediate Payment flow look like for an End User? {#what-does-the-single-immediate-payment-flow-look-like-for-an-end-user}

The following Figma diagram shows the user flow from the merchant, via Mastercard Open Finance, and the bank to the successful transaction.

For the best viewing experience of app to app, click the **full screen** option or **zoom** using the controls located on the right.

#### Create Payment Flow {#create-payment-flow}

Diagram top_ups

1. The Payment Service User (PSU) initiates an Open Finance payment from the Merchant's application.
2. The merchant uses the /payments endpoint to submit a Create Payment request.
3. Mastercard Open Finance Pay returns a *flowUrl* and a `paymentId` to the merchant.
4. The Merchant redirects the PSU to the *flowUrl* to progress with the payment.
5. Here the PSU lands on the Mastercard Open Finance Pay payment screens where they choose the Bank that they want to pay from and read and accept the Consent, Terms and Conditions, and Privacy Notice.
6. The PSU is redirected to the Account Servicing Payment Service Provider (ASPSP) to complete SCA.
7. In the background Mastercard Open Finance Pay initiates a payment with the ASPSP.
8. The ASPSP returns the PSU to Mastercard Open Finance Pay.
9. Mastercard Open Finance Pay returns the PSU to the *redirectUrl* that was provided on the create payment request in Step 2.
10. The ASPSP begins the transfer of funds from the payer's chosen bank account to the Destination account that was defined in the create payment request in Step 2.
11. Mastercard Open Finance Pay sends a *AcceptPaymentStatusUpdated* notification to the Merchant to let them know that the status of the payment has changed.
12. The Merchant can call the Get payment endpoint using the paymentId that was returned in step 3.
13. Mastercard Open Finance Pay returns the latest payment status to the Merchant. Refer to our [Payment Status Model](https://developer.mastercard.com/ob-accept-payments/documentation/payments/single-immediate-payments/payment-status-model/index.md) for more information.
14. The Merchant displays a message to the PSU based on the payment status to inform the PSU of the payment result.

#### Endpoints used {#endpoints-used}

A create payment request is initiated.

API Reference: `POST /payments`

The updated status of the payment is retrieved using the Get Payment endpoint. You will need to use the identifier of the payment as `payment_id` in the path.

API Reference: `GET /payments/{payment_id}`

Note:   
It is common in the top-ups use case, for regulatory or other reasons, that merchants may want to only allow top-ups from a source bank account that they have verified to be held in their customers name. This can be achieved by passing the required information in the preselectedSource fields in the create payments request.  

Furthermore, the above example excludes the onboarding of destination accounts, where the PSU is sending their funds to. If the merchant is operating a simple account structure set-up, where all customer funds are collected into one central account, then this account is likely to be onboarded during your customer onboarding, and you will receive the necessary \`\`destinationId\`\`. Alternatively, if this is not the case, and the merchant utilises many, perhaps even individual or multiple accounts for each individual PSU to send funds to, then these accounts will need to be onboarded at an appropriate time by calling the Create Merchant Payment Destination endpoint.

<br />

This scenario is detailed below. For full details refer to [Merchant Onboarding](https://developer.mastercard.com/ob-accept-payments/documentation/payments/merchant-onboarding/index.md).

#### Create payment flow (with individual account structure) {#create-payment-flow-with-individual-account-structure}

Diagram top_ups_indv

1. The merchant uses the /merchants/{merchant_id}/payment-destinations endpoint to add a payment destination account to a merchant.
2. Mastercard Open Finance Pay returns a `destinationId` to the merchant.
3. The Payment Service User (PSU) initiates an Open Finance payment from the Merchant's application.
4. The merchant uses the `/payments` endpoint to submit a Create Payment request.
5. Mastercard Open Finance Pay returns a \*flowUrl\^ and a `paymentId` to the merchant.
6. The Merchant redirects the PSU to the *flowUrl* to progress with the payment.
7. Here the PSU lands on the Mastercard Open Finance Pay payment screens where they choose the Bank that they want to pay from and read and accept the Consent, Terms and Conditions and Privacy Notice.
8. The PSU is redirected to the Account Servicing Payment Service Provider (ASPSP) to complete SCA.
9. In the background Mastercard Open Finance Pay initiates a payment with the ASPSP.
10. The ASPSP returns the PSU to Mastercard Open Finance Pay.
11. Mastercard Open Finance Pay returns the PSU to the *redirectUrl* that was provided on the create payment request in Step 4.
12. The ASPSP begins the transfer of funds from the payer's chosen bank account to the Destination account that was defined in the create payment request in Step 4.
13. Mastercard Open Finance Pay sends a *AcceptPaymentStatusUpdated* notification to the Merchant to let them know that the status of the payment has changed.
14. The Merchant can call the Get payment endpoint using the paymentId that was returned in step 5.
15. Mastercard Open Finance Pay returns the latest payment status to the Merchant. Refer to our [Payment Status Model](https://developer.mastercard.com/ob-accept-payments/documentation/payments/single-immediate-payments/payment-status-model/index.md) for more information.
16. The Merchant displays a message to the PSU based on the payment status to inform the PSU of the payment result.

#### Endpoints used {#endpoints-used-1}


API Reference: `POST /merchants/{merchant_id}/payment-destinations`

A create payment request is initiated.

API Reference: `POST /payments`

The updated status of the payment is retrieved using the Get Payment endpoint. You will need to use the identifier of the payment as `payment_id` in the path.

API Reference: `GET /payments/{payment_id}`

## Sweeping VRP {#sweeping-vrp}

Note: Our Sweeping VRP solution is currently in beta phase.  
Note that sweeping VRPs are only allowed to be used for sweeping defined use cases (otherwise known as me-to-me). Contact your Mastercard representative to discuss whether your use case falls under the definition of sweeping.

Mastercard Open Finance Pay enables users to seamlessly move funds between accounts that they own such as transferring funds between bank accounts or paying Credit Cards and Loans based on various parameters and rules using secure account-to-account (A2A) payments.

Link your PSU's bank account by asking them to set up a mandate and define a set of control parameters (for example payment limits and expiration date) and complete SCA with their bank. Once the Mandate is authorized, you can submit multiple payments as long as they are within the Mandate parameters, without having the PSU go through SCA with the bank again, thereby creating a one-click process.

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

When the PSU is in your environment, ask them to link their account. When the user chooses to link their account, a mandate creation and authorization journey are requested through Mastercard Open Finance Pay.

Mastercard handles the communication with the PSU's bank, including user authentication using SCA. Once the mandate is authorized, the user is returned to your application to continue their journey.

The following screenshots show an example user journey using this service:

### User flow {#user-flow-1}

For the best viewing experience, click the **full screen** option.

#### Create mandate {#create-mandate}

#### Pay with a mandate {#pay-with-a-mandate}

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

The following Figma diagram shows the user flow from the merchant, via Mastercard Open Finance, and the bank to the successful transaction.

For the best viewing experience of app to app, click the **full screen** option or **zoom** using the controls located on the right.

#### Create mandate flow {#create-mandate-flow}

Diagram create_mandate_flow

1. The Payment Service User (PSU) initiates linking their bank account to the Merchant's application.
2. The Merchant passes the PSU to the Integrator to create and authorize the mandate.
3. The Integrator uses the `/mandates` endpoint to submit a Create Mandate request. The Integrator sends the PSU to the Mastercard Open Finance Pay user journey (flowUrl).
4. Mastercard Open Finance Pay sends the PSU to the bank to authenticate and authorize the mandate.
5. The ASPSP returns the status of the mandate.
6. Mastercard Open Finance Pay notifies the integrator about the Mandate status change and allows it to get the latest mandate status. Refer to our [Mandate Status Model](https://developer.mastercard.com/ob-accept-payments/documentation/payments/cvrp/mandate-status-model/index.md) for more information.
7. The Integrator returns the status of the mandate to the Merchant.
8. The Merchant confirms to the PSU that their account has been linked.

##### Endpoints used {#endpoints-used-2}

A create mandate request is initiated.

API Reference: `POST /mandates`

The updated status of the mandate is retrieved using the Get Mandate endpoint. You will need to use the identifier of the mandate as `mandate_id` in the path.

API Reference: `GET /mandates/{mandate_id}`

#### Payment with a mandatee flow {#payment-with-a-mandatee-flow}

This flow will happen each time the Merchant needs to initiate a new payment, for example, based on the agreed payment amount and schedule in a subscription model. The Merchant will indicate the mandate based on which the payment should be processed.

Generally, the PSU does not need to be involved in initiating the payment. However, the Merchant must notify the PSU about the status of the payment initiation.
