# Direct Debit
source: https://developer.mastercard.com/open-finance-data/documentation/use-cases/direct-debit/index.md

When consumers provide their bank information for setting up a direct debit, such as for a monthly subscription, it's essential to ensure that the details are accurate and belong to the correct individual. By verifying the information at the point of entry, you can confirm that the account is valid and belongs to the customer before any payment attempt is made.

Verifying bank account details helps with:

* Faster customer onboarding
* Fewer failed payments
* Reduced support queries
* Enhanced trust and reliability
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 account ownership data directly from the user's bank (with their consent).
* You use the returned account holder name to set up a Direct Debit mandate

#### What does the direct debit set-up flow look like for an End User? {#what-does-the-direct-debit-set-up-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.

## Primary and Optional Data flow {#primary-and-optional-data-flow}

To provide clarity and avoid duplication, the description below is separated into two parts, Primary Flow and Optional Flow. This structure ensures a clear separation between the universal process and the optional add-on of account owner verification.

#### Primary Data flow for Direct Debit {#primary-data-flow-for-direct-debit}

Diagram direct-debit

\* Payment Service User  

\* Account Servicing Payment Service Provider
1. The end user interacts with the customer's website or app, and wishes to purchase a service or subscription that will be paid for using direct debit (recurring scheduled payments).
2. The customer decides to use Open Finance to validate the account details that the end user has provided.
3. 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.
4. Mastercard returns the Flow URL.
5. The customer redirects the end user to the Flow URL.
6. 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.
7. 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.
8. Mastercard requests the end user's account information from the bank (limited to the data scopes specified for the customer's use case).
9. The bank returns the requested information.
10. Mastercard redirects the end user back to the customer's website or app.
11. The customer calls the `Get accounts` endpoint, indicating the data elements that they require by specifying the parameter `include=identifiers` in the request or, if they also wish to check the account balance, `include=identifiers,balances`.
12. Mastercard returns the requested information to the customer.
13. The customer uses the information they have received from the end user's bank to set up a direct debit mandate (recurring scheduled payments).
14. The customer confirms to the user that the direct debit mandate has been successfully established.

#### Optional Data flow for Account Owner Verification {#optional-data-flow-for-account-owner-verification}

You can enhance your direct debit setup flow with an additional algorithm‑driven verification layer that compares the end user's submitted name against the name held on file by their bank, and provides real-time balance information to help confirm sufficient funds.

This optional service leverages Mastercard's name‑matching algorithms---combining industry‑standard similarity methods and custom‑built metrics---to improve operational efficiency, prevent manual errors when PSUs submit bank details, and provide clients with greater confidence that direct debit payments will be successfully collected.
Diagram direct-debit-optional

\* Payment Service User  

\* Account Servicing Payment Service Provider
1-12. Refer to steps 1-12 of the Primary Data flow for Direct Debit for details.

13. For the Account Owner Verification service, the customer makes a `Account Match` endpoint request, providing the name the end user submitted during the direct‑debit setup process.

14. Mastercard runs an algorithmic name‑matching process using the PSU‑submitted name and the account‑holder name from the ASPSP, producing a name‑match score that customers can use to support their own validation decisions. The customer uses the information they have received from the end user's bank to set up a direct debit mandate (recurring scheduled payments).

    As an additional option, partners may retrieve the outcome of a previously submitted account-ownership verification by calling the `GET account ownership verification results` endpoint, enabling partners to reuse the name-match score for validation, audit, or reference purposes without resubmitting the original request.
15. The customer confirms to the user that the direct debit mandate has been successfully established.

### 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=identifiers` in the request, or, if they also wish to check the account balance `include=identifiers,balances`

API Reference: `GET /accounts`

##### Optional endpoints {#optional-endpoints}

The customer can make a `Account Match` request, including end-user details for comparison (such as their full name) with provider-reported account holder data.

API Reference: `POST /account-ownership-verifications`

The customer can call the `GET account ownership verification results` endpoint to retrieve the results of a previously submitted account ownership verification.

API Reference: `GET /account-ownership-verifications/{verification_id}`

