# Maintain Legacy Click to Pay Enrollments
source: https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/legacy-apis/index.md
This page is for issuers and service providers that already integrate with the [Legacy APIs](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/apis-legacy/index.md) and need to maintain that integration. These APIs auto-enable cards into Click to Pay and manage the resulting consumer profiles and cards by Mastercard-assigned identifiers, such as `consumerId` and `cardId`.
Warning: Do not use these APIs for new integrations. Use the Credential Directory APIs described in [Enable Consumer Credentials in a Batch](https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/enroll_api_async/index.md) and [Manage Consumer Profiles and Credentials](https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/life_cycle/index.md).
### Choose the Right API Family {#choose-the-right-api-family}
| If you | Use |
|------------------------------------------------------------------------------------------------------------|-------------------------------|
| Start a new integration, or manage credentials by your own `externalConsumerId` and `externalCredentialId` | The Credential Directory APIs |
| Maintain an existing integration that stores the Mastercard `consumerId` and `cardId` | The legacy APIs on this page |
### Prerequisites {#prerequisites}
* An existing Click to Pay integration onboarded through the [Sandbox onboarding tutorial](https://developer.mastercard.com/issuer-enrollment/documentation/tutorials-and-guides/issuer-onboarding-click2pay-tutorial/index.md).
* Your `srcClientId` and the `serviceId` for the Click to Pay program.
* OAuth 1.0a signing keys and encryption keys configured as described in [API Basics](https://developer.mastercard.com/issuer-enrollment/documentation/api-basics/index.md).
* The `consumerId` and `srcDigitalCardId` (used as `cardId`) values that Mastercard returned when the consumer and card were enrolled.
## Auto-Enable Cards in a Batch {#auto-enable-cards-in-a-batch}
An issuer auto-enables eligible cardholders into Click to Pay so that they can use their cards at checkout without entering card details. Use the batch operation because it accepts many enrollment records in one asynchronous request.
Diagram autoenrollapibatch
1. Encrypt the `enrollmentData` object as described in the [Perform Encryption](https://developer.mastercard.com/issuer-enrollment/documentation/tutorials-and-guides/perform-encryption-tutorial/index.md#step-2-encrypt-an-object) tutorial, then submit the batch. Mastercard returns `202` with a `batchId` because processing continues after the response.
See the endpoint structure:
API Reference: `POST /cards/batch`
2. Poll the batch status with the returned `batchId`, `srcClientId`, and `serviceId`. Use this operation because it is the only way to see the overall batch status and the result of each record.
See the endpoint structure:
API Reference: `GET /cards/batch/{batchId}`
3. Reconcile successful records in your system. Correct failed records and submit them in a new batch.
## Manage an Enrolled Consumer Profile {#manage-an-enrolled-consumer-profile}
After enrollment, the cardholder can review, change, or remove their Click to Pay profile in your app or website.
1. Retrieve the profile when the cardholder opens their Click to Pay settings. Use this operation to show the stored details before any change.
See the endpoint structure:
API Reference: `GET /profiles/{consumerId}`
2. Update the profile when the cardholder changes their details, such as an email address or phone number. Send the complete updated profile, because the request replaces the stored values.
See the endpoint structure:
API Reference: `PUT /profiles/{consumerId}`
3. Delete the profile when the cardholder opts out of Click to Pay. This operation identifies the profile with the `identityType` and `identityValue` query parameters instead of a path value, and it removes the profile with its associated cards.
See the endpoint structure:
API Reference: `DELETE /profiles`
## Manage an Enrolled Card {#manage-an-enrolled-card}
Use the card operations when a single card changes but the cardholder keeps their profile.
1. Retrieve the card to show its latest stored details. Use the `srcDigitalCardId` as the `cardId` path value.
See the endpoint structure:
API Reference: `GET /cards/{cardId}`
2. Update the card when its details change, such as a new billing address or expiry date.
See the endpoint structure:
API Reference: `PUT /cards/{cardId}`
3. Delete the card when the cardholder removes it from Click to Pay or the account closes. Provide the optional `reason` to record why the card was removed.
See the endpoint structure:
API Reference: `DELETE /cards/{cardId}`
## Error Resolution {#error-resolution}
For error meanings and resolution tips, see [Code and Formats](https://developer.mastercard.com/issuer-enrollment/documentation/code-and-formats/index.md). A `404` from a lifecycle operation usually means the `consumerId` or `cardId` does not match an enrolled record. Verify the stored identifier before you retry.
## Next Steps {#next-steps}
* Plan your migration to the Credential Directory APIs. See [Auto Enablement](https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/index.md).
* Review the full legacy specifications in [Legacy APIs](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/apis-legacy/index.md).