# Auto-Enablement
source: https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md

Use these scenarios to test auto-enablement and lifecycle management operations in the Sandbox environment. You can submit valid and invalid batch requests, check batch processing results, and verify that you can retrieve, update, or delete enabled credentials and consumer profiles.

### Prerequisites {#prerequisites}

* Complete [onboarding](https://developer.mastercard.com/issuer-enrollment/documentation/tutorials-and-guides/issuer-onboarding-click2pay-tutorial/index.md) with Mastercard Credential services.
* Review the various auto-enablement and lifecycle management [use cases](https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/index.md).
* Learn how to enroll consumer credentials [asynchronously in a batch](https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/enroll_api_async/index.md).

### Test scenarios {#test-scenarios}

Use the following scenarios to test batch enablement, batch status, and lifecycle management operations.

|            Test area            |                                                                                                                                                                                                                                                                                                                 Scenario                                                                                                                                                                                                                                                                                                                  |
|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Batch enablement                | * [Submit a valid batch request](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#submit-a-valid-batch-request) * [Submit a batch request with invalid data](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#submit-a-batch-request-with-invalid-data)                                                                                                                                                                                                                                                                                 |
| Batch status                    | * [Check a successfully processed batch](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#check-a-successfully-processed-batch) * [Check a batch with failed records](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#check-a-batch-with-failed-records)                                                                                                                                                                                                                                                                               |
| Credential lifecycle management | * [Enroll a single payment credential](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#enroll-a-single-payment-credential) * [Retrieve credential details](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#retrieve-credential-details) * [Update a credential](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#update-a-credential) * [Delete a credential](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#delete-a-credential) |
| Profile lifecycle management    | * [Retrieve a consumer profile](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#retrieve-profile-details) * [Update a consumer profile](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#update-a-consumer-profile) * [Delete a consumer profile](https://developer.mastercard.com/issuer-enrollment/documentation/testing/auto-enablement/index.md#delete-a-consumer-profile)                                                                                                                                                         |

## Test Batch Enablement {#test-batch-enablement}

### Submit a valid batch request {#submit-a-valid-batch-request}

Submit a correctly formatted batch request and confirm that Mastercard accepts it for processing.

**Send the request**
> `POST /client-directories/{directoryId}/credentials/batch`
>
> Submit a request with the `externalBatchId` and encrypted `enrollmentData`, which contains all the [required data](https://developer.mastercard.com/issuer-enrollment/documentation/use-cases/auto-enrollment/enroll_api_async/index.md#batch-enrollment-workflow).

```json
{
  "srcClientId": "83da9fcf-0f18-4073-a5ea-f6996c31690a",
  "externalBatchId": "be359a3d-c135-4d9e-9f3b-e2b6b7ea762d",
  "enrollmentData": [
    {
      "consumer": {
        "externalConsumerId": "28618032-540d-4609-8578-0394b2bd0970",
        "linkedIdentities": [
          {
            "type": "EMAIL_ADDRESS",
            "value": {
              "emailAddress": "John.doe@example.com"
            },
            "preferred": true
          },
          {
            "type": "MOBILE_NUMBER",
            "value": {
              "mobileNumber": {
                "countryCode": "1",
                "phoneNumber": "5555656598"
              }
            },
            "preferred": true
          }
        ],
        "countryCode": "US",
        "languageCode": "en",
        "firstName": "John",
        "lastName": "Doe"
      },
      "credentials": [
        {
          "credentialDataType": "CARD",
          "cardCredential": {
            "externalCredentialId": "7a9e3f12-433f-486e-bc03-de7358b85ea4",
            "primaryAccountNumber": "5455031750000360",
            "panExpirationMonth": "08",
            "panExpirationYear": "2035",
            "cardholderFirstName": "Jenifer",
            "cardholderLastName": "Lakes",
            "billingAddress": {
              "name": "Jenifer Lakes",
              "line1": "837 Ratke Shoal",
              "line2": "kll",
              "line3": "line3",
              "city": "Edison",
              "state": "NJ",
              "countryCode": "US",
              "zip": "33955"
            }
          }
        }
      ],
      "complianceSettings": {
        "privacy": {
          "latestVersionUri": "https://www.mastercard.com/global/click-to-pay/country-listing/privacy.html"
        },
        "tnc": {
          "latestVersionUri": "https://www.mastercard.com/global/click-to-pay/country-listing/terms.html"
        }
      }
    },
    {
      "consumer": {
        "externalConsumerId": "28618032-540d-4609-8578-0394b2bd0971",
        "linkedIdentities": [
          {
            "type": "EMAIL_ADDRESS",
            "value": {
              "emailAddress": "John.doe1@example.com"
            },
            "preferred": true
          },
          {
            "type": "MOBILE_NUMBER",
            "value": {
              "mobileNumber": {
                "countryCode": "1",
                "phoneNumber": "5555656599"
              }
            },
            "preferred": true
          }
        ],
        "countryCode": "US",
        "languageCode": "en",
        "firstName": "John",
        "lastName": "Doe"
      },
      "credentials": [
        {
          "credentialDataType": "CARD",
          "cardCredential": {
            "externalCredentialId": "7a9e3f12-433f-486e-bc03-de7358b85ea5",
            "primaryAccountNumber": "5455031750000361",
            "panExpirationMonth": "08",
            "panExpirationYear": "2035",
            "cardholderFirstName": "Jenifer",
            "cardholderLastName": "Lakes",
            "billingAddress": {
              "name": "Jenifer Lakes",
              "line1": "837 Ratke Shoal",
              "line2": "kll",
              "line3": "line3",
              "city": "Edison",
              "state": "NJ",
              "countryCode": "US",
              "zip": "33955"
            }
          }
        }
      ],
      "complianceSettings": {
        "privacy": {
          "latestVersionUri": "https://www.mastercard.com/global/click-to-pay/country-listing/privacy.html"
        },
        "tnc": {
          "latestVersionUri": "https://www.mastercard.com/global/click-to-pay/country-listing/terms.html"
        }
      }
    }
  ]
}
```

**Expected response**
> Mastercard accepts the batch enablement request for processing and returns a `202` response with the `batchId` and `externalBatchId`.

```json
{
  "batchId": "6b45c47e-70d6-470f-a0a6-c0fccb7e3a43",
  "externalBatchId": "6ecbf087-f159-4d69-b31d-00bec75c0478"
}
```

### Submit a batch request with invalid data {#submit-a-batch-request-with-invalid-data}

Submit a batch containing missing or incorrectly formatted data, check its status, and verify the validation details returned in the response.

**Send the request**
> `POST /client-directories/{directoryId}/credentials/batch`
>
> * Submit a request with the `externalBatchId` and encrypted `enrollmentData`, which includes missing or incorrectly formatted data, such as an invalid email address.
> * Mastercard accepts the request for processing and returns HTTP status `202` status, with the `batchId` and `externalBatchId`.

```json
{
  "batchId": "6b45c47e-70d6-470f-a0a6-c0fccb7e3a43",
  "externalBatchId": "6ecbf087-f159-4d69-b31d-00bec75c0478"
}
```

**Expected response**
> `GET /client-directories/{directoryId}/credentials/batch/{batchId}`
>
> Use the batch ID to check the batch processing status. Mastercard returns an error that identifies the missing or invalid information.

```json
{
  "status": 400,
  "reason": "INVALID_ARGUMENT",
  "message": "Cannot process the request because it is malformed or has incorrect/missing fields or values.",
  "errordetail": [
    {
      "reason": "CANNOT_BE_NULL",
      "source": "emailAddress",
      "message": "emailAddress is required",
      "sourceType": "BODY"
    }
  ]
}
```

## Check Batch Processing Results {#check-batch-processing-results}

### Check a successfully processed batch {#check-a-successfully-processed-batch}

Check a completed batch and confirm that its consumers and credentials were enabled successfully.

**Before you begin**

* You submitted a batch to enable one or more consumers and received the `batchId` and `externalBatchId`.
* Mastercard processed the batch successfully.   

**Check the batch status**
> `GET /client-directories/{directoryId}/credentials/batch/{batchId}`
>
> Use the batch ID to check the batch processing status.

**Expected response**
> Mastercard returns a `200` response with `COMPLETED_SUCCESSFULLY`, the processed records, and the status of each individual record.

```json
{
  "srcCorrelationId": "66c1cbc0-69e0-4e6b-9f1e-bf0488b69592",
  "srcClientId": "9406aacf-44d5-453e-896c-0d2e84d025ae",
  "batchId": "057242bc-10fd-3266-bb61-5a3974700b94",
  "directoryId": "c99f0c1d-02a4-492b-947c-b932bef3a035",
  "externalBatchId": "2142aab1-b13b-4208-b1de-ab14f88d450a",
  "status": "COMPLETED_SUCCESSFULLY",
  "enrollmentRecords": [
    {
      "consumer": {
        "externalConsumerId": "0a3d0f49-d7d4-498f-91be-789cdd3aeecc",
        "status": "SUCCESS"
      },
      "credentials": [
        {
          "credentialDataType": "CARD",
          "directoryCardRecord": {
            "externalCredentialId": "6fcc5318-770f-466b-8cf1-a9e164856ce0",
            "status": "SUCCESS",
            "programStatus": [
              {
                "serviceId": "SRC_C2P#37FD5045D40C3B10ADE1C44557024A2F#01",
                "status": "SUCCESS"
              },
              {
                "serviceId": "P2P#75CF35255E7F30E0903D76528F98F19D#01",
                "status": "SUCCESS"
              }
            ]
          }
        }
      ]
    }
  ]
}
```

### Check a batch with failed records {#check-a-batch-with-failed-records}

Review a processed batch that contains failed records and identify the affected data in the response details.

**Before you begin**

* You submitted a batch to enable one or more consumers and received the `batchId` and `externalBatchId`.
* The batch completed processing and contains individual records that failed, for example due to invalid credential or consumer data.   

**Check the batch status**
> `GET /client-directories/{directoryId}/credentials/batch/{batchId}`
>
> Use the batch ID to check the batch processing status.

**Expected response**
> Mastercard returns a `200` response with `COMPLETED_WITH_FAILURES` and error details that identify the failed records and the reason for each failure.

```json
{
  "srcCorrelationId": "b3190e90-605d-4705-a250-35bdd19f441a",
  "srcClientId": "9406aacf-44d5-453e-896c-0d2e84d025ae",
  "batchId": "92a87432-c319-38c4-abaf-9cc7a3eb9b0d",
  "directoryId": "c99f0c1d-02a4-492b-947c-b932bef3a035",
  "externalBatchId": "55314ddd-ee92-4d0d-9fa8-ca2b85bee5b6",
  "status": "COMPLETED_WITH_FAILURES",
  "enrollmentRecords": [
    {
      "consumer": {
        "externalConsumerId": "7d5c5fe5-ab01-4aaa-90a7-b48beabe64b4",
        "status": "FAILED",
        "error": {
          "status": 400,
          "reason": "INVALID_ARGUMENT",
          "message": "Cannot process the request because it is malformed or has incorrect/missing fields or values.",
          "errordetail": [
            {
              "reason": "INVALID_VALUE",
              "message": "email already exists with other externalConsumerId",
              "sourceType": "BODY",
              "source": "encryptedEnrollmentData.consumer.linkedIdentities.value.emailAddress"
            }
          ]
        }
      },
      "credentials": [
        {
          "credentialDataType": "CARD",
          "directoryCardRecord": {
            "externalCredentialId": "ed016762-9b38-4bac-bc14-f06f96a91f1f",
            "status": "FAILED",
            "programStatus": []
          }
        }
      ]
    }
  ]
}
```

## Manage Payment Credentials {#manage-payment-credentials}

### Enroll a single payment credential {#enroll-a-single-payment-credential}

Submit a single payment credential for enrollment in the issuer directory.

**Send the request**
> `POST /client-directories/{directoryId}/credentials`
>
> Submit a request with the `encryptedEnrollmentData`, `directoryId`, and `srcClientId`.

```json
{
   "srcClientId": "acabf8ca-7761-44e5-872e-71a8686379b8",
   "srcCorrelationId": "8b5cb4bf-3d51-4711-8179-b80ca22fae94",
   "encryptedEnrollmentData": "eyJraWQiOiIyMDIzMDIwNzIyMzUyMS1zYW5kYm94LWZwYW4tZW5jcnlwdGlvbi1zcmMtbWFzdGVyY2FyZC1pbnQiLCJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.Z92mfgR9A4DM9q1oLkROcUP0QFsHr1UPHfSQRJ8G7ax95PSmj245sOdPHAOC4QRmNjPov9L81objbbtqjm5CNAQxVWsELAwX910C3lJ87fPcJcrgJipD3ZXbpfTNdm0l6OZpk1x23jqgkPNDLDH-FG4HB5tC1o5E9r63JjjouVVD-UjJYT1rOBESHUd7jXfOURnIt2yJcox_GMQXdqetHsL3YrpC7YVwet8IAZGgdmjT6rSBnjKu0OeU4d5H2nuM35zNBZnFOoRuI9teXAvs99qu2aQEoFoqJ_Tkdz8Pp8dUQmUYIgrVZXwnqUahc6SOLuqxgvljN0xTeUYha8wfew.TDvmqQplF4LHpBve.8y0ra6NhqAZYeWBm_Ht_ILP-2Uand7kYIvTjxQZ-QX4O1_4HsG99csAGQUzg_tsbtjCvsfR0eiiIliaSKFzptZSIV54eOkaKe8VSrMY16aWnq_MFpoMXpymiID5_rI_M_oi63LAMD3k5ovyeP018QKCvtTIoEbDpXYO-hh3tsNB5am8pv-eydNJ_aJXM0uIzn0Qir03FuE4UFtTUriHDtT6cHYkrSR1-2aDb0rleKuvAczBvnc4jbOgbStD-xJnpA-5qKSucNS1T_sboxjDpQDuD3ki8JpJu5OppWD-4Zp9Cx8YO-qGLj-h78f0nK_GbQVd7s4ydb-YdSD7kRXmDTQGLxW28tYX5Z24_Ynd26X8bdu8qRV44iAhrttB7xVSbPSrcS0NxR4DkIpdk_FKO8xHcG8LW9818fDmabrgxqOJtvXvy2ngEqI69PwdRIqz09tSLKZWPXlyKmqRpzmd7B0lukAWaKD5SIixN2bN8hObKfU39EoLqmhqihJyhV3W8Itujqb6ncCFqLmzACCNcLPW2PaIxIdum4VKBfn3-VTlZH3UrPGq7FauSH4FXqIMIIY7oji68yFZompFzDRqMwxJclzLVmYwyXBsXDjuhIzHKw-Od3foXscL1GwJrtP427ZC_2L_y2HHYDuqsYZJphPw_kIrk11qfIrLasyLf_BoJbBkgL6GkMyseAohZsQCx74zHczXN4bE2iqhH0cRfWm-3nj2i_joNcZX7h1MYtlyVEeBC9tadSjXwI69vf5jKS90P70A7bVq5jYAakg9u5XckptCVgzS5gMebD4OMGavvEGP0MBbBl8V3WlOS0YNHdUazJ0A_NBT-9kvdby_3heEs1sHp4IqMTt8TQOCWJHD52JyCeRgZMMQEOXM7nwLqM3mEl0HwY0-uZGxSptLAmc4i9f8CUqP0S31Y6uBr495Q4tZ_iBMqk2yF1pGG9eBiH3UC0oZhGW8ROAJKmK3lZ-OB3L9pzM58hcFZvTMpEuEqkbdVGNHewMTreivMvxYfpzByP7rFj2AO0rAgMEuKNsZnWj79Iq33aJ5KQetvQSJZ0FnkL5DT5vQWQlt6bVbfqUojNXaw2uwkPsnrGZeBEgC3bkL8LGpZVw1d-hR5Mdg_Au406cXe3mmEfgANrSXJ05PdfGdTIGoKFIirzzK5_MQvFregNzqWAHB-SuvkQQ5ZLJlwcJpOt8LaFSjth2Q-yy2B4VNz4AGpeFC-nU-YxIZn9B9LRNvEtyxp0PFZraLTCNXXGNsYiAeosUT4dsDctzlA4E3lwDHRhW3GxtQmbNRkvionfFBM_M5IvnHbg1_laLzai1g6zJ_18f7_5TXAOZ87x3hEZA8Ur-aC-exQmcwEQHIO3ojb67ke1DGiEDlZs1DNYE-7W3puDd1HXBbgOS-7taXNZtKQ.RL0m3z33ZLZ31d0Si_m0_w"
 }
```

```json
{
  "consumer": {
    "externalConsumerId": "d9b2996c-053b-4dc4-bce8-ae704594726c",
    "countryCode": "US",
    "languageCode": "en",
    "firstName": "John",
    "lastName": "Doe",
    "linkedIdentities": [
      {
        "type": "EMAIL_ADDRESS",
        "value": {
          "emailAddress": "john.doe@mailinator.com"
        },
        "preferred": true
      },
      {
        "type": "MOBILE_NUMBER",
        "value": {
          "mobileNumber": {
            "countryCode": "1",
            "phoneNumber": "5554980099"
          }
        },
        "preferred": true
      }
    ]
  },
  "credential": {
    "credentialDataType": "CARD",
    "cardCredential": {
      "externalCredentialId": "cf17601c-9722-4f99-bfd9-6a80c76ba037",
      "primaryAccountNumber": "5506900480647790",
      "panExpirationMonth": "08",
      "panExpirationYear": "2035",
      "cardholderFirstName": "John",
      "cardholderLastName": "Doe",
      "billingAddress": {
        "name":"John Doe",
        "line1": "123 Main Street",
        "line2": "Apt 4B",
        "city": "New York",
        "state": "NY",
        "zip": "10001",
        "countryCode": "US"
      }
    }
  },
  "complianceSettings": {
    "privacy": {
      "latestVersionUri": "https://www.mastercard.com/global/click-to-pay/country-listing/privacy.html"
    },
    "tnc": {
      "latestVersionUri": "https://www.mastercard.com/global/click-to-pay/country-listing/terms.html"
    }
  }
}
```

**Successful response**
> Mastercard returns the details of the successfully enrolled consumer and credential record in masked format.

```json
{
  "srcCorrelationId": "8b5cb4bf-3d51-4711-8179-b80ca22fae94",
  "directoryId": "55247f7e-71d2-9881-e063-c84d9a0aaac0",
  "maskedConsumer": {
    "directoryConsumerId": "c1ed17f1-8c93-44ff-a3d7-b0e4580be2b8",
    "externalConsumerId": "d545b343-6274-44d9-84a8-a045099e89be",
    "maskedLinkedIdentities": [
      {
        "type": "MOBILE_NUMBER",
        "value": {
          "maskedMobileNumber": {
            "countryCode": "1",
            "maskedPhoneNumber": "(***) ***-*099"
          }
        },
        "preferred": true
      },
      {
        "type": "EMAIL_ADDRESS",
        "value": {
          "maskedEmailAddress": "t*****7@mailinator.com"
        },
        "preferred": true
      }
    ],
    "countryCode": "US",
    "languageCode": "en",
    "maskedFirstName": "J***",
    "maskedLastName": "D**"
  },
  "maskedCredential": {
    "credentialDataType": "CARD",
    "maskedCardCredential": {
      "externalCredentialId": "c3ee8545-24ee-4ac1-b635-fccdbfef8426",
      "directoryCredentialId": "QYVkTk3LQrmF-kj3Iu99yA000000000000US",
      "panBin": "550690",
      "panLastFour": "7790",
      "panExpirationMonth": "08",
      "panExpirationYear": "2035",
      "paymentCardDescriptor": "mastercard",
      "paymentCardType": "CREDIT",
      "countryCode": "US",
      "dateOfCardCreated": "2026-07-09T17:46:45.693Z",
      "cardArtUri": "https://sbx.assets.mastercard.com/card-art/combined-image-asset/HIGH-MASK-3x.png"
    },
    "maskedBillingAddress": {
      "addressId": "6ac235c9-36f1-4fde-968b-9fa245262f40",
      "name": "He**i Da***l",
      "line1": "1** M*** S*****",
      "line2": "A** 4*",
      "city": "New York",
      "state": "NY",
      "countryCode": "US",
      "zip": "10001",
      "createTime": "2026-07-09T17:46:45.734Z"
    }
  }
}
```

**Negative response**
> If an API request omits a mandatory parameter or includes an invalid value, Mastercard returns a `400` error response identifying the affected field and the reason for the error.

```json
{
  "errordetail": [
    {
      "message": "Required request parameter 'srcClientId' for method parameter type String is not present",
      "reason": "CANNOT_BE_NULL",
      "source": "srcClientId",
      "sourceType": "QUERY"
    }
  ],
  "message": "Http request argument type is mismatched at this service",
  "reason": "INVALID_ARGUMENT",
  "status": 400
}
```

### Retrieve credential details {#retrieve-credential-details}

Retrieve the latest details for a specific enabled credential and verify the returned credential data.

**Before you begin**

You successfully submitted a batch enablement request that included the consumer profile and credentials.

**Retrieve the credential**
> `GET /client-directories/{directoryId}/credentials/{externalCredentialId}`
>
> Submit a request with the required `externalCredentialId`, `srcClientId`, and `directoryId`.

**Expected response**
> Mastercard returns a `200` response with the latest credential details.

```json
{
  "srcCorrelationId": "4a3259dc-d82b-419f-9d1b-f356b3fcb005",
  "credentialDataType": "CARD",
  "maskedCardCredential": {
    "externalCredentialId": "f5ca8668-1434-4f43-8880-374a365e8df9",
    "directoryCredentialId": "SlrAEnIVQhavVdTNDv1XwQ000000000000US",
    "panBin": "541234",
    "panLastFour": "8112",
    "panExpirationMonth": "12",
    "panExpirationYear": "2026",
    "paymentCardDescriptor": "mastercard",
    "paymentCardType": "CREDIT",
    "countryCode": "US",
    "dateOfCardCreated": "2026-04-28T16:43:50.692Z",
    "cardArtUri": "https://stage.assets.mastercard.com/card-art/combined-image-asset/HIGH-MASK-3x.png"
  },
  "encryptedBillingAddress": "eyJraWQiOiJHdWFyZF9QMlBjMnBlbmNrZXlfMjgwMSIsImVuYyI6IkExMjhHQ00iLCJhbGciOiJSU0EtT0FFUC0yNTYifQ.R_OwmbbcKSL_OrAKnViNG7zmYtbYYp-lUwNLGPaIa9Wtja5ibP4sDm-d9m2dUjXT4LAZp9B0kGKSwzf1iWbiJyJ8DLOWk-tj8i0a0wtfrWwSdIoT2ysjoG1jkkZw2U-ksyg9mIGRXbfRACk7cnVNm8TI4evmn6WBmSYksREIaVLcESTlSbGx3fn-uOLpt09OrlrBUsfNWnEzqGcgOnPd2SLPpLFlyxBfFBE71DJmtZn5DMIWuPKEU7t0bozfWzPVXb4YFdsgYbTqhQzIcZ-3M-g3DnLmXUyMFifQYNSzdnwIAYSH-8yAnVlyoYZdNhMBdRjcBPd6PQLC2lnB8pt5Ew.rxc8OptO4y29QzjD.ezj0FD5QV0wGfKhUfXcbmj76GVLi3CGoEgPJdMu7TZOL5lb9frgLOVq3J6azlwZ_dcvJqOCUw_fMc4zEd7vUPHMOx2bVw1dHPSSpJHNMIwPP3VvQD5vUdIap_NYHH7EAL9Uh5emIhdEZUXRYMU5EYZgwS0bFog10D4JvWSWY8babNPy4cQAIvv5IxEPPIHBaGDYyB_uOS95R905iRkY_B_ky.eR2y5MLKnvXbD8qADMO3JQ",
  "keyFingerprintId": "95da14db087f0f6e95ac8e7aafb650539c2333f5137176724b403e1787b6d78d"
}
```

**Negative response**
> If an API request omits a mandatory parameter or includes an invalid value, Mastercard returns a `400` error response identifying the affected field and the reason for the error.

```json
{
  "errordetail": [
    {
      "message": "Required request parameter 'srcClientId' for method parameter type String is not present",
      "reason": "CANNOT_BE_NULL",
      "source": "srcClientId",
      "sourceType": "QUERY"
    }
  ],
  "message": "Http request argument type is mismatched at this service",
  "reason": "INVALID_ARGUMENT",
  "status": 400
}
```

### Update a credential {#update-a-credential}

Update the details of a specific enabled credential and confirm that Mastercard accepts the changes.

**Before you begin**

You successfully submitted a batch enablement request that included the consumer profile and credentials.

**Update the credential**
> `PUT /client-directories/{directoryId}/credentials/{externalCredentialId}`
>
> Call the API with `externalCredentialId` and the credential information you want to update.

```json
{
  "srcClientId": "9406aacf-44d5-453e-896c-0d2e84d025ae",
  "srcCorrelationId": "7c5d3af7-7d93-43b2-b5a7-f2e8b8eb3d6a",
  "credentialData": {
    "credentialDataType": "CARD",
    "cardCredentialData": {
      "encryptedBillingAddress": "eyJraWQiOiIyMDIzMDEyNDA5MzE0Mi1zdGctbWMtbmV3LWZwYW4tZW5jcnlwdGlvbi1zcmMtbWFzdGVyY2FyZC1pbnQiLCJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.L4cenIH8Xapt4DjU01FUQnZw4URlkqmgEnvD5OI1jwBgXGbEZJA-DJCUZVGJdxy5f4CMSMWvp2tJEpLt3jEC87bTMjhABECfIgrqf8Cho51AQqf9mvLnCe2VD8m4qrY7tPy5uOT_Z7-bKf73dibMf9Vjz4PCVKNYPmm_QNS7UXjumhG9lvGcxuLDWMRK7lRhh5XjYOJhPtVG-PyQgcKd9cNUKlbnpvYg-UCAuK35X8bDtSoIeQwMdk6XOOTH99b3s4EAlmXnm77bTmh2eAoNLP9GBoqF1NUEqJ7c0zYZWZ3apPDNY9_cGwIyVhSEJUBfE0dgX_53JrUx4Z6f-71KNg.7LvEkSa9TIavxznu.QBUVDdz6jl4n5nH9ou0Ff-l-dn6spvt4dLP9GhmyN564bwWJCyq5d-PT7gE-ABb8arxIk8cEoi-n2OhoEwkqM2sddQViZOg0DunkCfofSPMRCchtBd-9_iYvbQWkjp3v3XzgD11-AT3LqXKsptdn22Q57wuyOUwmeuGRzrks6du5B-sXSLB6mvmnHDJmeul-8J0j.uPXdyE7eWgTLJZnQ8-yP3A"
    }
  }
}
```

**Expected response**
> Mastercard returns a `200` response with the `srcCorrelationId`, confirming the update was successful.

```json
{
  "srcCorrelationId": "779165e0-1905-4edd-89fa-be46497b5044"
}
```

**Negative response**
> If an API request is missing the `srcClientID` or includes an invalid value, Mastercard returns a `400` error response identifying the affected field and the reason for the error.

```json
{
  "errordetail": [
    {
      "reason": "INVALID_VALUE",
      "message": "srcClientId is not in required format",
      "source": "srcClientId",
      "sourceType": "QUERY"
      }
    ],
    "message": "Cannot process the request because it is malformed or has incorrect/missing fields or values.",
    "reason": "INVALID_ARGUMENT",
    "status": 400
}
```

### Delete a credential {#delete-a-credential}

Delete a specific credential from a consumer's profile and review the response details.

**Before you begin**

You successfully submitted a batch enablement request that included the consumer profile and credentials.

**Delete the credential**
> `DELETE /client-directories/{directoryId}/credentials/{externalCredentialId}`
>
> Call the API with the required `externalCredentialId`, `srcClientId`, and `directoryId`.

**Expected response**

Mastercard returns a `200` response with the `srcCorrelationId`, confirming the credential was successfully deleted.

```json
{
  "srcCorrelationId": "779165e0-1905-4edd-89fa-be46497b5044"
}
```

**Negative response**
> If an API request omits a mandatory parameter or includes an invalid value, Mastercard returns a `400` error response identifying the affected field and the reason for the error.

```json
{
  "errorDetail": [
    {
      "message": "Required request parameter 'srcClientId' for method parameter type String is not present",
      "reason": "CANNOT_BE_NULL",
      "source": "srcClientId",
      "sourceType": "QUERY"
    }
  ],
  "message": "Http request query parameter is missing",
  "reason": "INVALID_ARGUMENT",
  "status": 400
}
```

## Manage Consumer Profiles {#manage-consumer-profiles}

### Retrieve profile details {#retrieve-profile-details}

Retrieve the latest details for a specific consumer profile.

**Before you begin**

You successfully submitted a batch enablement request that included the consumer profile and credentials.

**Retrieve the profile**
> `GET /client-directories/{directoryId}/profiles/{externalConsumerId}`
>
> Submit a request with the required `externalConsumerId`, `srcClientId`, and `directoryId`.

**Expected response**
> Mastercard returns a `200` response that contains the latest profile details.

```json
{
  "srcCorrelationId": "9fda8829-7db5-474d-a377-0b582c79677c",
  "encryptedConsumerData": "eyJraWQiOiJHdWFyZF9YSURfRW5jS2V5XzA1IiwiZW5jIjoiQTEyOEdDTSIsImFsZyI6IlJTQS1PQUVQLTI1NiJ9.lMfhRMTWRBgNPiMCPKZA-FqmeiJYD8UFOt6_bZEw48grvqC_frbAXcOfvBFMFfVHh64cSx7kGwdQ6KQuVap6SXTtAp7tfh5-AvkChIVQFp1Z65BJ4JZWs25SbNMfWuMG6e4drZVX2nDlwlNIumWn_bDmkoU9bxE742tmdDV9cCnpDlR1tyiu4n8pkQjIaW3bvoprA5-KoxC3KBKrZHycnaxd_e88Y7X49guNA7KDEMg9FzjnWwEPfWCGRXLTCLlzKUxxcdIYHnlct138kp-OFbpGJ5wJgE4PdaNVniGlMymqTnT2zH8-DDTUm3fIreKzF-wGhmAitfPN2gcCn_i-ag.iQ_C8B4SGDKRqD5p.sVfTNYgchvv3qXCULC57CHFm4ixV6C7LfTVBrNpuSO_lL1TrvxtG-WF3gpX4X8uVlHApNB5JBampy_XQ-QKshndoM6SHp54PqXL3XwFSgrqUIgK17_mGv9aWiKmKiaTBUsrqjz7j1qiq-MbN6wcNMk1Gizr79t24EhYcK3wMtP_q5TviRZZO-5zOS1VlUK6ed5YXa5Hgyc2VDIf9qkxEcNolZWX8WJwXj5iyrTX1DHSBGa1UH-kkYw7Kl2xK-X1nMH8zf-dwriqJDhEAvvBkIhvkWw539IBysndJZ-dBgFYfaTQ9T8jIJYJsKBEWAgDJEvnCJ8SeBIgrUwUsvyQZhrAKTNzIOkNtiT5yBzheXRfLc-JE2l5Nxg3YNsUan88vvA4zgrbDWqvs_sVb3bVFmKr7gYilf7BWBb1Lwy2Hfs4SZcW7bx8SdzJJt86Od61LZsC7cu3LDCfUDgwu5qkGWTF4bXTJi7fRmBG-EvSH9w.aVusloJQ-ox37W275tQxRQ",
  "keyFingerprintId": "95da14db087f0f6e95ac8e7aafb650539c2333f5137176724b403e1787b6d78d",
  "maskedCredentials": [
    {
      "credentialDataType": "CARD",
      "maskedCardCredential": {
        "externalCredentialId": "c3ee8545-24ee-4ac1-b635-fccdbfef8426",
        "directoryCredentialId": "QYVkTk3LQrmF-kj3Iu99yA000000000000US",
        "panBin": "550690",
        "panLastFour": "7790",
        "panExpirationMonth": "08",
        "panExpirationYear": "2035",
        "paymentCardDescriptor": "mastercard",
        "paymentCardType": "CREDIT",
        "countryCode": "US",
        "dateOfCardCreated": "2026-07-09T17:46:45.693Z",
        "cardArtUri": "https://sbx.assets.mastercard.com/card-art/combined-image-asset/HIGH-MASK-3x.png"
      },
      "maskedBillingAddress": {
        "addressId": "f94b21d4-e12c-403b-8f12-dbed76411136",
        "name": "He**i Da***l",
        "line1": "1** M*** S*****",
        "line2": "A** 4*",
        "city": "New York",
        "state": "NY",
        "countryCode": "US",
        "zip": "10001",
        "createTime": "2026-07-09T18:52:34.511Z"
      }
    }
  ]
}
```

**Negative response**
> If an API request omits a mandatory parameter or includes an invalid value, Mastercard returns a `400` error response identifying the affected field and the reason for the error.

```json
{
  "errordetail": [
    {
      "message": "Required request parameter 'srcClientId' for method parameter type String is not present",
      "reason": "CANNOT_BE_NULL",
      "source": "srcClientId",
      "sourceType": "QUERY"
    }
  ],
  "message": "Http request argument type is mismatched at this service",
  "reason": "INVALID_ARGUMENT",
  "status": 400
}
```

### Update a consumer profile {#update-a-consumer-profile}

Update the details of a specific consumer profile and confirm that Mastercard accepts the changes.

**Before you begin**

You successfully submitted a batch enablement request that included the consumer profile and credentials.

**Update the profile**
> `PUT /client-directories/{directoryId}/profiles/{externalConsumerId}`
>
> Call the API with `encryptedConsumerData`, `srcClientId`, `directoryId`, and the profile information you want to update.

```json
{
   "srcClientId": "83da9fcf-0f18-4073-a5ea-f6996c31690a",
   "srcCorrelationId": "a496f818-aeed-43a9-b227-2472ffa7e0df",
   "encryptedConsumerData": "eyJraWQiOiIyMDIzMDEyNDA5MzE0Mi1zdGctbWMtbmV3LWZwYW4tZW5jcnlwdGlvbi1zcmMtbWFzdGVyY2FyZC1pbnQiLCJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.LXg0VRRiLLaYDl6KKaMnUmtMq5xaoL5e65iW4B21QZblGgE_B9FmXCIajdzOgRQ1hj46R4Nu1jwU-HI6L5e0bKt7nLWfv7ZWE6qF961sXMaVRTqo-8945QTY0qc7WIkH33VTVU3z1PrAtdFX7pCswqn6uqWVPAAXcCLBTfzH_KE33UsobGinSvpMyOPMCxsQLI75qVs0vSMfllU7ICqvOTOYUaxit4VdzDnJMNPi7B8ZVcQp1hy_6RvLvN2wAkI4g5_2z-oyC241vHyvNEUXnEfvb2dzfiv7qlgbX-Uuogjxth_okOwffnm4k7QsvGL3Fbjqbbx2r4zttoEKvDSwnw.Ttbv_XOMd6tGADai.u_zFeL1VpByUueF98QZeNNq23WdopTB7asNo_i_Vm0pnP_E9OVRT0__mQeUfrIcBFDSho3_O0x3BmJg_1kA5xoUEPE9bWniHPYHrCAdNDUOX7MbGxwkufzGE2yWlwfz69k08qMQGz-3JlM8vSjbj8_evda5oEdSc7T3PGowD-qsCP0eXfyxlHCmqomfzjw-qILZ_bUzAOPVBt5crYT-1Uxb8t_bxXwAIbxEvuCHy9F_hsEm9Ys1OcklYlENNTC6zOsVVinY7g9f2qwilHvR7ip9aLO1NuTYK-2i7KT1qCNEd6ZqnE3oOLuoPNJiDEV8xR6hJRkvZanqtUaQZm_lyS4d9Mci89H3xYIfObahmXbu3z742A49a49jPK9ntY7L24Hj5e_TN1DqWoWs8PBkomM8kgGjmoRUimEZxFqPikWkEYyCGtjlWNRwbM2-7wF-0ky9D8Heppq1yAqw7RIHjkDXRjtAlytriM2yyO_Abg4es4L45.dtfLMe2h7mLSLu0AlYcHAQ"
 }
```

```json
{
  "consumer": {
    "externalConsumerId": "a521d688-7f81-435c-b2ed-324f99f7a5e0",
    "countryCode": "US",
    "languageCode": "en",
    "firstName": "John",
    "lastName": "Doe",
    "linkedIdentities": [
      {
        "type": "EMAIL_ADDRESS",
        "value": {
          "emailAddress": "john.doe@mailinator.com"
        },
        "preferred": true
      },
      {
        "type": "MOBILE_NUMBER",
        "value": {
          "mobileNumber": {
            "countryCode": "1",
            "phoneNumber": "5550094345"
            }
          },
        "preferred": true
      }
    ]
  }
}
```

**Expected response**
> Mastercard returns a `200` response with the `srcCorrelationId`, confirming the update was successful.

```json
{
  "srcCorrelationId": "a496f818-aeed-43a9-b227-2472ffa7e0df"
}
```

**Negative response**
> If an API request is missing the srcClientID or includes an invalid value, Mastercard returns a `400` error response identifying the affected field and the reason for the error.

```json
{
  "errordetail": [
    {
      "message": "Required request parameter 'srcClientId' for method parameter type String is not present",
      "reason": "CANNOT_BE_NULL",
      "source": "srcClientId",
      "sourceType": "QUERY"
    }
  ],
  "message": "Http request argument type is mismatched at this service",
  "reason": "INVALID_ARGUMENT",
  "status": 400
}
```

### Delete a consumer profile {#delete-a-consumer-profile}

Delete the profile of a consumer who has opted out of a Mastercard Credential Services program.

**Before you begin**

* You successfully submitted a batch enablement request that included the consumer profile and credentials.   

**Delete the profile**
> `DELETE /client-directories/{directoryId}/profiles/{externalConsumerId}`
>
> Submit a request to the API with the required `externalConsumerId`, `srcClientId`, and `directoryId`.

**Expected response**

Mastercard returns a `200` response with the `srcCorrelationId`, indicating the consumer profile was successfully deleted.

```json
{
  "srcCorrelationId": "779165e0-1905-4edd-89fa-be46497b5044"
}
```

**Negative response**
> If an API request is missing the srcClientID or includes an invalid value, Mastercard returns a `400` error response identifying the affected field and the reason for the error.

```json
{
  "status": 400,
  "reason": "INVALID_ARGUMENT",
  "message": "Cannot process the request because it is malformed or has incorrect/missing fields or values.",
  "errorDetail": [
    {
      "reason": "CANNOT_BE_NULL",
      "source\"": "srcClientId",
      "message\"": "srcClientId is required",
      "sourceType": "QUERY"
    }
  ]
}
```

## Next Steps {#next-steps}

* Consult the [API Reference](https://developer.mastercard.com/issuer-enrollment/documentation/api-reference/apis/index.md) for complete endpoint specifications, request and response schemas, and environment URLs.
* If you run into issues, visit [Support](https://developer.mastercard.com/issuer-enrollment/documentation/support/index.md) for FAQs and troubleshooting guidance.
