# Bill Payments
source: https://developer.mastercard.com/ob-accept-payments/documentation/use-cases/bill-payments/index.md

Mastercard's Open Finance Solution enables TPPs to process bill payments directly from their customer's bank account in real time. Powered by Open Finance payments, a secure, seamless, and fast experience is provided for consumers minimizing friction while processing payments.

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

The following images show sample screens that can be rendered using this service:

1. **Bill to be paid**   
   The customer selects "Pay with your bank" as the payment option.
2. **Bank Selector**   
   The customer selects their bank.
3. **Consent**   
   The customer reviews the payment details, reads the consent text, accepts the consent and redirects to their bank.
4. **Bank login**   
   The customer authenticates themselves using the bank's existing authentication method.
5. **Account Selection**   
   Available accounts are displayed, and the customer selects the preferred account and confirms the payment.
6. **Confirmation screen**   
   Confirmation of the completed payment is displayed and the customer is provided with a reference number.
7. **Bill Paid Screen**   
   The customer is automatically redirected back to the merchant's app for payment confirmation upon completion.
For the best viewing experience, click the **full screen** option.

### What does the Bill Payments flow look like for an End User? {#what-does-the-bill-payments-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.

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

Diagram bill_payments

1. The Merchant requests a long lived Payment Link from the Integrator.
2. The Integrator submits a Create payment link request to Mastercard Open Finance Pay.
3. Mastercard Open Finance Pay returns a *flowURL* and a `paymentLinkId` to the Integrator.
4. The Merchant presents a Bill for payment to the PSU with the *flowURL* embedded in the 'Pay with your bank' button in the Bill.
5. The PSU accepts the Bill and clicks the 'Pay with your bank' button on the Bill.
6. The PSU is redirected to the *flowURL* where they will select the bank that they want to pay from and consent to the payment initiation.
7. The PSU is redirected to their chosen Bank to Authenticate and the payment is initiated.
8. If the payment initiation is successful then the transfer of funds to the destination account will begin.
9. The Bank informs Mastercard Open Finance Pay of the payment initiation status.
10. Mastercard Open Finance Pay informs the Integrator of the payment initiation status. 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.
11. The Merchant informs the PSU of the status of the Bill Payment.
12. The Merchant reconciles and settles the Bill.
13. The Merchant notifies the PSU of the Bill receipt.

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

A long lived payment link is returned as a result of successfully calling the Create payment link endpoint.

API Reference: `POST /payment-links`

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

API Reference: `GET /payment-links/{payment_link_id}`

The details of the payments attempted through a payment link are retrieved using the Get payment link payments endpoint. Payments will be returned in ascending order of their creation. You will need to use the identifier of the payment link as `payment_link_id` in the path.

API Reference: `GET /payment-links/{payment_link_id}/payments`

Optionally, you can fetch the latest status of a specific payment attempt using its `payment_id`.

The updated status of a payment created using a payment link is retrieved using the Get payment endpoint. You will need to use the identifier of the payment as `payment_id` in the path. The `payment_id` was retrieved previously using the Get payment link payments endpoint.

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

