Direct API Implementation
The Direct API integrates EMV 3-D Secure 2.x into your business's website. This integration uses an iframe to complete the device profiling and EMV 3-D Secure authentication requirements without including third-party JavaScript directly on your site.
This implementation requires the use of JavaScript to leverage the authentication. The JavaScript is hosted and contained inside the iframe and does not directly access your web page.
A website that provides a demo tool to help users understand how payer authentication works is available:
You can complete the steps required to implement payer authentication on their website and examine the code underlying the process. Use test card numbers to walk through the process and enter 123 as the security code.
Enable Merchant Account for EMV 3-D Secure
Partners and merchants use the to go online and view transaction activity and to generate reports about their transactions.
When the MID account is created, the various services that the merchant needs must be enabled.
For more information about configuring your account in the for payer authentication and other services, see the Merchant Boarding User Guide. Payer authentication is a service that might need to be turned on by support. To set up an account for payer authentication, you need this information:
- MID
- Merchant website URL
- Two-character ISO code for your country
- Merchant category code
- EMV 3-D Secure requestor ID (optional)
- EMV 3-D Secure requestor name (optional)
- Name of merchant's bank
- Name, address, and email address of bank contact
For each payment card that you accept, your acquirer must provide this information:
- Eight-digit BIN number
- Merchant ID assigned by your acquirer
- List of all of the currencies that you can process
Before You Begin
Notify your account representative that you want to implement payer authentication (3-D Secure) using the Direct API integration. Provide the merchant ID that you will use for testing. For more information, see Payer Authentication Merchant Workflow.
Before you can implement payer authentication services, your business team must contact your acquirer and to establish the service. Your software development team should become familiar with the REST API fields and technical details of this service.
Implementation Steps
Request the Setup Service
Request the Setup service before selecting the button to submit payment. Request the Setup service separately without including other services. The Setup service response includes a JSON Web Token (JWT) that contains credentials to create a secure channel with you. The Setup response also includes a reference ID to use during the authentication and a URL to use when transferring the device data collected in the next step.
Run the Setup service as soon as the customer enters their card number to avoid any delay in the customer experience. The next step in the process, device data collection, cannot start until the Setup response is received because the response has the URL where the device data is sent.
After the customer credit card is entered, immediately begin device data collection.
Setup Endpoint
POST /risk/v1/authentication-setups
POST /risk/v1/authentication-setups
POST /risk/v1/authentication-setups
Setup Request Fields
When requesting the Setup service, you must send the customer's payment information. This can be either the actual encrypted card information or a token associated with the payment data.
Required Fields for Setup
paymentInformation.card.expirationMonth
paymentInformation.card.expirationYear
paymentInformation.card.number
paymentInformation.card.type
Required when the card type is JCB, Cartes Bancaires, or China UnionPay.
Besides the required fields, the request might also include any of these fields:
Optional Fields for Setup
paymentInformation.tokenizedCard.number
paymentInformation.customer.customerId
tokenInformation.transientToken
Setup Response Fields
The response from the issuing bank might include these API fields:
Response Fields for Setup
consumerAuthenticationInformation.accessToken
Used in Collect Device Data.
consumerAuthenticationInformation.deviceDataCollectionUrl
Used in Collect Device Data.
consumerAuthenticationInformation.referenceId
Used in Check Enrollment.
Collect Device Data
One of the key components to authenticating a cardholder during an online transaction is to compare information about the device that the customer is currently using to the information in the bank's database about devices the customer used in past transactions.
This information is maintained in the access control server (ACS) at the issuing bank. This device information focuses on the web browser and includes these types of data:
- IP address
- Browser language
- Browser type
- Browser version
- Computer operating system
- System time zone
- Screen dimensions
- Color depth
A successful device data collection process that includes the 11 browser fields listed in the check enrollment step increases the chances of a frictionless authentication. See Check Enrollment for the list of 11 browser fields. Business rules evaluate whether a transaction is risky enough to require the buyer to authenticate their identity. These business rules are configured in the issuer's risk analysis software that evaluates each transaction.
Device data collection starts on the merchant end after you receive the server-side Setup service response as described in Request the Setup Service and pass the access token and the device data collection URL to the front end. When device data gets to the data collection URL, a Method URL defined in the 3-D Secure protocol captures the entire card number to identify the issuing bank.
A hidden 10 x 10 pixel iframe is rendered in the browser, and using the access token, you send the customer device data to the device data collection URL. The device data collection can take up to 10 seconds. If you proceed with the check enrollment service as described in Check Enrollment before a response is received, the collection process stops and an error occurs. Despite the error, as long as you include the data from the eleven browser fields as explained in Check Enrollment, you can still proceed with the EMV authentication.
Start device data collection immediately after you receive the customer card number to ensure that the data collection runs in the background while the customer continues with the checkout process, ensuring a minimum of waiting. When a customer changes to a different card number, begin the Setup and device data collection process again as soon as the new card number is entered.
Build the iFrame
The iframe has these parameters:
- Form POST Action: The POST goes to the URL that is opened within an iframe. This URL is the value provided by the
consumerAuthenticationInformation.deviceDataCollectionUrlresponse field discussed in Request the Setup Service. - JWT POST Parameter: Use the value from the
consumerAuthenticationInformation.accessTokenresponse field discussed in Request the Setup Service.
Initiate the Device Data Collection iFrame
Initiate a form POST in a hidden 10 x 10 pixel iframe and send it to the device data collection URL (consumerAuthenticationInformation.deviceDataCollectionUrl).
Place the HTML anywhere inside the <body> element of the checkout page. Dynamically replace the value of the form action attribute and JWT POST parameter with the response values discussed in Request the Setup Service.
<iframe id="cardinal_collection_iframe" name="collectionIframe" height="10" width="10" style="display: none;"></iframe><form id="cardinal_collection_form" method="POST" target="collectionIframe" action=https://centinelapistag.cardinalcommerce.com/V1/Cruise/Collect> <input id="cardinal_collection_form_input" type="hidden" name="JWT" value="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJSZWZlcmVuY2VJZCI6ImE0NjVlYzU1LTMwNTEtNGYwZC05MGE0LWZjMDNlMGE2MWQxOSIsIlJldHVyblVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdDo4MDgyXC9yZXF1ZXN0LWNhdGNoZXJcL2NhdGNoLXJlcXVlc3QucGhwIiwianRpIjoianRpXzVmMDVkM2VkY2U0MjYzLjc5MjQwNzMzIiwiaWF0IjoxNTk0MjE3NDUzLCJpc3MiOiI1YjIzZjhjMGJmOWUyZjBkMzQ3ZGQ1YmEiLCJPcmdVbml0SWQiOiI1NWVmM2YwY2Y3MjNhYTQzMWM5OWI0MzgifQ.Yw9cB9Hdrg71GPL40oAC0g3CVKYElNGe0uvN9JAaw2E"></form>Add JavaScript to Submit the Device Data
Add JavaScript to invoke the iframe form POST. Place the JavaScript after the closing </body> element as shown in this example. The JavaScript invokes the iframe form POST automatically when the window loads. You must submit it before requesting the Check Enrollment service.
<script>window.onload = function() {var cardinalCollectionForm = document.querySelector('#cardinal_collection_form');if(cardinalCollectionForm) // form existscardinalCollectionForm.submit();}</script>Listen for the URL Response
The response confirms that the device data collection URL completed its processing. The response is an event callback that contains a message with the status of the device data collection process.
Use the event.origin URL that corresponds to your environment:
https://centinelapi.cardinalcommerce.com
https://centinelapistag.cardinalcommerce.com
Add JavaScript to receive the response from the device data collection iframe. Place the JavaScript after the closing </body> element.
window.addEventListener("message", function(event) { if (event.origin === "https://centinelapistag.cardinalcommerce.com") { console.log(event.data); }}, false);This example shows a response payload from the event. None of the returned data needs to be stored for future use.
{ "MessageType": "profile.completed", "Session Id": "f54ea591-51ac-48de-b908-eecf4ff6beff", "Status": true}Check Enrollment
Request the Check Enrollment service only after you receive the device data collection response. If you check enrollment before receiving the device data collection response, data collection stops. Data collection can take up to 10 seconds. Set a timer that expires after 10 seconds of waiting for a response to the data collection so that the check enrollment service starts even when the device data collection response was not received.
With the device data collected, the issuer runs a risk assessment that results in one of these outcomes:
- Frictionless success (low risk)
- Challenge required (moderate risk)
- Frictionless failure or decline (high risk)
Enrollment Check Endpoint
POST /risk/v1/authentications
POST /risk/v1/authentications
POST /risk/v1/authentications
Enrollment Check Request Fields
The consumerAuthenticationInformation.referenceId field is mapped from the consumerAuthenticationInformation.referenceId field as discussed in Request the Setup Service.
The consumerAuthenticationInformation.returnUrl value is set to the URL to which the issuing bank redirects the customer as discussed in Present the Step-Up Challenge.
These fields are required (merchant ID is in the header):
Required Fields for Enrollment Check
buyerInformation.mobilePhone
If no other phone number is available.
buyerInformation.workPhone
If no other phone number is available.
consumerAuthenticationInformation.referenceId
consumerAuthenticationInformation.returnUrl
deviceInformation.ipAddress
orderInformation.amountDetails.currency
orderInformation.amountDetails.totalAmount
orderInformation.billTo.address1
orderInformation.billTo.administrativeArea
orderInformation.billTo.country
orderInformation.billTo.email
orderInformation.billTo.firstName
orderInformation.billTo.lastName
orderInformation.billTo.phoneNumber
If no other phone number is available.
orderInformation.billTo.postalCode
paymentInformation.card.expirationMonth
paymentInformation.card.expirationYear
paymentInformation.card.type
paymentInformation.card.number
You can send additional request data to reduce your issuer step-up authentication rates. Send all available fields. As a backup, if device data collection fails, include these 11 device information fields in your request. If a failure does occur, adding these device information fields ensures a transaction is not downgraded. If you do not have data for a field, do not send dummy data.
Required Browser Field Values for Check Enrollment
consumerAuthenticationInformation.deviceChannel
deviceInformation.httpAcceptContent
deviceInformation.httpBrowserColorDepth
deviceInformation.httpBrowserJavaEnabled
deviceInformation.httpBrowserJavaScriptEnabled
deviceInformation.httpBrowserLanguage
deviceInformation.httpBrowserScreenHeight
deviceInformation.httpBrowserScreenWidth
deviceInformation.httpBrowserTimeDifference
deviceInformation.ipAddress
deviceInformation.userAgentBrowserValue
You can request the size of the challenge window in the consumerAuthenticationInformation.acsWindowSize request field.
The size of the step-up iframe discussed in Present the Step-Up Challenge can vary depending on the EMV 3-D Secure version of the transaction. Requesting a specific window size does not guarantee this size. Parsing the PAReq as described in Present the Step-Up Challenge determines the actual size.
To request the Check Enrollment service, you must send the encrypted payment data or a token or some other equivalent of card data used by your integration. The request fields can include any of these:
Optional Fields for Enrollment Check
paymentInformation.card.number
paymentInformation.fluidData.descriptor
paymentInformation.fluidData.value
paymentInformation.customer.customerID
tokenInformation.transientToken
Field values must use the ISO 3166-2 format.
Interpreting the Check Enrollment Response
Check the status values in the response. These possible statuses are the same for all card types:
| Status | VERes Enrolled | PARes Status | Description |
|---|---|---|---|
|
|
| The account number is enrolled in payer authentication and the cardholder must complete a challenge. Authenticate the cardholder before authorizing the transaction. When you receive this response, you also receive these fields:
These fields contain values used in the Step-Up service, which runs when a customer is challenged to authenticate. |
AUTHENTICATION_SUCCESSFUL | Y | Y | Frictionless authentication was successful — step-up authentication is not required. The account is enrolled in payer authentication, and the cardholder was successfully authenticated. If enrollment and authorization are made in separate calls, the payer authentication data must be included in the authorization request to receive liability shift protection. |
| Attempt Stand-in Frictionless Authentication | Y | A | This status indicates that the account is enrolled in payer authentication, but the issuer does not support the program. This is called stand-in authentication. If check enrollment and authorization are made in separate calls, the payer authentication data must be included in the authorization request to receive liability shift protection. |
| Card Not Enrolled | B or U | — | This status indicates that the account is not eligible for a payer authentication program, authentication was bypassed, or an error or timeout occurred. If enrollment and authorization are made in separate calls, you can request authorization, but there is no liability shift protection. |
| Unavailable Frictionless Authentication | Y | U | This status indicates that the account is enrolled in payer authentication, but authentication is currently unavailable. The merchant can attempt to retry authentication or proceed with authorization. If enrollment and authorization are made in separate calls, you can continue and request authorization, but there is no liability shift protection. Without authentication of the customer, the merchant remains liable for any chargeback. |
|
|
| This status indicates that the account is enrolled in payer authentication but frictionless authentication failed. Merchants cannot submit this transaction for authorization. Instead, ask for another form of payment. Display a message from the card issuer to the cardholder using the |
|
|
| This status indicates that the account is enrolled in payer authentication but frictionless authentication was rejected by the issuing bank without requiring a challenge. Merchants cannot submit this transaction for authorization. Instead, ask for another form of payment. Display a message from the card issuer to the cardholder using the |
Present the Step-Up Challenge
Initiate step-up authentication on the front end after you receive the response as discussed in Check Enrollment. Frictionless authentication does not require this step-up iframe step. This step is only for step-up authentication when the issuing bank wants to challenge the cardholder.
When a challenge is needed to prove a customer's identity, a JSON Web Token is returned to you that contains a step-up URL. You open an iframe where the access token to the step-up URL (also known as the endpoint) is posted. The iframe must be sized appropriately to enable the cardholder to complete the challenge. The iframe manages customer interaction with the card-issuing bank's access control server. The bank asks the customer to provide identifying information. After the customer completes the challenge, the process moves to validating the information that the customer sent.
Build the iFrame Parameters
The iframe you display should be sized to enable the customer bank to exchange authentication information between itself and the customer. You choose the iframe parameters and pass the window size to the issuer.
Because a bank can use various methods to authenticate, the iframe has four size options. The bank requests that you ensure the iframe size provides room to display the bank logo and the card network being used, the amount of the transaction, and a brief explanation of what the customer needs to do. You manage the size of the challenge window to ensure that the challenge window matches with your presentation screen.
- Use the JWT POST Parameter value from the
consumerAuthenticationInformation.accessTokenresponse field and do a form POST within the iframe to the step-up URL value passed by theconsumerAuthenticationInformation.stepUpUrlresponse field. - MD POST Parameter: Merchant-defined data returned in the response. This field is optional.
- Iframe height and width: EMV 3-D Secure 2.x offers multiple size options:
- Use the
consumerAuthenticationInformation.acsWindowSizerequest field to request a specific window size. - Use the
consumerAuthenticationInformation.pareqresponse field to determine iframe dimensions by Base64 decoding the string and cross-referencing a Challenge Window Size value with its corresponding size.
- Use the
This table lists the possible values for iframe size and the sizes associated with the value.
| Challenge Window Size Value | Step-Up Iframe Dimensions (Width x Height in pixels) |
|---|---|
| 01 | 250 x 400 |
| 02 | 390 x 400 |
| 03 | 500 x 600 |
| 04 | 600 x 400 |
| 05 | Full screen |
This is an example of the decoded value:
{ "messageType": "CReq", "messageVersion": "2.2.0", "threeDSServerTransID": "c4b911d6-1f5c-40a4-bc2b-51986a98f991", "acsTransID": "47956453-b477-4f02-a9ef-0ec3f9f779b3", "challengeWindowSize": "02"}Create the iFrame
Create an iframe that is the same size as the Challenge Window Size to send a POST request to the step-up URL.
<iframe name="step-up-iframe" height="400" width="400"></iframe><form id="step-up-form" target="step-up-iframe" method="post" action="https://centinelapistag.cardinalcommerce.com/V2/Cruise/StepUp"> <input type="hidden" name="JWT" value="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmNmFmMTRmOS04YWRjLTRiNzktOGVkYS04YWVlMTI2NTkzZTEiLCJpYXQiOjE1OTYwNTEyNzYsImlzcyI6IjVkZDgzYmYwMGU0MjNkMTQ5OGRjYmFjYSIsImV4cCI6MTU5NjA1NDg3NiwiT3JnVW5pdElkIjoiNTVlZjNmNTZmNzIzYWE0MzFjOTlkNTRiIiwiUGF5bG9hZCI6eyJBQ1NVcmwiOiJodHRwczovLzBtZXJjaGFudGFjc3N0YWcuY2FyZGluYWxjb21tZXJjZS5jb20vTWVyY2hhbnRBQ1NXZWIvY3JlcS5qc3AifX0.H8j-VYCJK_7ZEHxGz82_IwZGKBODzPaceJNNC99xZRo" /> <input type="hidden" name="MD" value="optionally_include_custom_data_that_will_be_returned_as_is" /></form>Use JavaScript to Invoke the iFrame
Add JavaScript to invoke the iframe form POST. Place the JavaScript after the closing </body> tag. The JavaScript invokes the iframe form POST automatically when the window loads. While you can submit the form at a different time, you must submit the form before requesting the validation service.
<script>window.onload = function() { var stepUpForm = document.querySelector('#step-up-form'); if(stepUpForm) // Step-Up form exists stepUpForm.submit();}</script>Receive the Step-Up Results
After the customer interacts with the issuing bank, the customer is returned to the consumerAuthenticationInformation.returnUrl within the iframe as specified in Check Enrollment. Because you host the return URL, you can close the iframe after redirection.
The response sent back to the return URL contains these values:
- Transaction ID: (
consumerAuthenticationInformation.authenticationTransactionIdresponse field). This value is used in Validate the Results. - MD: merchant data returned if present in the POST to step-up URL; otherwise, null.
TransactionId=BwNsDeDPsQV4q8uy1Kq1&MD=nullValidate the Results
When you receive the step-up response as discussed in Present the Step-Up Challenge, verify that the customer was successfully authenticated. Frictionless authentication does not require this validation step. Validation is required only for step-up authentication.
Validation Endpoint
POST /risk/v1/authentication-results
POST /risk/v1/authentication-results
POST /risk/v1/authentication-results
Validation Request Fields
The consumerAuthenticationInformation.authenticationTransactionId field in this step is mapped from the consumerAuthenticationInformation.authenticationTransactionId field in Present the Step-Up Challenge.
These fields are required:
Required Fields for Validation
clientReferenceInformation.code
consumerAuthenticationInformation.authenticationTransactionId
orderInformation.amountDetails.currency
orderInformation.amountDetails.totalAmount or orderInformation.lineItems.unitPrice
paymentInformation.card.expirationMonth
paymentInformation.card.expirationYear
paymentInformation.card.number
paymentInformation.card.type
Interpreting the Validation Response
If the authentication is rejected (TransStatus R), Visa, China UnionPay, Elo, JCB, Diners Club, Discover, and American Express recommend not proceeding to authorization. Instead, ask the customer to use another payment method.
Proceed with the order according to the validation response that you receive. The possible validation response statuses are the same for all card types.
Interpreting the Validation Response
AUTHENTICATION_SUCCESSFUL: Successful Step-Up Authentication
Step-up authentication of the customer was successful. If you request the Validate Authentication and Authorization services separately, you must add the required payer validate payload values to your authorization request before you can receive chargeback protection that shifts the liability to the issuer.
AUTHENTICATION_FAILED: Error
If you receive an error from the payment card company, process the order according to your business rules. If the error occurs frequently, report it to customer support. If you receive a system error, determine the cause of the error and proceed with card authorization only when appropriate.
Redirecting Customers to a Pass or Fail Message Page
After authentication is complete, redirect the customer to a page containing a success or failure message. You must ensure that the messages displayed to customers are accurate and complete, and that the message addresses all possible scenarios for enrolled and non-enrolled cards. For example, if the authentication fails, display a message such as this to the customer:
Authentication FailedYour card issuer cannot authenticate this card. Please select another card or form of payment to complete your purchase.After Implementation and Before Go Live
Use the test cases to test your preliminary code and make appropriate changes. See Testing Payer Authentication Services. Testing ensures that your account is configured for production and that your transactions are processed quickly and correctly.
Thanks for your feedback!
Last published: October 28, 2026