POST////
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.
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. 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. 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. 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
{
"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
{
"token": "my_token_0000"
}