Skip to main content

Overview

3D Secure (3DS) is an authentication protocol that adds an extra layer of security for online card transactions, reducing the risk of unauthorized card usage and mitigating fraud by requiring additional authentication from the cardholder. When a card authorization requires 3DS, Payrails returns the information needed to take the customer through the challenge as part of the authorization flow. This page covers:
  • The two integration patterns for handling the 3DS redirect
  • API mode, where you render the bank’s 3DS screens in your own iframes
  • The threeDS response object you receive when authentication completes
If you’re using the Payrails Drop-in or any of our SDKs, 3DS is handled for you and you can skip to the threeDS object reference.

Handling 3DS during authorization

When you authorize a card payment via API, the response includes a links.consumerWait URL. You can use it in one of two ways.

Managed redirect with consumerWait

Redirect the customer to links.consumerWait after authorizing. Payrails handles the 3DS challenge if one is required, and returns the customer to your returnInfo.success URL when the session is complete. This is the integration pattern documented in our accept payments via API and authorize a payment guides. The customer sees a Payrails-hosted intermediate page while the execution resolves, followed by either the 3DS challenge or your return URL. If you’d rather handle the 3DS redirect yourself (for example, to avoid showing a Payrails-hosted intermediate page on non-3DS payments), you can detect the 3DS step from the execution state and redirect to links.3ds directly. 3D Secure manual redirect flow
  1. After calling Authorize a payment, long-poll the execution:
  2. When the request returns, check actionRequired on the execution:
    • If actionRequired is "3ds", redirect the customer to links.3ds.
    • If actionRequired is absent and the authorization has reached a terminal state, no challenge was required.
  3. After the 3DS challenge completes, Payrails redirects the customer to your returnInfo.success URL. The final authorization result arrives via webhook notification.
Note that this pattern handles 3DS only. If you use payment methods that require other types of redirects (such as APM hosted payment pages), the managed flow above handles those transparently while the manual flow does not.

3DS API mode

In API mode, Payrails returns the bank’s 3DS screens as form data in requiredAction, instead of a link to the Payrails-hosted 3DS page. You post each form from an iframe on your own checkout page, so the customer never leaves it. API mode has these requirements:
  • Payrails enables API mode for your merchant account. Ask your Payrails contact to turn it on.
  • The payment runs a 3DS step in a modular workflow, and the step uses Netcetera as its 3DS provider.
  • You send the customer’s browser data in meta.clientContext, because the Payrails 3DS page that collects it in hosted mode isn’t used.
Payments that don’t ask for API mode keep the hosted flow.

Request API mode

Add meta.threeDSOptions to the authorize request, together with the customer’s browser data:
The Meta reference describes every field.

Render the fingerprint step

Long-poll the execution after you authorize, as in the manual redirect pattern. When the bank supports the 3DS Method, the execution returns a requiredAction with threeDSStep set to fingerprint:
  1. Create a hidden iframe.
  2. Inside it, submit a form to href with method, and send each entry in parameters as a form field (application/x-www-form-urlencoded).
href is the bank’s 3DS server. The bank notifies Payrails directly when the fingerprint finishes, and Payrails continues after at most methodTimeoutSeconds. You don’t need to call Payrails. threeDSMethodData holds base64url-encoded JSON with the Payrails notification URL and the 3DS transaction ID. Send it to the bank unchanged.

Render the challenge step

If the bank asks the customer to authenticate, the next requiredAction has threeDSStep set to challenge, with a creq form field and no renderMode:
  1. Show a visible iframe, for example in a modal.
  2. Inside it, submit a form to href with method, and send parameters.creq as a form field.
The customer completes the challenge inside the iframe. The bank then posts the challenge response (cres) to your challengeNotificationUrl. Use that request only as a signal to close the iframe: the 3DS result doesn’t come from it. links.3ds isn’t returned for either step in API mode.

Get the result

Payrails receives the 3DS result from Netcetera and continues the workflow. Read the outcome from the execution or from the executionActionCompleted notification, the same as in hosted mode. The threeDS object carries transStatus, eci and authenticationValue. When a fingerprint ends without a challenge, the requiredAction disappears and the workflow continues.

Errors

The 3DS step fails with request.param.invalid before Payrails contacts Netcetera when:
  • API mode isn’t enabled for your merchant account.
  • A threeDSOptions value is invalid. The error names the field.
  • The 3DS step uses a provider other than Netcetera.
  • A required clientContext field is missing. The error lists the missing fields.
The error appears in the errors of the authorization’s executionActionCompleted event.

The threeDS object

The threeDS object encapsulates various parameters related to the 3DS authentication process. It provides detailed information about the authentication status, transaction identifiers, and relevant parameters. You can expect to receive the threeDS object in the Notifications under paymentComposition. Below is a breakdown of the key components within the threeDS object:
The structure of the object is based in the EMV 3DS 2.3.1.1 specification (PDF). However, depending on the availability of those fields in the response from your payment provider, we may not have all of them for all cases. Please contact our team to make sure you will get all the information you need for your processing.

Parameters

eci values

According to the 3DS specification, the following are the possible values for the eci field.

transStatus values

According to the 3DS specification, the following are the possible values for the transStatus field.
Last modified on November 26, 2026