What is 3D Secure?
3D Secure adds an extra layer of protection to card payments. Like two-factor authentication for your bank account, it helps prevent fraud and protects your customers. 3DS (3D Secure) verifies that your customer is the legitimate cardholder. When triggered, customers verify their identity using:SMS Verification
One-time code sent via text message
Biometric Auth
Face ID, fingerprint, or other biometrics
Banking App
Confirmation through bank’s mobile app
Security Questions
Personal security questions or PINs
The authentication method is determined by the issuing bank (and region). It isn’t selected by Cheqpay or the merchant, and it may vary per transaction.
When Does 3DS Trigger?
3DS is automatically activated for:- High-risk transactions - Based on fraud scoring
- Large payment amounts - Above certain thresholds
- International cards - Cards issued outside Mexico
- Bank requirements - Issuing bank policies
- Regulatory compliance - PSD2 in Europe and similar regulations
You don’t need to decide when to use 3DS - we handle it automatically based on risk assessment and regulations.
How 3D Secure Works
1
Create Order
Send your payment request as usual to
POST /v2/payment-orders2
Check Order Response
If 3DS is required, status will be
PAYER_AUTHENTICATION_DEVICE_DATA_REQUIRED.3
Collect and Submit Device Data
Display an invisible iframe to collect device data and send the data to
POST /v2/payment-orders/{id}/payer-authentication4
Check Authentication Response
If further challenge is needed, status will be
PAYER_AUTHENTICATION_CHALLENGE_REQUIRED.5
Display Challenge
Display an iframe for the customer to complete the 3DS challenge.
6
Validate
Once the customer completes challenge, call
POST /v2/payment-orders/{id}/payer-authentication/validate to complete the payment.Implementation
1. Create Order
Send a normal payment order request toPOST /v2/payment-orders.
Create Payment Order Request Example
Create Payment Order Request Example
2. Check Order Response
If device data is required, you’ll receive a response with statusPAYER_AUTHENTICATION_DEVICE_DATA_REQUIRED and payerAuthentication field that will be used in the next step.
Create Payment Order Response Example
Create Payment Order Response Example
3 Collect and Submit Device Data
3.1 Collect Device Data
Using thepayerAuthentication.url and payerAuthentication.jwt from the response, create an invisible iframe to collect device data.
When the data collection is complete, you’ll receive a callback event. event.data is a JSON containing the SessionId needed for the next step.
Here are examples using plain HTML and JavaScript, as well as a React component version.
Collect Device Data HTML Example
Collect Device Data HTML Example
index.html
Collect Device Data React Example
Collect Device Data React Example
DeviceDataCollector.jsx
3.2 Submit Device Data
Once you receive theSessionId from the iframe callback, submit it to Cheqpay API passing it through collectionReferenceId field via POST /v2/payment-orders/:id/payer-authentication.
Submit Device Data Reequest Example
Submit Device Data Reequest Example
4. check Authentication Response
Check the status in the response. If it’sPAYER_AUTHENTICATION_CHALLENGE_REQUIRED, proceed to display the challenge.
Submit Device Data Response Example
Submit Device Data Response Example
5. Display Challenge
Using thepayerAuthentication.url and payerAuthentication.jwt from the response in step 4, display the 3DS challenge iframe where the customer will complete identity verification.
Display Challenge Example HTML
Display Challenge Example HTML
Display Challenge Example React
Display Challenge Example React
Improve Success Rates
Include Device Information
Sending device data helps banks assess risk and approve payments without showing challenges:Best Practices
Always Include Device Info
Always Include Device Info
Device fingerprinting reduces friction by enabling frictionless 3DS flows.
Save Payment Methods
Save Payment Methods
Returning customers with saved cards are less likely to trigger 3DS challenges.
Consistent Customer Data
Consistent Customer Data
Use the same customer information across payments for better risk scoring.
Local Processing
Local Processing
Process from the same region when possible to reduce risk signals.
3D-Secure testing data
Use these test cards in sandbox:Next Steps
Process Card Payments
Learn about basic card payment processing
Save Payment Methods
Reduce 3DS challenges with saved cards
Testing Guide
Test all 3DS scenarios in sandbox
Error Handling
Handle authentication failures gracefully