> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Enroll a card to Click to Pay for Mastercard

> Use this endpoint to enroll a card in Click to Pay for Mastercard.

POST/digitalwallets/clicktopay/mastercard/enroll

Use this endpoint to enroll a card in Click to Pay for Mastercard.

For more information about this ecommerce checkout solution, see [Click to Pay](https://www.marqeta.com/docs/developer-guides/digital-wallets-and-tokenization.md#_click_to_pay).

## Header parameter

| Fields | Description |
| - | - |
| req-sys-id string  Required | Identifier generated by the card program. These identifiers are used for troubleshooting requests between the card program and Marqeta. **Allowable Values:**  36 char max |

## Request body

| Fields | Description |
| - | - |
| card\_token string  Required | Unique identifier of the card resource. **Allowable Values:**  1–36 chars  Existing card token |
| user\_token string  Required | Unique identifier of the cardholder. **Allowable Values:**  1–36 chars |
| user\_details array of objects  Required | User's email address and mobile phone number with country code. **Allowable Values:**  A valid array of `user_details` objects |
| user\_details\[].**email\_address** string  Required | User's email address. **Allowable Values:**  255 char max |
| user\_details\[].**mobile\_number** object  Required | User's mobile phone number and country code. **Allowable Values:**  `country_code`, `phone_number` |
| user\_details\[].mobile\_number.**country\_code** string  Required | User's mobile phone number country code only. **Allowable Values:**  255 char max |
| user\_details\[].mobile\_number.**phone\_number** string  Required | User's mobile phone number without country code. **Allowable Values:**  255 char max |
| locale\_country string  Required | The user-provided country code. The ISO 3166 country code is a two-letter country code that represents a country. For example, the numeric code for the United States is `US`. The ISO maintains the [ISO 3166 country codes](https://www.iso.org/iso-3166-country-codes.html). **Allowable Values:**  2 chars |
| locale\_language string  Required | The user-provided language choice. The ISO 639-2 language code is a two-letter country code that represents a language. The ISO maintains the [ISO 639-2 language codes](https://id.loc.gov/vocabulary/iso639-2.html). **Allowable Values:**  2 chars |
| callback\_url string  Optional | The URL to which the Click to Pay request status is sent via webhooks. **Allowable Values:**  A valid URL |
| callback\_authentication\_type string  Optional | The type of authentication required for the callback URL. - `OAUTH_BEARER_TOKEN`: OAuth bearer token for the callback URL. - `BASIC_AUTH`: Basic auth username and password for the callback URL. **Allowable Values:**  `OAUTH_BEARER_TOKEN`, `BASIC_AUTH` |
| oauth\_bearer\_token string  Optional | OAuth bearer token to access your callback URL if the `callback_authentication_type` is `OAUTH_BEARER_TOKEN`. **Allowable Values:**  A bearer token that can be used to authenticate the callback API on the receiving end |
| callback\_secret\_for\_signature string  Optional | Randomly chosen string used for implementing HMAC-SHA1. HMAC-SHA1 provides an added layer of security by authenticating the message and validating message integrity. Using this functionality requires that your callback endpoint verify the message signature. For information about implementing this functionality, see [Signature Verification](https://www.marqeta.com/docs/developer-guides/signature-verification.md). **Allowable Values:**  20–50 chars  - Must contain at least one numeral  - Must contain at least one lowercase letter  - Must contain at least one uppercase letter  - Must contain at least one of these symbols:   +  `@` `#` `$` `%` `!` `^` `&` `*` `(` `)`   +  `\` `_` `+` `~` `-` `=` `[` `]` `{` `}`   +  `,` `;` `:` `'` `"` `.` `/` `<` `>` `?` \`\`\` |
| basic\_auth\_username string  Optional | Basic auth username to access your callback URL if authentication type is basic. If authentication type is basic, both username and password are required. **Allowable Values:**  1–50 chars |
| basic\_auth\_password string  Optional | Basic auth password to access your callback URL if authentication type is basic. If authentication type is basic, both username and password are required. **Allowable Values:**  20–50 chars  - Must contain at least one numeral  - Must contain at least one lowercase letter  - Must contain at least one uppercase letter  - Must contain at least one of these symbols:  `@` `#` `$` `%` `!` `^` `&` `*` `(` `)`  `\` `_` `+` `~` `-` `=` `[` `]` `{` `}`  `,` `;` `:` `'` `"` `.` `/` `<` `>` `?` |

## Sample request body

```json JSON expandable lines wrap theme={null}
{
  "card_token": "my_card_token_1234",
  "user_token": "my_user_token_1234",
  "user_details": [
    {
      "email_address": "test@test.com",
      "mobile_number": {
        "country_code": "44",
        "phone_number": "1234567890"
      }
    }
  ],
  "locale_country": "US",
  "locale_language": "en"
}
```

## Response body

| Fields | Description |
| - | - |
| token string  Conditionally returned | Unique identifier of the Click to Pay request. **Allowable Values:**  1–36 chars |

## Sample response body

```json JSON expandable lines wrap theme={null}
{
  "token": "my_token_0000"
}
```


## Related topics

- [Click to Pay for Mastercard Overview](https://www.marqeta.com/docs/core-api/digital-wallets-management/click-to-pay-mastercard.md)
- [Digital Wallets Management Overview](https://www.marqeta.com/docs/core-api/digital-wallets-management.md)
- [Retrieve Click to Pay for Mastercard enrollment status](https://www.marqeta.com/docs/core-api/digital-wallets-management/click-to-pay-mastercard/retrieve-click-pay-mastercard-enrollment-status.md)
- [Enroll a card to Click to Pay for Visa](https://www.marqeta.com/docs/core-api/digital-wallets-management/click-to-pay-visa/enroll-card-click-pay-visa.md)
- [Enroll a cardholder to Click to Pay for Visa](https://www.marqeta.com/docs/core-api/digital-wallets-management/click-to-pay-visa/enroll-cardholder-click-pay-visa.md)
