# Available APIs
source: https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/available-apis/index.md

Issuers can leverage the available Mastercard APIs to perform auto-enrollment, batch status retrieval, and consumer profile management.

## Enroll API-Asynchronous {#enroll-api-asynchronous}

Enroll a single consumer, or multiple eligible consumers at once (in a batch) to create a Click to Pay profile with [Enroll API-Asynchronous](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/index.md#enroll-api-asynchronous).

### Detailed steps {#detailed-steps}

1. Update all the Terms and Conditions to offer Click to Pay as a default feature in your core banking product.   

2. Get onboarded with Mastercard Click to Pay. Refer to the [tutorial page](https://developer.mastercard.com/issuer-enrollment/documentation/tutorials-and-guides/index.md#tutorials) for [onboarding steps](https://developer.mastercard.com/issuer-enrollment/tutorial/issuer-onboarding-click2pay/index.md) and [key management](https://developer.mastercard.com/issuer-enrollment/tutorial/key-management-click2pay/index.md) for accessing APIs.

3. Call the [Enroll API-Asynchronous](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/index.md#enroll-api-asynchronous) to start the enrollment.

   * Generate and pass the `externalBatchID` (at batch level) along with the `srcClientId` and `serviceId` in the API request. Mastercard will respond back with the `batchId` and `externalBatchId` on successful enrollment.
   * Include the following enrollment data as part of the API request:
     * Email address.
     * Mobile number with country code.
     * Card details with Primary Account Number and expiry date.
     * Cardholder address.
     * First and last name of cardholder.
     * Locale with country and language.
     * `externalCardId` for each card in the batch.
     * `externalConsumerId` for each consumer in the batch.
     * Compliance settings (optional).

   <br />

4. On successful tokenization, and enrollment, the consumer is notified on the banking app/website. The `batchId` is provided in the API response that can be used later to [fetch batch status](https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/available-apis/index.md#fetch-batch-status).

5. After the cards are linked to the Click to Pay profile, consumers can review the added cards on the Click to Pay profile page in the banking app/website.

![Auto-Enroll UX Flow on Issuer App](https://static.developer.mastercard.com/content/issuer-enrollment/documentation/img/auto-enroll-ux-flow08.png "Auto-Enroll UX Flow on Issuer App")
Note:   

* Ensure that during tokenization these cards should have zero declines as the bank itself triggers the enrollment.
* Once the eligible cards are auto-enrolled, it takes some time to show the linked cards on the Issuer app as the auto-enrollment process is asynchronous.
* Post enrollment, consumers can also opt out of Click to Pay anytime from the bank website/app.   

  For more important details, refer to [FAQs](https://developer.mastercard.com/issuer-enrollment/documentation/support/index.md#faqs).

## Batch Status API {#batch-status-api}

After successful enrollment, you will receive the `batchId` (a unique identifier for each batch) as part of the [Enroll API-Asynchronous response](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/index.md#enroll-api-asynchronous) to call [Batch Status API](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/index.md#batch-status-api).  


It allows you to retrieve individual enrollment status containing the `externalConsumerId`, `externalCardId`, `srcDigitalCardId` and `srcConsumerId` if the enrollment is successful.
It's recommended to pull the batch status after regular intervals agreed upon with Mastercard.
Diagram autoenrollapibatch   

## Lifecycle Management APIs {#lifecycle-management-apis}

Post enrollment, you can perform the following actions to manage the profiles and cards stored in the directory using [Lifecycle Management APIs](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/index.md#lifecycle-management-apis):

* Retrieve consumer profile details along with associated cards.
* Update consumer profile with latest details.
* Delete consumer profile from directory for Click to Pay use.
* Retrieve details of a specific card.
* Update billing address of the card.
* Delete card from the directory if consumer opts out of a specific card.

|                                           If                                           |                                            Then                                            |
|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| Consumer chooses to opt out of Click to Pay.                                           | Delete the consumer profile from the directory.                                            |
| The same consumer chooses to opt in again.                                             | Raise a new enrollment request.                                                            |
| Consumer opts out of a specific card to use Click to Pay.                              | Delete the card from the directory.                                                        |
| Consumer enrolls the same card back to Click to Pay.                                   | Use the same consumer ID to re-enroll the specific card in the existing consumer profile.  |
| Consumer adds a new card to an existing profile.                                       | Use *Enroll API-Asynchronous* with existing email address and mobile number.               |
| Consumer deletes all the linked cards from his Click to Pay profile from the bank app. | Delete the Click to Pay profile to ensure that there is no empty profile in the directory. |

Diagram lifecycleapi

### Checkout {#checkout}

After the cards are successfully enrolled and linked, consumers will see Click to Pay as an available payment option on eligible merchants' websites during checkout and Mastercard will facilitate the Click to Pay [checkout experience](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/use-cases/click-to-pay/returninguser_recognized/#step-3-checkout) in the merchant environment.

If the merchant requires additional data during checkout, Mastercard will update the consumer's profile in the Issuer directory with the user-provided information.

This data will be updated and stored in the Issuer Directory if the 2 following criteria are met:

* Issuer must provide permission to update billing and shipping address as per contractual Terms and Conditions.
* When data is collected during checkout, the consumer must provide consent to store their profile data with the Issuer.

Note: If either of the above-mentioned criteria are not met, then the collected data will not be saved. It will solely be used for the specific checkout session.

Mastercard will support email and mobile number-based [identity lookup](https://developer.mastercard.com/mastercard-checkout-solutions/documentation/sdk-reference/identity-lookup/) for profiles existing within the Issuer directory.
