# Bill Pay Switch
source: https://developer.mastercard.com/open-finance-us/documentation/products/pay/switch/bill-pay-switch/index.md

Bill Pay Switch provides the ability for consumers to switch their recurring automatic payments from their incumbent account into a new/existing account at a Financial Institution.

Bill Pay Switch empowers consumers to update their payment information (ACH or Card on file) for recurring bills and subscriptions, making it easier to switch financial providers.
Warning: This product may not be used for purposes subject to the Fair Credit Reporting Act.

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

Customers will use your app to launch a Connect Transfer session to establish a connection enabling the bill pay switch with the merchant or service provider concerned. The Connect Transfer experience differs from the regular Mastercard Data Connect experience since it allows end users to login and authenticate with the merchant or service provider (note we use Atomic, a partner of Mastercard, for parts of the user experience).
Diagram billpay-switch-mvp

You must have already created a [customer](https://developer.mastercard.com/open-finance-us/documentation/customer-records/index.md#customers) record using your `partnerId` to use this service. Note that the endpoints require [authentication](https://developer.mastercard.com/open-finance-us/documentation/onboarding/index.md#authentication).
Tip: For testing in Sandbox with [Test Customers](https://developer.mastercard.com/open-finance-us/documentation/customer-records/index.md#test-customers), note that the final screen in the Connect Transfer flow will prompt the user to "Return to Partner App" during Sandbox testing. When you move to Production, the screen will instead use the application name associated with your experience ID, if provided.

### Integration Options {#integration-options}

Bill Pay Switch is only supported for mobile, via the iOS, Android and React Native [Connect Transfer SDKs](https://developer.mastercard.com/open-finance-us/documentation/products/pay/switch/connect-transfer/index.md) that we provide.

The Connect Transfer mobile SDKs provide native mobile versions of the Atomic user experience, which is not supported by the regular Data Connect mobile SDKs. The Connect Transfer SDKs support TrueAuth authentication of the end user with the merchant or service provider.
Warning: Unlike Deposit Switch, Bill Pay Switch is not suitable for integration into a web application either directly or via our Data Connect Web SDK.

Currently we also do not support webhooks for Bill Pay Switch, so your mobile app must implement code to handle the SDK events.

## Generate a Connect Transfer URL for Bill Pay Switch {#generate-a-connect-transfer-url-for-bill-pay-switch}

In order to allow customers to be able to set up bill pay switches, you will need to offer them a specific Data Connect user experience that allows them to set up the switch. This is different from the usual Data Connect experience which just allows customers to connect bank accounts.

API Reference: `POST /connect/generate/transfer/bill-pay-switch`

Note that the Connect Transfer experience uses Atomic, a partner of Mastercard, for parts of the user experience.

See the [Experience Design Guide section on Bill Pay Switch](https://developer.mastercard.com/open-finance-us/documentation/experience-design-guide/bill-pay-switch/index.md) for more details of the user flow.

## Get Bill Pay Switches by Customer ID {#get-bill-pay-switches-by-customer-id}

Retrieve a list of the Bill Pay Switches that are defined for a given Customer ID.

For each switch the ID, status, date of creation, and if applicable any status is returned.

API Reference: `GET /transfer/customers/{customer_id}/bill-pay-switches`

## Get Bill Pay Switch Details {#get-bill-pay-switch-details}

Retrieve the details of a specific Bill Pay switch, once you know the ID of the switch.

API Reference: `GET /transfer/customers/{customer_id}/bill-pay-switches/{switch_id}`

A successful response will include details of the status of the switch and also details of the provider, the bank / FI, and the last four digits of the customer's account or card number.

## How to Test Bill Pay Switch {#how-to-test-bill-pay-switch}

To test the Bill Pay Switch functionality, follow these steps:

1. Make sure you already have a suitable partner ID and test customer which has at least one bank account connected (see the Quick Start Guide).

2. Generate a suitable URL for testing the user flow by calling Connect Transfer URL.

3. Load the Connect Transfer URL in an iOS or Android test app (note that you cannot test directly in a browser as the Bill Pay Switch experience is tied to mobile).

4. This will then show the Atomic user experience where you can select a merchant or service provider.

### Testing Details {#testing-details}

When testing the bill pay switch flow, you can use the following usernames to test various scenarios. Enter the username shown when asked to authenticate (you can use any password). If an email address is required for authentication, append `@example.com` to the username.

#### Successful operation {#successful-operation}

Test where the user's credentials are correct and the task completes. When answering MFA questions, any answer will be accepted.

| Username  |  Phone Number  |         Description          |
|-----------|----------------|------------------------------|
| test-good | (555) 555-0100 | Test a successful operation. |

#### User issue {#user-issue}

Test where there is an error that occurs due to an action of the user.

|          Username          |  Phone Number  |                                             Description                                             |
|----------------------------|----------------|-----------------------------------------------------------------------------------------------------|
| test-subscription-inactive | (555) 555-0122 | Test a user who doesn't have an active subscription with the service provider.                      |
| test-bundle-wrong-provider | (555) 555-0123 | Test a user whose subscription bundle is managed by another service.                                |
| test-payment-method-locked | (555) 555-0124 | Test a user whose service provider has temporarily disallowed updates to the user's payment method. |

#### Service provider issue {#service-provider-issue}

Test where the user encounters an issue originating from the service provider.

|             Username              |  Phone Number  |                                                            Description                                                            |
|-----------------------------------|----------------|-----------------------------------------------------------------------------------------------------------------------------------|
| test-payment-method-not-supported | (555) 555-0125 | Test a user whose chosen payment method isn't supported by the service provider.                                                  |
| test-payment-switch-unsuccessful  | (555) 555-0126 | Test a user whose payment method could not be updated. We use this generic fail reason when none of the other fail reasons apply. |

#### Cards {#cards}

To test in Sandbox, use one of the following test card numbers to simulate different card brands.
Warning: These test cards are the only cards currently supported for Sandbox testing.

|   Card Number    |     CVV      |    Card Brand    |
|------------------|--------------|------------------|
| 5555555555554444 | Any 3 digits | Mastercard       |
| 378282246310005  | Any 4 digits | American Express |
| 4242424242424242 | Any 3 digits | Visa             |

